I have a series of workflows that are all invoked from each other. The first workflow is invoked from Laserfiche Forms. I would like the last workflow that is invoked to send variable values back to the Forms instance that originally kicked it off, but I don't see a way to tell the "Set Business Process Variables" activity which instance to use like what you can do with the "Retrieve Business Process Variables" activity. What would be the most efficient way to do that?
Question
Question
How does the Set Business Process Variables activity know which Forms instance to update?
Replies
From what I can tell, Set Business Process Variables can only be used in the workflow that was directly invoked by Forms.
When Forms invokes a workflow, it passes in the FormsBPInstanceID and FormsSubmissionID input parameters, and when the "Started by Laserfiche Forms" option is selected, I believe it uses those inputs to connect the dots (i.e., get all the extra input tokens, set business process variables, etc.).
I tried the "Started by Laserfiche Forms" setting on an invoked child workflow since those still show "FormsRouting" as the initiator, but it did not pass along the input parameters or any Forms data; adding the inputs manually didn't change anything either.
I imagine the complication is that Set works quite differently from Retrieve since it only runs at the end of a workflow, regardless of where it is in the diagram, and it needs an active/waiting instance whereas Retrieve can be used long after a BP instance has completed (i.e., Forms is waiting for a callback from the invoked workflow so it can receive any necessary data before moving to the next step and a child workflow is kind of outside that scope since it can reach the "completed" stage independently).
Based on that, it seems like the only way to do this at the moment would be to pass the data back up to the parent workflow so it can be done there.
The set business process variables needs to know which instance to set the values on, which is normally the instance which calls the workflow.
In your case you lose this by invoking. Maybe try adding another Retrieve BP Vars to the invoked workflow where you can set the instance ID manually (by clicking the gear on the upper right) and pass this information over from the original workflow called by Forms.
You don't have to retreive any values but just having it there might allow the set process to know which instance to work with.
Chad, that is something I didn't think about with the Retrieve activity. I know that when a workflow is kicked off from a Forms process there are workflow Parameters that are set that include the Instance and Submission IDs. I have been wondering if that is what the Set BP Variables activity uses to know what to write back to.
I have never tried this before but it might work. If not you can always pass the parameters you need to set back through the invoke call to the original workflow for sending back to the BP.