Canceling a Workitem in a Workflow
  • 27 Feb 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Canceling a Workitem in a Workflow

  • Dark
    Light
  • PDF

Article Summary

Q: My business usecase is a workflow app where employees fill out timesheets and submit them for approval. One of the requirement for the app is that when an employee starts filling out a new timesheet but decides to cancel it, the created workitem must be removed from the workflow. How do I design for this functionality?

A: To cancel a workitem that is opened by mistake or to remove an unfinished workitem from the workflow, you need to link the action to a BOS. Within the BOS, add the 'Archive' block, which effectively cancels or removes the created workitem.

Note
The following steps explain only the 'Cancel/Remove Workitem' functionality. The other parts of the Timesheet app are not covered.

Steps:

To cancel a work item, follow these steps:

  1. Add a 'CancelTimesheet' BOS to the Timesheet page.1-CancelBOS
  2. Within the BOS, incorporate an onCloud component.
    1. In the Input Variables section, select the 'id' variable from the Workitem Variables dropdown list.
    2. Drag and drop the 'Archive' block from the workflow component.
    3. Assign the 'id' variable to the WorkflowId field.2-id
  3. On the Timesheet page, configure the 'Cancel' button interactions as follows: onClick - Navigate to - CancelTimesheet.3-interactions

By implementing these steps, the opened work item will be effectively canceled.







Was this article helpful?

ESC

Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses