Skip to main content
April 8, 2021
Question

get value of a process variable or task output that is the result of completeTask via webapi

  • April 8, 2021
  • 8 replies
  • 0 views

Hello community,

I have a webapi that updates an instance of a process model by completing an open task.

this task has a input for a main category, example {"fruit", "vegetable"}

the task output: Based on input, (a decision rule is called with ac!category as a parameter).  example category("fruit), result: Apple, Banana, Orange is stored in a pv.

I would like to pass the result / task output or the value of the pv as a result/response of the webapi.

I tried to retrieve the result by calling an expression that gets the pv value from a process report, this doesn't work because the data is not updated yet.
fv!processInfo doesn't apply here because it's not an start process api. (guess that's the reason, it doesn't work)

How can I make this work?

Kind Regards,

Erik

8 replies

stefanhelzle0001
Brainy
April 8, 2021

This is an interesting use case. Would you mind explaining a bit what the goals are?

To get data from a process instance, you would create a process report and use queryProcessAnalytics to fetch the data.

erikb0001Author
April 8, 2021

Hello Stefan,

The goal is interaction between Appian and a frontend webinterface (not Appian).
First the customer presses a button in the frontend and the PM starts, Appian applies logic and if the process meets the criteria to continue the id of the process instance is in the response to the webinterface.
In a second screen the user picks the category, presses a button and Appian will return an array with values for that category.
That array will be the input for a second pulldown menu in the front end.
Of course the logic can also be done in the front end, but want to add more complex logic in the future and it's an architectural decisions to let Appian handle the logic.
We cannot use a datastore for this purpose.

Kind Regards,

Erik  

stefanhelzle0001
Brainy
April 8, 2021

This logic cannot be implemented in expression rules which you would call?