Workflow Logics (Approval Workflow)

During installation of this accelerator as the Approval Workflow Package, you were asked if you want to install sample workflow logics. If you installed them, then you already have a workflow logic ready to be used.

To review the sample logics, in Pricefx UI, navigate to Configuration > Logics > Workflow Logics > General Workflow Logics.

Those logics are used by the system automatically, thanks to their Workflow Type and special name of the logic. Even for Quotes you do not need to register them in the Quote Type, unless you explicitly want to.

Example:

The Quote workflow logic has only one element QuoteApprovalWorkflow with the following code:

Create Your Own Logic

If you installed the Approval Workflow Package without the sample logics, or you installed only the Approval Workflow Library, then you need to create the workflow logic on your own.

Steps:

  1. Create a new General (default type) Workflow Logic.

  2. Add one element with the code which will call the Accelerator library to build the workflow steps, based on the configuration done in the price parameters.

    if (api.isSyntaxCheck()) return libs.ApprovalWorkflow.ApprovalWorkflow .getApprovalWorkflow("Quote", workflow, quote)
    • The function is defined as def getApprovalWorkflow(String workflowType, Object workflow, Object approvableObject) where the workflowType string must match what you use in the configuration price parameters; bindings variables workflow and quote are available in a workflow logic by default.

  3. In case of a workflow for Quotes, if you did not use the default name of the logic quote, you need to register the workflow logic in the Quote Type.
    Notes: If you change the name, check the workflow logic again because it will use the default setup after each deployment.

  4. If you want to (de)activate a workflow type, set it in the Status column.