I am executing a process model from an interface on button click using a!startProcess, and saving some of the process variables (lists) on the OnSuccess parameter of a!startProcess into UI variables. The process model has chaining enabled on all connections, both in the parent process and two sub-processes. Both sub processes run synchronously, and execute at the same time. In both sub processes, I loop over an integration using a counter variable (not MNI).
The issue that I am seeing is that the saves on the OnSuccess parameter of a!startProcess execute before the process is complete, so I either get no results from the process at all, or partial lists. When I monitor the process, it executes successfully and all the expected values are there.
How can I ensure that the entire process executes before the OnSuccess saves execute? The process typically takes between 1-3 minutes to finish.
Note: The goal of this process is to loop over an integration that can only download 1 document at a time. If there is a better way to perform this looping, I am open to suggestions.
Discussion posts and replies are publicly visible
Hi walkers0001,
Seems like your process might break the activity chain and hence the save executes sooner. To know why a chain breaks, please refer to this link- https://docs.appian.com/suite/help/21.3/Process_Model_Recipes.html#breaking-a-chain
I assume that your goal is to get the documents on a button click and show it to the users - If that's the case & if your process takes 1 - 3 minutes to complete. then I would recommend having a follow-up query on the process details rather than saving it on success. We can get the process ID from the onsuccess part & then use it to query data after some delay in the interface.
Chaining has some restrictions. AFAIK it is not more than 50 nodes and also a limit in time. I am pretty sure it is less than 1-3 minutes.
You will need to change your approach. You might try to refresh the UI in an interval checking for process status. Once completed, read the data from process and display it to the user.
Can you try to remove the curly brackets around the tojson() call in the body.
removed them nothing changed same error , is there anything special we need to do when we are using record type.
i think it is the records causing error.
hi Harshit Bumb (Appyzie) and Mike Schmitt , any guidance on this ? stuck on this for while.
thanks in advance.
Well, we do not know what that expression AA_createResponse() is doing. So the issue could be anything.
I suggest to try this with a stripped down and simple value for the body.
i have tried using that in the response with just simple message, also i have used a!writeRecords function to see whether my process model is acting strange but seems its not either it is recordtype not compatible for httpresponse or the content-type issue which is not getting set to application/json.
Above Both ways data was written to records FYI.
I'm not clear what this has to do with the (now very old) original post, which was just about a!startProcess(), nothing to do with http response / web apis / etc.
As Stefan mentioned, we can't guess what rule!AA_createResponse() does or why. Also why is the return code "500" in your screenshot output, yet we're seeing the 200 section? What happens inside your collapsed "onError" code block?
Even for Simple body return for success it is failing. seems recordtype handling is not what WebAPI object is expecting correct me if i am wrong. Also is there any way we can Post a webapi request in Community edition site as we don't have access on data store entity and we can use only record type. Also we don't have system logs on community edition so hard to find the actual error.
This works great.
A difference I see are the curly brackets around the a!httpResponse call.
Keep in mind that curly brackets are no syntactical sugar in Appian, but define a list.
tried the same code as yours but still same error, also created new record type from scratch to see whether i have missed anything but still no luck
Please remove the curly brackets in the onSuccess parameter. When I add these in my code, I get the same error like you. I have already pointed that out above.
The documentation says: "A list of saves or an HTTP response". This indicates a single httpResponse, but not a list.
it worked Stefan Helzle , thank you very much for your support