Вопрос

При попытке сохранить уведомление возникает ошибка

Добрый день! 

Пытаюсь создать уведомление: 

ISchemaManagerItem<Terrasoft.Core.Entities.EntitySchema> reportSchemaItem = UserConnection.EntitySchemaManager.GetItemByName("Contact");
Terrasoft.Core.Entities.EntitySchema remindingSchema = UserConnection.EntitySchemaManager.GetInstanceByName("Reminding");
Entity reminding = remindingSchema.CreateEntity(UserConnection);
reminding.SetDefColumnValues();
reminding.SetColumnValue("AuthorId", UserConnection.CurrentUser.ContactId);
reminding.SetColumnValue("ContactId", UserConnection.CurrentUser.ContactId);
reminding.SetColumnValue("SourceId", RemindingConsts.RemindingSourceAuthorId);
reminding.SetColumnValue("RemindTime", UserConnection.CurrentUser.GetCurrentDateTime());
reminding.SetColumnValue("SysEntitySchemaId", reportSchemaItem.UId);
reminding.SetColumnValue("LoaderId", reportSchemaItem.UId);
reminding.SetColumnValue("SubjectId", Guid.Empty);
reminding.SetColumnValue("SubjectCaption", "Caption");
reminding.Save();

на Save() возникает ошибка:

   at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
   at Ninject.KernelBase.Resolve(IRequest request)
   at Ninject.ResolutionExtensions.GetResolutionIterator(IResolutionRoot root, Type service, Func`2 constraint, IEnumerable`1 parameters, Boolean isOptional, Boolean isUnique)
   at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters)
   at Terrasoft.Core.Factories.ClassFactory.<>c__DisplayClass15_0`1.<Get>b__0()
   at Terrasoft.Core.Factories.ClassFactory.GetInstance[T](Func`1 action)
   at Terrasoft.Core.Factories.ClassFactory.Get[T](ConstructorArgument[] constructorArguments)
   at Terrasoft.Configuration.RemindingEventsProcess`1.SendNotification() in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.NUI_Entity.cs:line 278
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.OnInsertedHandle() in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1229
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.RemindingInsertedScriptTaskExecute(ProcessExecutingContext context) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1158
   at Terrasoft.Core.Process.ProcessScriptTask.InternalExecute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessScriptTask.Execute(ProcessExecutingContext context, Func`2 internalExecute)
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.ProcessQueue(ProcessExecutingContext context) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1081
   at Terrasoft.Configuration.RemindingEventsProcess`1.ProcessQueue(ProcessExecutingContext context) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.NUI_Entity.cs:line 225
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.OnExecuted(Object sender, ProcessActivityAfterEventArgs e) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1032
   at Terrasoft.Core.Process.ProcessFlowElement.OnExecuted(ProcessActivityAfterEventArgs e)
   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.ProcessQueue(ProcessExecutingContext context) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1086
   at Terrasoft.Configuration.RemindingEventsProcess`1.ProcessQueue(ProcessExecutingContext context) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.NUI_Entity.cs:line 225
   at Terrasoft.Configuration.BaseEntity_Base_Entity_TerrasoftEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\BaseEntity.Base_Entity.cs:line 1251
   at Terrasoft.Configuration.BaseEntityEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\BaseEntity.LocalMessage_Entity.cs:line 257
   at Terrasoft.Configuration.Reminding_Base_Entity_TerrasoftEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 1345
   at Terrasoft.Configuration.RemindingEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.NUI_Entity.cs:line 285
   at Terrasoft.Core.Entities.Entity.ThrowEvent(String message, EventArgs eventArgs)
   at Terrasoft.Configuration.Reminding_Base_Entity_Terrasoft.<InitializeThrowEvents>b__90_2(Object s, EntityAfterEventArgs e) in C:\inetpub\BPMdevelopment\Terrasoft.WebApp\Terrasoft.Configuration\Autogenerated\Src\Reminding.Base_Entity.cs:line 741
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Terrasoft.Core.Entities.Entity.OnInserted(EntityAfterEventArgs e)
   at Terrasoft.Core.Entities.Entity.InsertToDB(Boolean skipLookupColumnValues, Boolean validateRequired)
   at Terrasoft.Core.Entities.Entity.InternalSave(Boolean validateRequired, Boolean setColumnDefValue)
   at Terrasoft.Core.Entities.Entity.Save(Boolean validateRequired, Boolean setColumnDefValue)

что я делаю не так?

Нравится

5 комментариев

А какой сам текст ошибки? Он где-то над стеком.

 

Error creating an instance of the "Terrasoft.Configuration.INotificationSender" class
 
Error activating INotificationSender
No matching bindings are available, and the type is not self-bindable.
Activation path:
  1) Request for INotificationSender
 
Suggestions:
  1) Ensure that you have defined a binding for INotificationSender.
  2) If the binding was defined in a module, ensure that the module has been loaded into the kernel.
  3) Ensure you have not accidentally created more than one kernel.
  4) If you are using constructor arguments, ensure that the parameter name matches the constructors parameter name.
  5) If you are using automatic module loading, ensure the search path and filters are correct.

 

Руслан, на объекте Reminding во встроенном БП ничего не менялось? В частности, функция SendNotification у Вас стандартная?

На объекте Reminding ни чего не менялось. Хотя из приложения уведомления создаются, а из Visual Studio выбрасывается исключение. 

Видимо, часть логики ядра, которую вызывает строчка

 var notificationSender = ClassFactory.Get&lt;INotificationSender&gt;( 

в функции SendNotification() встроенного БП объекта Reminding, не совместима с запуском извне. По самому сообщению обсуждают здесь.

 

Если обойти не получится, создавать запись можно внутри системы, а если нужно извне — по OData, обращением к веб-сервису или запуском БП.

Показать все комментарии