Hi everyone,
I need to call a sub-process from a C# script task, I found this code:
var showAdressProcessUId = new Guid("abfbf7ee-e499-45e9-9d22-b9e91a46683d");
var manager = UserConnection.ProcessSchemaManager;
var schema = (ProcessSchema)manager.GetInstanceByUId(showAdressProcessUId);
var moduleProcess = schema.CreateProcess(UserConnection);
moduleProcess.SetPropertyValue("PageInstanceId", PageInstanceId);
moduleProcess.SetPropertyValue("ActiveTreeGridCurrentRowId", ActiveTreeGridCurrentRowId);
moduleProcess.SetPropertyValue("TreeGridSelectedRowsIds", TreeGridSelectedRowsIds);
moduleProcess.SetPropertyValue("SchemaName", "Contact");
moduleProcess.SetPropertyValue("RouteMode", false);
moduleProcess.Execute(UserConnection);
From ShowContactAddressOnMapProcess
If I use it for my process:
var _sendMailId = new Guid("84e96844-b0ae-4edc-8b5e-20d1ba13fb8b");
var _manager = UserConnection.ProcessSchemaManager;
var _schema = (ProcessSchema)_manager.GetInstanceByUId(_sendMailId);
var _moduleProcess = _schema.CreateProcess(UserConnection);
_moduleProcess.SetPropertyValue("Test1", "Something");
_moduleProcess.Execute(UserConnection);
Throws this exception :
Terrasoft.Common.InvalidObjectStateException: missing property "Test1" of type "ProcessComponentSet".
I would need to know how it works or another way to do it, I need to call a sub-process inside a for loop.
Thanks.