I need to run a process when create a new record, in this case invoke it from onEntityInitialized method just in case is a new record or a copy from another (this.isAddMode() || this.isCopyMode())
But don't know how to call a process from there, and how to pass parameters, is it possible?
You can use this article as a reference on how to trigger the process from the client and pass process parameters to the process.
As for calling the process upon creating a new record - onEntityInitialized is not a good choice here since the process call will be triggered once the page is loaded for adding a new record, but not once all the data on the page is specified and the record should be saved. In our case it's better to use save function and overwrite its logic. For example in a following manner:
1) We have a UsrTestJSON object which is a section in the system and has UsrTestJSON1Page as an edit page.
2) UsrTestJSON object has following columns:
UsrTransType - Text (250 characters) data type column
UsrPolicyNumber - Text (500 characters) data type column
UsrTransTime - Time data type column
UsrTransDate - Date data type column
3) We need to call the custom process called "Test JSON page process" with the following schema once the record is saved upon creation:
Please note that the process code is Process_20340ad and the process parameter codes should be the same as process parameter names (as an example please see UsrTransType parameter declaration).
4) Add the following code to the UsrTestJSON1Page schema:
usrTransType, usrPolicyNumber, usrTransDate and usrTransTime variables are received from the page before saving the record (using this.get method).
So you need to develop the logic similar to described above using your own object, process and page schema. As a result the process will return the data specified when creating a new record:
You can use this article as a reference on how to trigger the process from the client and pass process parameters to the process.
As for calling the process upon creating a new record - onEntityInitialized is not a good choice here since the process call will be triggered once the page is loaded for adding a new record, but not once all the data on the page is specified and the record should be saved. In our case it's better to use save function and overwrite its logic. For example in a following manner:
1) We have a UsrTestJSON object which is a section in the system and has UsrTestJSON1Page as an edit page.
2) UsrTestJSON object has following columns:
UsrTransType - Text (250 characters) data type column
UsrPolicyNumber - Text (500 characters) data type column
UsrTransTime - Time data type column
UsrTransDate - Date data type column
3) We need to call the custom process called "Test JSON page process" with the following schema once the record is saved upon creation:
Please note that the process code is Process_20340ad and the process parameter codes should be the same as process parameter names (as an example please see UsrTransType parameter declaration).
4) Add the following code to the UsrTestJSON1Page schema:
usrTransType, usrPolicyNumber, usrTransDate and usrTransTime variables are received from the page before saving the record (using this.get method).
So you need to develop the logic similar to described above using your own object, process and page schema. As a result the process will return the data specified when creating a new record:
You can trigger a business process from Client JS code using the ProcessModuleUtilities module. You can inject it as a dependency in a Client schema and call the executeProcess(args) method to call a business process. Business process parameters can be set in the parameters attribute inside the argument you pass to the executeProcess method. Request you to go through this academy link for more information.
If your use case is to trigger a business process 'after' a new record is created, there are a few ways of doing it. You could use the 'Record created' trigger in the Business process designer. Or you can also choose to do it from the service side by listening to entity events on the specific section/object. You can get more details in this academy link.
Thank you for your response, I know about Traces parameter, but actually I'm trying to debug server side business process' c# code(script task) in visual studio.
This is only possible using C# interactive tools like dnSpy (can be downloaded from here) where you need to connect to w3wp.exe process of your application pool and debug the logic in real time.
As for connecting the app to Visual Studio - you can do it, but this feature was developed to allow development in the File system, but not debugging.
define("AccountPageV2", ["ProcessModuleUtilities"], function(ProcessModuleUtilities){return{
entitySchemaName:"Account",
methods:{// Проверяет, заполнено ли поле [Основной контакт] страницы.
isAccountPrimaryContactSet: function(){returnthis.get("PrimaryContact")?true:false;},
// Переопределение базового виртуального метода, возвращающего коллекцию действий страницы редактирования.
getActions: function(){
var actionMenuItems =this.callParent(arguments);
actionMenuItems.addItem(this.getActionsMenuItem({
Type:"Terrasoft.MenuSeparator",
Caption:""}));
actionMenuItems.addItem(this.getActionsMenuItem({"Caption":{ bindTo:"Resources.Strings.CallProcessCaption"},
"Tag":"callCustomProcess"}));return actionMenuItems;},
// call you porcess
callCustomProcess: function(){
var contactParameter =this.get("PrimaryContact");
var args ={// Process name
sysProcessName:"UsrCustomProcess",
// parameters process
parameters:{
ProcessSchemaContactParameter: contactParameter.value}};// run process
ProcessModuleUtilities.executeProcess(args);}}};});
string name = string.Empty;
string email = string.Empty;
Guid RecordId = Guid.Empty;/**
* This approach should not be used in production
* Please create process parameters and set values with standard tools (i.e. Formula)
* ReadDataUserTask1 is the Code of "Read One Contact" element
*/
var re = context.Process.FindFlowElementByName("ReadDataUserTask1").GetPropertyValue("ResultEntity");if(re.TryGetPropertyValue("Email", out object _email)){
email = _email.ToString();}if(re.TryGetPropertyValue("Name", out object _name)){
name = _name.ToString();}if(re.TryGetPropertyValue("Id", out object _id)){if(Guid.TryParse(_id.ToString(), out Guid Id)){
RecordId = Id;}}//Set values to process parameters
Set<string>("Name", name);
Set<string>("Email", email);
Set<Guid>("RecordId", RecordId);returntrue;
This is a system field that stores the information about processes Creatio can run when a record is edited or deleted. We do not recommend editing it. If you would like to learn more about the way Creatio uses this field, you should review the TryProcessComplete and ProcessCompleteExecuting methods in the BaseEntity object.
This is a system field that stores the information about processes Creatio can run when a record is edited or deleted. We do not recommend editing it. If you would like to learn more about the way Creatio uses this field, you should review the TryProcessComplete and ProcessCompleteExecuting methods in the BaseEntity object.
On my application I've used the Aspose.PDF connector plugin for Creatio! Then, I created a new printable and set the "Convert to PDF" property true, as you can see in the image below.
After that, I create a new process in which I am using the plugin process element (Save printable) and in that element I set the parameter "Conver to PDF" to true but the attachment is always saved as a .docx file, regardless of setting of the parameter "Convert to PDF" be true or false.
Can you help me solving this issue and explain me why the document saved in the attachments is always in .docx format?
I apologize for the delay. The [Save printable] element was developed when both .docx and .pdf formats were available out-of-the-box. As such, the "Convert to PDF" parameter is not compatible with the Aspose connector for Creatio. The team in charge does not plan to update this feature in the add-on.
However, note that Creatio released the [Process file] business process element to generate custom MS Word or Fast Report reports in version 7.17.2.
You can add multiple emails by clicking the button next to the 'To' field in the [Send email] element. You can add emails from process parameters, lookups, system settings. Please check a screenshot below to see how the selected multiple emails look like in the process element.
If I have a string of multiple addresses, I don't know how many at the time I create the business process , so I can't add + to the TO when I create the business process, Is there a way to add + inside the business process when it runs (like loop over all addresses and add TOs)?
Thanks Dean, but what I need is to create a user task (activity) connected to case resolution, and its title is the localizable text business parameter I need to create. I have been through lots of academy stuff, but it is not clear to me how to create a localizable text business process parameter.
Do you need to read the case resolution description submitted by a user and use it in the activity, let's say, put it into the activity subject but in different language?
We have a use case where some business logic has been implemented as a business process and the output of it is set to 2 business process parameters. We need to trigger this BP from source code and read the output parameters after execution of the process. The execution part is straight forward. The reading of parameters is not.
I went through various articles/questions on the community related to these. But most of them only talk about executing a process by setting parameters and not reading parameters after execution. Request some assistance.
I also went through the IProcessExecutor documentation here and it permits to retrieve one result parameter. What if I need to read more than 1 parameter at the end of the business process execution?? Is there any other way to execute a BP from server side code and get the output parameter?
Note - I am aware that the Business process can be executed via a Http call to the ProcessEngineService and output parameters retrieved via the ResultParameterName query parameter. This is not a viable option for us. Additionally, it only permits one ResultParameterName and not reading multiple business process parameters.
// getting UserConnectionUserConnection userConnection = GetUserConnection();// getting IProcessExecutor
IProcessExecutor processExecutor = userConnection.ProcessEngine.ProcessExecutor;// List of input parameters
var inputParameters =new Dictionary<string, string>{["ProcessSchemaParameter1"]="Value1",
["ProcessSchemaParameter2"]="Value2"};// List of output parameters
var resultParameterNames =new string[]{"ProcessSchemaParameter3",
"ProcessSchemaParameter4"};
string processSchemaName ="processSchemaName";
Guid processSchemaUId = Guid.Parse("00000000-0000-0000-0000-000000000000");// Run the process by schema name and forwarding output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, resultParameterNames);// Run the process by schema UId and forwarding output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaUId, resultParameterNames);// Run the process by schema name with forwarding input and output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, inputParameters, resultParameterNames);// Run the process by schema UId with forwarding input and output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaUId, inputParameters, resultParameterNames);
You can also get values of the resulting parameters by accessing the ResultParameterValues property of the IReadOnlyDictionary <string, object> type of the ProcessDescriptor class:
// getting UserConnectionUserConnection userConnection = GetUserConnection();// getting IProcessExecutor
IProcessExecutor processExecutor = userConnection.ProcessEngine.ProcessExecutor;// List of input parameters
var inputParameters =new Dictionary<string, string>{["ProcessSchemaParameter1"]="Value1",
["ProcessSchemaParameter2"]="Value2"};// List of output parameters
var resultParameterNames =new string[]{"ProcessSchemaParameter3",
"ProcessSchemaParameter4"};
string processSchemaName ="processSchemaName";
Guid processSchemaUId = Guid.Parse("00000000-0000-0000-0000-000000000000");// Run the process by schema name and forwarding output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, resultParameterNames);// Run the process by schema UId and forwarding output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaUId, resultParameterNames);// Run the process by schema name with forwarding input and output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, inputParameters, resultParameterNames);// Run the process by schema UId with forwarding input and output parameters
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaUId, inputParameters, resultParameterNames);
You can also get values of the resulting parameters by accessing the ResultParameterValues property of the IReadOnlyDictionary <string, object> type of the ProcessDescriptor class:
'Save Printable' (keep in mind that we tried with a script first but we switched to this for ease of use)
Whenever we trigger our business process manually, the pdf gets created automatically. Whenever the BP gets triggered by the portal, the attachment doesn't get converted. We still use the same BP with the same values.
We call the invoice through API and set it to "Complete". As soon as this happens, we trigger the following flow which is the subprocess: https://prnt.sc/zz2uut
Here we have the "save printable" block.
Everything works except when the status is set to complete through the portal API.
Regarding the second issue, we need you to run a check-up and get back to us with the results.
Please set the printables generation to .docx printables in the subprocess in the 'Save printable' element. Run the business process and tell us if a .docx printable is successfully generated when the BP is triggered by the portal.
If we set the processs to docx, everything works. Right now, when we change the generated pdf (through portal) file to ".docx", we can open it in word.