Please advise what could be the problem. 
There is a business process where the start signal (trigger) is set to launch when the text field "CHErrorNotification" in Opportunity is changed. If I change the field manually, the process starts, BUT if I change it via code, nothing happens—the process doesn't start. As you can see in the examples, I'm changing it not through a query; the process should start.

I tried filling the field both during the save and after; in both cases, the field was populated, but the process trigger did not work.
OnSaving

OnSaved

Like 1

Like

2 comments
  1. If an Entity.Save() call occurs in the embedded process or listener. In this case the signal to start the BP is not thrown.

 

You won't be able to trigger the business process using the Entity.Save in your listener. What can be done:

 

  1. 1) Use another approach to trigger the process upon modification of the column
  2. 2) Create an additional method that will perform the very same operations that the business process should perform

Oleg Drobina,
 

Previously, and even now in other systems that I configured earlier, the process starts when such code changes occur. Regarding point 1, can you provide an example?

Show all comments

There are cases when a record is inserted directly from db and the bp doesn't trigger on object signal(Record Added/Modified), how do I proceed in these cases?
 

Like 1

Like

5 comments

A direct database insert/update won't trigger a signal needed for a process to start. Only option I can think of is to flag the record in some way and have a process running on a timer looking for the flagged records.

Ryan

Hello, 

As Ryan indicated,

Unfortunately, it’s not possible through the database.

Regards, 
Orkhan

Thank you both Ryan and Orkhan for your answers

In my case is there any workaround I can use, besides what Ryan mentioned above?

Hi,

 

if you have control over the insert/update process, you could set up a stored procedure in the DB and call it after the insert/update operation. The stored procedure could call the ProcessEngineService.svc via web request.

 

Here is an example with SQL server: How To Call A Web Service From SQL Server (c-sharpcorner.com)

This is the documentation of the ProcessEngineService.svc: Service that runs business processes | Creatio Academy

 

I read it is possible for Postgre, too, but I don't have any experience with it.

Also, if you have a cloud instance of Creatio you might be lacking the permissions to install components to make this work...

 

BR,

Robert

Thanks Robert

I will give it a try.

Show all comments

Is it possible to trigger process's signal from backend (C# code)? 

For example, I modify record of schema in C# code and I want process to become triggered when the record was modified.

I have tried to make it as shown on a picture but it didn`t work. It worked only if the record was changed from UI side.

I would be very appreciated for knowledgebase link concerning this question.

Thank you in advance.

Like 0

Like

3 comments

What does the C# code look like that you're using to trigger it?

Can you provide more details on your custom code since I've created a simple method in the Account object that modifies a contact in the process inside the Account object (using onInserted method):

var contactEntity = UserConnection.EntitySchemaManager.GetInstanceByName("Contact");
			var contactRecord = contactEntity.CreateEntity(UserConnection);
			contactRecord.FetchFromDB("Id", new Guid("9c4111d2-cbf1-49f2-8c2b-00c6a82547c0"));
			contactRecord.SetColumnValue("Name", "From the code");
			contactRecord.Save();

and it triggers the business process with the start signal that is executed when the Contact name is modified. Maybe your logic is not modifying the record in the manner that should trigger the business process.

UsrContactSaved - the process on Contact schema that triggers when Contact record is saved ContactUtilities.ChangeContactStatus - the method that should change Status on schema Contact (this method is scheduled by job)

UsrOnContactStatusChanged - the process that should be triggered when the Status field in Contact schema was changed (but it doesn`t trigger)

So, when UsrContactSaved process triggered, there is a code in it that schedule a job that must call ContactUtilities.ChangeContactStatus in 10 minutes. After 10 minutes triggers ContactUtilities.ChangeContactStatus method and it changes Status via method in C# code.

In conclusion, status changed but UsrOnContactStatusChanged didn`t work. Expected result: UsrOnContactStatusChanged has to be triggered after work of UsrChangeContactStatusProcess process.

Show all comments