We have a Workflow that invokes a Business Process and sets the process variables. However, we need to retrieve the BPFormsInstanceID in the same workflow. What should the Process Instance be set to in order to retrieve this variable?
Discussion
Discussion
Invoking a Business process and retrieving variables in one workflow
Invoke Business Process is asynchronous so it's not possible for WF to get back an instance ID. You could set WF to wait for a document to be created somewhere and have the business process save a form to the repo to create the document and complete the loop. You could have WF pass in some info that Forms then saves on the document to further ensure you are closing the right loop.
Hi Jen
The BPFormsInstanceID is only generated in Forms after the Invoke Business Process is started by the Workflow.
When Forms starts a Workflow, you can easily capture this information by setting your Workflow Properties to Started by Laserfiche Forms which gives you a new menu about the process that started it
There may be other ways to connect your process together. Can you provide the use case as to why this needs to be in the same workflow?
Hi Steve,
Thanks for the information. Our issue is that one forms instance is started by Workflow and then routed to an internal user. Another form is started by a member of the public. We need to update a value on the first form with a value collected on the second form. Since we haven't been able to capture the FormsBPInstance ID from the first form using the Retrieve Forms Process Variables in the step after the Invoke Business Process task, we can't create a workflow to update the necessary value.
Hi Jen
The way I have approached this in the past, is in the Initial Form Process, is to have a timer event that will run a workflow to check the Repository for the Public Form Submission and then grab the data from there to update the Form in process. When you save the Public Form, you can either save the data required to a Metadata field or to save the InstanceID into a MD Field which you can use as a variable to query the form data from the DB
An example of a Process may look like this to trigger the workflow
I have a variable call DocFOUND in my Form that gets updated with either YES or NO, which is used in the condition after the workflow. If yes, it updates the form, If no it stops and does nothing. The Timer does not Interrupt the process, it is set to repeat, which is why if NO do nothing and the workflow will trigger again on the next cycle. When it is found I kill the task with a Signal Event and then raise the Task again but this time it has the new task populated from the workflow
To Get to the Retrive Field Value I had to use the Token Dialog as it doesn't show up in the Activity Dropdown natively.
Also, note that the Form Data is only as available as long as you Forms data retention policies.
I didn't show the rest of the workflow beyond this, I figure you know where I was going
Hope this helps
Hi Steve,
Thanks this is very helpful. I had also gone down that same path as you suggested. However, after working on this a bit more, I think we may be taking a different approach to this one. Either way, it's been a good learning experience. Thanks for your input!