In Creatio, you can run a business process programmatically using the ProcessExecutor. This is especially useful when you need to initiate a process as part of custom logic, for example, in an event listener or a web service.
// Get the ProcessExecutor from the current SystemUserConnection
IProcessExecutor processExecutor = SystemUserConnection.ProcessEngine.ProcessExecutor;
// Prepare a dictionary of input parameters (name must match process parameter names)
var inputParameters = new Dictionary<string, string>
{
["param"] = "Param"
};
// Specify the internal name (code) of the business process
string processSchemaName = "ProcessCode";
// Execute the business process
ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, inputParameters);