Running the task in background

I have a workflow and as part of it, there is a form with Submit button.
Once the user fills the information and clicks submit, I am expecting the form to close(Home screen) and tasks like perform maintenance to run in background.
Instead until the perform maintenance task gets completed, the form is frozen. I have added the variable and added foreground provisioning to subprocess also.

  <Variable editable="true" initializer="false" name="foregroundProvisioning">
    <Description>Normally provisioning is done in a step that uses the &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;background&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;
      option to force the workflow to be suspend and be resumed in a
      background task thread.  This prevents the browser session from
      hanging since provision can sometimes take a long time.  For demos
      and testing it can be better to do this in the foreground so that
      provisioning will have been performed when control is returned to the
      user.  This prevents having to run the Perform Maintenance task to 
      see the results of the request.</Description>
  </Variable>

Added to subprocess in the workflow:

<Arg name="foregroundProvisioning" value="ref:foregroundProvisioning"/>
1 Like

Hi @ShivangiS
I think u need to set foregroundProvisioning to "false" in your top-level workflow when you want the form to return to the user immediately and allow provisioning or other steps to continue in the background.

Hi @ShivangiS

Try setting this in your workflow,

<Variable editable="true" initializer="true" name="backgroundProvisioning"/>
<Variable editable="true" initializer="false" name="foregroundProvisioning">

You can either do it directly in the sub-process by declaring a variable or you can set it in your top-level workflow from which this subprocess is being called.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.