Workflow - restartWorkflow(GlideRecord current, Boolean maintainStateFlag)

Recalculates the approvals and tasks for a workflow by adding new approvals and tasks while not resetting current approvals and tasks.

Use this script to add an additional company to a change request, without reseting current approvals for companies already in the workflow.

Table 1. Parameters
Name Type Description
current GlideRecord GlideRecord of the record this workflow is executing. This can by any record on any table.
maintainStateFlag Boolean If True, maintains all approvals and tasks in their current state.
Table 2. Returns
Type Description

//mark all existing approvals for the change as 'cancelled' and restart the workflow to create new approvals
      //where current is a task record with a workflow context
      new WorkflowApprovalUtils().cancelAll(current, comment);
      new Workflow().restartWorkflow(current);