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

Question

Question

Merging gateway not capturing data from workflow

asked on December 3, 2020

Hi,

I'm not sure if this is even possible but can you merge data from a workflow's set business processes using a gateway?

I have a workflow that I want to run before I show the form but I don't want my users to have to go to their inbox to select it after they have started it, so I created a blank form that will submit itself after a few seconds and added a merge gateway to merge the data without creating two document control forms but when I get to the document control form the data is not there.

is it even possible to merge data from a workflow? and if so how?

I have tried multiple combinations of gateways to try and get it to work but I never get any data from the workflow on the form. any help would be appreciated.

Thanks,

Aaron M.

0 0

Answer

SELECTED ANSWER
replied on December 3, 2020 Show version history

Gateways don't merge "data" they merge process flows. In the screenshot you provided the two processes are running in parallel so the User Task would still be created without the updates made in the workflow service task step.

You can put a workflow service task directly before the user task without interrupting the flow so that the user task isn't started until the workflow is done making the necessary updates.

You just need to make sure:

  1. the workflow doesn't take too long to avoid timeouts (not sure of the exact time but it's long enough for most things)
  2. Set Forms to wait for the workflow to complete before proceeding
  3. check "automatically load the next task..." in the Start Event

 

I do this on a few of my processes where I need workflow actions to be performed and it still automatically redirects the user to the next task once the workflow completes.

When it is set up this way, the initial submission would trigger the workflow, the page would show as loading/processing while the workflow is running, then when it is finished it would open the user task.

0 0
replied on December 4, 2020

Thanks, I was massively overthinking how to do that lol

this section about gateways in the online help deceived me pretty well.

I also had to leave a user task before the workflow to open the page on submit. not sure if that has anything to do with the fact that I am starting the form from the process window? I'll have to test.

0 0
replied on December 4, 2020

Which version of Forms are you running, and are you sure you had it set to workflow to finish first and all of that? I just tested it out from the Start Process page to double check and it worked as expected for me, so it may just be a setting.

As for the online description, I can see how that could be misinterpreted. The key is to look at how it says it allows the data to "proceed"

What you may have ran into on your first attempt is that the workflow updated the data, but the first user task was created before that, so when you submit the first user task it would overwrite the workflow-inserted data if the same variables are present on the form. 

0 0
replied on December 4, 2020

I haven't published the form yet so I cant start it from the Start Process page but when it is started via the process diagram with wait for workflow on it doesn't open the form.

0 0
replied on December 4, 2020

Interesting. Just to confirm, you have them all in sequence, and "Automatically load the next task" is checked in the Start Event settings?

If so, then it may be a behavior difference with the newer versions. I'm currently running 10.4.1 so it's hard to say for sure.

0 0
replied on December 4, 2020

I'm thinking it might be working for you because of the message start event, I am using the generic start event. I think I'd end up with the same functionality either way though.

0 0
replied on December 4, 2020

Just so I better understand the process, if you're using a Start Event instead of a Message Start Event, what is the intended way for users to kick of this process?

0 0
replied on December 4, 2020

The process would be started by a link/bookmark in a browser.

0 0
replied on December 4, 2020

Sounds like you'd need a Message Start Event in that case. Unless I'm mistaken, if you use a standard Start Event, there's no starting form submission so you can only start the process from the Start Process page in Forms or via Workflow.

Because there's no starting form, there's no option for "Automatically load the next task" which seems to track with the issue you're having.

0 0
replied on December 9, 2020

While I do want the form to open immediately I still require the workflow to run first and using a message start won't let me run the workflow first.

0 0
replied on December 9, 2020

In that case it's kind of one or the other. One "workaround" would be to create a separate starting form, use the Message Start Event, but add some JavaScript to the starting form so it submits automatically when the document ready event fires.

If you do that, when they open the form it would auto-submit, they'd get a loading view while the workflow runs, then it would load the task after the workflow completes. That's probably the only way you could get both things to happen.

0 0
replied on December 9, 2020

I thought that would work as well but when I have that JavaScript in the message start event form it does not submit. It works fine in a user task just not in the message start event. Maybe I am submitting it wrong as I am just calling the onclick event of the submit button? see code below.

0 0
replied on December 9, 2020

That's likely the problem, the submission/action buttons for a user task are not exactly the same as the ones added for a starting form.

Just use $('.Submit').click();

I don't think the timeout is necessary either.

Even if you have lookups or something, you can just set the submit click to trigger when the onloadlookupcomplete event fires instead of document ready.

0 0
replied on December 9, 2020

Its just an empty form so it should be fine to just submit that way. I can't get it to work without a slight timeout on the forms, not sure why but the functionality is there.

0 0

Replies

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

Sign in to reply to this post.