Is it possible to deactivate a business process through a script. I ran an insert script to insert a record in the table SysProcessDisabled. But that did not deactivate the process. Is there any other way to do this via a script?
Like
Hello Payal Motwani,
Deactivating business processes via a script task is not recommended.
If you really need to do it, send a POST request to the endpoint: [CreatioURL]/0/ServiceModel/ProcessEngineService.svc/DisableProcess?sysSchemaId=00000000-0000-0000-0000-000000000000
The sysSchemaId parameter is the process's SysSchemaId, found in the corresponding table:
SELECT "Id" FROM "SysSchema" WHERE "Name" = 'UsrNameOfYourProcess'Before disabling the process, decide how to handle any currently running instances - you may want to cancel them.
To check the count of running processes, send a POST request to [CreatioURL]/0/ServiceModel/ProcessEngineService.svc/GetRunningProcessesCount with the payload:
{
"countSpecifiedVersion": false,
"managerName": "ProcessSchemaManager",
"schemaId": "00000000-0000-0000-0000-000000000000"
}To cancel all running instances of the process, send a POST request to [CreatioURL]/0/ServiceModel/ProcessEngineService.svc/CancelExecutionBySchemaId?schemaId=00000000-0000-0000-0000-000000000000
Eduard Dovydovskyi,
When you say this isn't recommended, does that also apply to binding the disabling of a process as recommended by Bogdan in this thread? https://community.creatio.com/questions/deactivate-processes
Or does that being done via data bindings (and therefore presumably triggering something in the application layer to properly disable the BP) make it ok?
It would be good to have some definitive info (documentation) on doing things like deactivating BPs that will happen automatically when a deployment is done, as that's definitely a gap I've come across several times.