Approval Workflow PostStep Logic

You will use an Approval Workflow PostStep logic when you need to:

  • Do a special processing after approval or denial of an approval step, e.g.:

    • Add dynamically an additional approval step during processing of an approval workflow, based on who approved a certain step.

    • Stop the approval process under some specific conditions.

    • Log aside all approval operations to build a report of approval process duration.

    • Send an email notification after specific approval step execution (e.g., when a specific step was denied).

Logic API

  • Logic Nature: wfStepLogic

    • Logic Type: Workflow

  • Execution Types:

    1. Standard - When workflow is defined,

      • e.g. to make the needed processing and provide alerts to users.

    2. Standard - When no workflow is defined () - it is possible to set it via the advanced property postStepLogicsWhenNoWorkflowDefined.

  • Information provided to the logic:

    • Binding variables: (! These variables are only available when the approvable has a workflow defined)

      • currentWorkflow: InsertWorkflowStepsDTO

      • workflowHistory: WorflowInfo as Map - previously processed workflow, before it was denied. This is available only when an approver denies and then a user submits again.

      • claim | compensation | compensationrecord | contract | customform | dcr | dealplan | model | modelrecord | pricegriditem | pricelist | quote | rebateagreement | rebaterecord : Map - the content of the document to be approved.

      • approvable: Map - the content of the document to be approved. This is an alternative way to the previous variable.

    • api.currentItem() - The object being approved, i.e., the same as the binding variable approvable.

  • Expected logic execution outcome:

    • The element result values are not used:

    • The logic has the right to modify tables - e.g., you can use api.addOrUpdate() to write various audit logs or statuses to tables (e.g., Company Parameters).

    • You can add the approval workflow steps via calls of methods of the currentWorkflow binding variable.

    • If the logic ends OK (without any exception), its name in the Workflow window is displayed in GREEN color.

    • If the logic fails with any Exception (either unhandled or raised by logic), its name in the Workflow window will be RED but the process will continue - i.e., the next Approval Step will be executed.

    • If you need to stop processing of the workflow, it’s not directly supported but as a workaround - from such Post Step logic you can add new Step, which should be approved e.g., by Admin.

Logic Setup

How to tell the system, which post step logic should be used and when:

  • Advanced property postStepLogicsWhenNoWorkflowDefined - to define the PostStep logic even if there’s no Approval Workflow logic, which builds the steps.

  • In a workflow logic:

    • Define the default post-step logic for all workflow steps.

    • Define the post-step logic for specific steps.

Code Sample

Found an issue in documentation? Write to us.

Â