Saving a Workitem in 'Draft' State until Submission
  • 27 Feb 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Saving a Workitem in 'Draft' State until Submission

  • Dark
    Light
  • PDF

Article summary

Q: My business requirement is a workflow app that consists of a timesheet that employees fill and submit for approval to their Manager. The Manager approves the timesheet through an Approval App. I need the timesheet to stay in 'Draft' mode (Save the changes) until the employee finally submits it for approval. How do I design for this 'Save' functionality in the App Process Modeler(APM) ?

A: There are two primary changes that should be done to 'Save' data until submission.

  1. Ensure that all the business function variables used in the workflow are set to 'Persist' state. This ensures that the data is saved even if the user navigates away from the page.Persist
  2. Implement a condition component to verify if the Timesheet Page is in 'Draft' mode. If 'Yes', loop the workflow back to the user task (Timesheet Page). This action saves the timesheet data within the workflow.

The following example helps to explain this step more clearly:

Note
The following steps explains only the 'Save Workitem' functionality. The other parts of the Timesheet app are not covered.
  1.  In the APM, add a Group component.1-group-new
  2. Within the Group, add a Page component.1-a-group
  3.  Add required App designer components to design the timesheet.
  4.  Add two buttons - Save and Submit.
    1. Save - would save the timesheet data until submission.
    2. Submit - would submit the timesheet for approval. Hence facilitates the workitem to move to the next lane.2-page
  5.  Add the following behavior for the 'Save' button. This sets the status variable to 'Draft'.3-behav
  6. Add a condition component is_Draft to the APM .
  7. Click the ellipsis menu of the condition component and select Execute in workflow.
    Note
    The 'Execute in workflow' step is important for ensuring that the data persists within the workflow. Therefore, it is essential to execute the condition block as a workflow component.
  8. Now connect the group component to it.condition-executeworkflow
  9. Set the condition as below:
    1. Map the is_Draft business function variable to the condition
    2. Set condition = 'Draft'5-condition
    3. If condition is satisfied, connect the 'Yes' arrow back to the Group component. This step Saves the data in the workitem.4a-condition-new
    4. If condition is not satisfied, connect the 'No' arrow to workflow component(Assign To) to move the workitem to the next lane.6-no-new



Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence