BPT - Wait activities didn't closed as expected with the update to an entity

BPT - Wait activities didn't closed as expected with the update to an entity

  

Hi,

I'm facing an odd behaviour with a BPT process.

Here are the facts:

  1. I had 500 Wait activities with status Waiting
  2. They close with an update to a row in a given entity 
  3. I did the update directly in the DB myself
  4. 480 of the Wait activities closed as expected
  5. 20 Wait are still in status Waiting
  6. There is no callback in this specific Wait (an exception could be being raised but it's not the case)
  7. There is no Error_Id in OSSYS_BPM_ACTIVITY for these activities
  8. All the BPT threads are Idle (Activity Processor, Event Processor)


What am I missing here?

I tried repeating the update several times with no effect. The 20 remaining Wait activities kept their waiting state.


Thanks in advance for any feedback you may give me.


Hi João,

Are you using different tenants/user providers in your application? Be sure that the entity is multi-tenant and the module with the process is using the same User Provider the process/activity.

Hi Joao,

Did you commit that update transaction? A wait activity can bw cloase other ways - timeout or using API.

regards

Mi

Mental Image wrote:

Hi Joao,

Did you commit that update transaction? A wait activity can bw cloase other ways - timeout or using API.

regards

Mi

Sure I did!

I know there are other ways. The one that's implemented is the Close On Update of an entity.


Yesterday I had some more fixing to do and I experienced the same behaviour.

I have x sub-processes (all with a parent process), each one in the same point of the flow - a Wait activity.

I did the manual update in the DB and I could see the activities being closed in the Process Monitor and then some of them remaining in the Wait and not going forward...


 


Hi João,


Any news regarding your findings?

Did you get to any conclusion?

Solution

@Daniel

Well, I had to terminate the Activities manually and hadn't had the time to go back to it.

But I still have the ocasional nightmare about it ;)

If I ever find something more I'll update the post.

Solution

Hi João,

Updating rows in your entity will generate events in the BPT event queue (system entity) that need to be processed for the activities to close. You may have experienced some issue where the events weren't all processed.

Next time you need to do something like this, be sure to keep an eye on the "Processes Events" column in Environment Health (and also on the error log) and check if you are left with events queued or in error.

Hi João

We are having several problems related the database transactions when we update a record, inside another logic action but apparently in the end of the action that updated the record, the transaction is not committed.

In this case, now we are always expliciting committing the transaction by before call any action activity.

Best regards

Tiago Vital

Tiago Bojikian da Costa Vital wrote:

Hi João

We are having several problems related the database transactions when we update a record, inside another logic action but apparently in the end of the action that updated the record, the transaction is not committed.

In this case, now we are always expliciting committing the transaction by before call any action activity.

Best regards

Tiago Vital

Hi Tiago,

Keep in mind that BPT activities execute in a separate database transaction, so there is no guarantee data you just created/updated in your entities will be there, unless you perform that explicit commit right before calling into any BPT activity/process (I'd say this is actually a best practice).

Paulo Cunha wrote:

Tiago Bojikian da Costa Vital wrote:

Hi João

We are having several problems related the database transactions when we update a record, inside another logic action but apparently in the end of the action that updated the record, the transaction is not committed.

In this case, now we are always expliciting committing the transaction by before call any action activity.

Best regards

Tiago Vital

Hi Tiago,

Keep in mind that BPT activities execute in a separate database transaction, so there is no guarantee data you just created/updated in your entities will be there, unless you perform that explicit commit right before calling into any BPT activity/process (I'd say this is actually a best practice).

Yes.

Thank João. 

Best regards 

Tiago Vital