Solved

Calling workflow asynchronously


Userlevel 5
Badge +15

Hello,

 

I’ve been attempting to set up an asynchronous workflow to help with a mixed payment automation we are currently working on. The only issue is that IFS has minimal documentation regarding asynchronous workflows and how to properly set them up. When a workflow is scheduled as Asynchronous, and I check the currently running workflows, this workflow does not appear, but when running the same workflow scheduled as ‘after’ this runs just fine.

Does anyone have any examples? Is there additional setup regarding the ‘Asynchronous before/after’ functionality that is native to Camunda? Any and all input would be greatly appreciated.

 

Thanks,
Bryan

icon

Best answer by Gonzalo 9 May 2024, 10:34

View original

6 replies

Userlevel 4
Badge +7

Hi Bryan,

What did you mean by ‘check currently running Workflows’? How did you do that?

/Lahirumala

Userlevel 3
Badge +8

Hi Bryan.

The only way I know that you can see if a async workflow has been posted/executed is by checking the table BPA_ASYNC_SYS_TAB.

You can create a Quick Report that runs SQL query “SELECT * from BPA_ASYNC_SYS_TAB” to access that information easily from IFS Cloud.

Most probable situation is that your workflow is well designed to be run “AFTER” but it has some problems when run “ASYNC”. When it’s run “ASYNC” it is posted in the table BPA_ASYNC_SYS_TAB, then it’s executed by the workflow engine and it fails without leaving any trace. I had this experience before. You can check the status column and see that it gets stuck in status “IP” which stands for “In-progress” most likely.

To resolve this situation you can create a new version of the workflow, remove some of the sections, just create a simple workflow and try the execution. Check the table BPA_ASYNC_SYS_TAB and see if the status is “DONE”. Then that means it run correctly. Next, add more logic to the workflow and check again. Keep doing so until you detect the issue.

 

Most of the time I found that the problem is with a “Projection Delegate” activity where you try to update using a old ETag value. In such situations try passing “*” as ETag value.

 

OData Upsert and * ETag Support (ifs.com)

From the link above:
 

Working with * ETag

IFS OData Services provides optimistic concurrency control through the use of If-Match Http Header for a number of applicable scenarios. While it provides a valuable protection against Loss Updates in interactive clients, it may be an unnecessary complication for system to system integration.

  • It is now possible to send the If-Match header with the value *, which is interpreted as to match against any value available in the particular resource.
  • The Entity bound operations - Update, Delete, Upload (Streaming), State Event Actions; which previously required an exact ETag match now works with * ETag.

     

I hope this info helps you a bit.


Thank you much.
Best regards.
Gonzalo. 

Userlevel 5
Badge +15

Hi @Lahirumala de Mel 

There is a built-in lobby that shows this information. There is documentation on the lobby itself as well.

Thanks,
Bryan

Userlevel 5
Badge +15

Hi @Gonzalo 

My current workflow which gets asynchronously called is very simple but still failing. It is a read projection call, then a post projection call, to update a customer reminder proposal when created. So far, this fails and gets stuck in IP status after 3 retries.

How simple does the workflow need to be for this?

Thanks,
Bryan

Userlevel 3
Badge +8

Hi Bryan.

 

Most probable reason for your workflow to be failing is because you are updating a Entity Set with old ETag information. Is it OK for you to share the workflow here? I could take a look and try to find the issue.

 

Thank you much.
Best regards.
Gonzalo. 

Userlevel 5
Badge +15

Hi @Gonzalo 

Of course, its a very basic workflow so I have no idea why its getting stuck in progress half the time it runs and completes normally the other half. It seems very very inconsistent, which makes me want to schedule this as after instead of async, but the no event action tied to the new entry in the reminder proposal table has been getting triggered, only when having it created via a scheduled db task. When its a manual entry, it triggers the event action fine.

Workflow:

my event action:

 

Reply