Question

Mobile app -> event -> workflow does not trigger

  • 11 April 2024
  • 6 replies
  • 61 views

Userlevel 4
Badge +9
  • Hero (Partner)
  • 140 replies

We have following problem with a workflow which does not trigger from a mobile app.

  • We created an event on the ReceiptInfo table (on change of rowstate)
  • If we do a receipt in Aurena / Wadaco in the browser
  • The event triggers 
  • The workflow triggers.

When we use for example the SCANIT app to do a receipt

  • We see the event triggers 
  • But the workflow does not trigger? 

We have set the workflow as async so wondering how we can debug it and how the workflows work together with the mobile apps? 

 

Strange thing is that the custom_event nicely triggers, but not the workflow.

 

@Tharu / @Buddhi Gunasekara / @kamnlk 


6 replies

Userlevel 3
Badge +5

Hi @kvbe,

Few things need to be clarified,

  1. so when you set the workflow as async workflow gets triggered ?
  2. in the scenario 1 (add receipt from browser), is the workflow set as async? or other timing ?
  3. Is the user who is doing the web and mobile app same or atleast have the same permission sets? 

-

You should be able to monitor/view asynchronous workflow runs using the table BPA_ASYNC_SYS_TAB. In here you should be able to see if the job is at least getting submitted 

Im not sure about the SCANIT application itself. but i suspect the ReceiptInfo table update from app comes as a background job. in such a case workflow needs to set as async to be triggered. 

From 23r2 on wards we can capture observation of async job executions using start watch option. 

if you are on a previous version you can use the “ATIR” data in the BPA_ASYNC_SYS_TAB as the input data for troubleshooting (debug) and compare the execution for “IP” status and “DONE”.  (For this you need to convert the ATIR data to valid JSON)

Userlevel 4
Badge +9

@kamnlk Thanks for the tips that helped to assure that the async workflow was actually triggering or not! 

I was not aware about the BPA_ASYNC_SYS_TAB table. 

My main question is now, how can we debug workflows in a better way. 

 

So what I did was the following:

Create a custom event and see if the event triggers in all possible scenario 

  • I used an email action to see if for each time I did my action (aurena / wadaco browser / ifs scanit app) the event was triggered OK
  • Which means I have a working event 

Next step is to create a workflow just with a start and end event 

  • Create an event action to trigger this workflow with a timing async
    • I could see the workflow appearing in the BPA_ASYNC_SYS_TAB table  OK
    • I could see it becomes DONE 

Update the workflow with the logic required

  • Workflow goes into IP stage, without knowing why. 

So my main question is, How can we know what variables are available the moment the workflow executes? How can I know for example , is it PART_NO or PartNo? is "ifsBpaCurrentProjectionName"  actually available yes or no? etc

Can I add an action for example a REST call to an external system to POST the full

execution context to see how the variables arrive at the workflow start event. 

(something like POST ---URL--- ALL EXECUTION VARIABLES in a JSON format)

 

As this is the biggest challenge for ASYNC jobs that you are not 100% what arrives at the workflow. (we are on 23R1 so we cannot upgrade at the moment)

 

So is there a way to get the variable which holds all the execution variables? 

 

 

Userlevel 5
Badge +12

@kvbe I tried this recently, so I can share my experience.

First of all, as you pointed out already, only Async from a timing perspective, and Enrichment from Workflow type are supported when initiated from Mobile apps.

Secondly, the parameters you have access to are the parameters you selected from your Custom Event and Event Action.

Thirdly, on the Workflow step, you need to pick your projection for API Name and the correct EntitySet Name corresponding to the Entity you want to do a CUD operation on. The attributes are referred like ${MyAttribute}, and you can interpolate multiple values into a string. Here below is an example based on an internal development app. I hope this gives you a way forward!

Note that on the Custom Event and the Event Action, your attributes will be in the PL\SQL column name format (e.g.: MY_ATTRIBUTE), but from the Workflow, you would refer to them as below. If I remember correctly, the Watch option also lets you inspect variable values that get passed in.

Best regards,

Rukmal

 

 

Userlevel 4
Badge +9

@Rukmal Fernando  thanks for your comment. 

What I am looking for is can I know what variables are available in the execution? 

So how can I see that ${PartNo} is available? or is it ${PART_NO} , what other ifsBpaxxxx variables are available? 

 

So something like, the full list of parameters available when the workflow starts?

Userlevel 5
Badge +12

@kvbe my expertise is more in Mobile rather than Workflow, but I’ll share my thoughts anyway.

I think the best approach would be to use Observations where you can see the actual parameters available to the Workflow, but based on @kamnlk’s comments, I believe that’s available in 23R2 onwards.

You can also see the values in BPA_ASYNC_SYS_TAB.ATTR column, and you’d expect to see ${PartNo} as $NEW:PART_NO there.

@kamnlk - I hope you can confirm or offer a better suggestion!

Best regards,

Rukmal 

Userlevel 3
Badge +5

What @Rukmal Fernando said is correct, you should be able to see the values passed into the workflow using the BPA_ASYNC_SYS_TAB.ATTR column.

example:

You should be able to see data similar to the following in that column

!WF_RECEIPTINFOEVENT
$LU=ReceiptInfo
$NEW:INV_PART_NO=
$NEW:RECEIPT_NO=1
$NEW:ROWSTATE=Cancelled

 this should ideally be available to workflow as follows. 

{
"InvPartNo":null,
"ReceiptNo":1.0,
"ROWSTATE":"Cancelled"
}

 

Reply