You are viewing limited content. For full access, please sign in.

Question

Question

Setting form field data after invoking workflow task

asked on May 22, 2020

I know I'm not the only one with this issue, but haven't found a solution in the research I've come across.

I have a forms process invoking a workflow that calculates a value.  I want to pull that value back into the form field data before submitting it into the repository.  I can't seem to do this without creating a user task to pull in the workflow generated, which is unnecessary in my business process. 

 

One solution is to proceed to submit the document to repository, then use the workflow to update the document, but then the actual form document will not have the generated data visible.  It would only be visible via metadata fields.  

 

Is there a better way to do this?  

0 0

Replies

replied on May 22, 2020

Hi Charlie, when your form calls the workflow, in the forms Workflow Service set the value to wait for workflow to complete. In the Workflow itself, after you have calculated the value, use the Set Process Variable activity to update the field back in the form. In your Save to Repository back in forms, set the Save Form to use up to date data. See if that helps you out.

Not sure what you are calculating in workflow, but you can also perform calculations in forms if you haven’t looked at that.

1 0
replied on May 22, 2020

That's exactly the last thing I tried. I believe I have done all that. See attached.  The ReqNo didn't populate. I do have the wait checkbox checked in the Forms Invoke Workflow task.  In the workflow, I used that Set process Variable Activity.  Also, I have used the option to Save Form using up to date data.

 

LF forms doesn't seem to have a good way to create an auto incrementing number, so I'm using workflow and SQL to generate my own ticket numbering system.I

0 0
replied on May 22, 2020

Hi Charlie, sorry, as I think about this some more, I recall as well running into this issue before in a different scenario. As a test, can you try this,

- Have the workflow go to a User Task after the workflow completes
- Put a Timer Event on the Workflow that is set to 1 minute which flows out to the Save to Repository.
- Set the Timer Event to Interrupt the Task so you don't have to do anything with it.

If this worked you could maybe assign the Task to an Admin Account that is not used in your regular task management. Also, LF did post a Stored Procedure to Add a unique number to a form from a DB in Forms Admin Guide if you want to check that out. Sorry couldn't be of more help.

I too wish LF would provide an update for this

0 0
replied on May 26, 2020

That was my next idea, but felt like it was silly to have to do it that way, thinking there should have been a more straight forward way of doing it.  I give it a try.  Thanks.

0 0
replied on May 26, 2020

Now that I'm revisiting this, I remembered why I didn't proceed to try this before.  If the timed event interrupts the User Task, the UT never gets completed and thus the field data never captures the RequisitionNo.  

I also looked at using the Invoke Workflow Task, but I can't seem to pass environment variables to Workflow from Forms.  I can only seem to pass field variables to it.

0 0
replied on May 27, 2020 Show version history

In your Workflow, have you set in your Workflow Properties the checkbox  "Started from Laserfiche Forms". If you do this, you'll get an additional dialog in your Token Picker called Input Parameters which will give you more variables from the Forms process

0 0
replied on May 27, 2020

That box was already checked but I didn't think about trying to capture it in a token first.  I was expecting to see them in the Retrieve Business Process Variables.  THANK YOU!

0 0
replied on May 26, 2020

You should be able to do this using the initial message start event -> WF service task -> Save to repository task. Have the process wait for the WF service task to complete and send the result back to the process. The key is the configuration on the save to repository step. Instead of saving the form submitted at the message start event, you should choose the form that was submitted at the start event and save using current data. This will save that same form that was initially submitted but use all the current variable values. Since WF has already returned and set that variable, it should be used when saving to the repository. 

0 0
replied on May 26, 2020 Show version history

I found my issue.  It was an issue with my workflow where I wasn't setting the token correctly that I was generating to be able to use it in the Set Business Process Variable.  The RequisitionNo field pulls back to the form just fine now.

 

I had a similar "chicken vs egg" issue before with trying to use the Instance ID as the unique tracking number for each forms request process.  I had given up on it using a workaround but this time I was adamant about figuring it out. 

 

Since we're on the topic of tracking ID's, what do you guys use when trying to implement a built in generic tracking ID rather than customizing one like I am with Requisition Numbers? 

 

I looked at using Submission ID vs Instance ID as some people did, but it's not available on the form until it's submitted, so the file the user gets upon form submission is missing the "tracking ID".  It's really bad design for customer user experience in my opinion.  I could maybe delay the Save to Repository task, implement a timed "headless" user task like Steve mentioned to recapture the Submission/Instance ID, prohibit the user from saving the file upon form submission, and instead email them the file on the "headless" task as a confirmation email.  But it seems like a simple thing that should not require such work arounds.  Any thoughts on this?

 

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.