Good afternoon,We are in a project where we start a process from a webapi with the function a!starprocess but the process starts asynchronously and we need to start the process synchronously to return the answer when the project had finished If anyone knows, I’d appreciate it.
Best regards,
Rebeca
Discussion posts and replies are publicly visible
a!startProcess only runs asynchronously (https://docs.appian.com/suite/help/19.2/Ways_to_Start_a_Process_From_a_Process.html#comparing-ways-to-start-a-process-from-a-process). While you would not be able to have the Web API tell you when the process has finished, you could add a call integration smart service (https://docs.appian.com/suite/help/19.2/Call_Integration_Smart_Service.html) at the end of the process to notify the third party service when the process is complete. Would that work for your scenario?
What information are you returning from the process? Is the process (1) doing something quick like getting data from a database that is returned (2) waiting for a task to be completed, or (3) doing something more complex?
If (1) is the case, you should see if the query can be run directly in your web API to return the data. Then use the result of the query as the response to the API.
If (2) is the case, this is not a good design paradigm. It's unknown how long it will take for the task to complete, so you should set this up to have an Appian Integration make a request back to the external system once you have finished the task.
If (3) is the case, you may be able to use activity chaining. This can ensure that certain steps are complete in the process before returning the response in your Web API: https://docs.appian.com/suite/help/19.2/Process_Model_Recipes.html#using-activity-chaining-to-display-multiple-forms-in-succession Be careful with this method though because it can run into issues if you have long chains or activities that take too long in an activity chain. (1) or (2) will be more effective
a!startprocess() has a variable 'fv!processInfo'. In the onSuccess parameter of the a!startProcess() expression you can setup a!save() to store the data from the process to a variable once process completed. You need to chain the process till the node though, after which you want to get the data from process to interface/expression.
Refer below documentation for more help on how to configure fv!processInfo to get the data back from process:
https://docs.appian.com/suite/help/19.2/Start_Process_Smart_Service.html
Hope this helps.
We have the Activity Chaining in the whole process, the objective in the response of the webapi is to obtain information at functional level.The problem is that the process doesnt return information without the process had completed and this information is partial.
Is the second point.
The information we collect from the process are variables of the process that have been changing of value within the process but we need to show them when the whole process is finished by the response of the web api.