Before you start

  • A workflow is a representation of a real-world business process. Keep your real-world business process and list of the participants of the business process ready. Also, keep the collateral (adaptive forms, PDF Documents, and more) ready before start creating a workflow.
  • A workflow can have multiple stages. These stages are displayed in the AEM Inbox and help report progress of the workflow. Divide your business process into logical stages.
  • You can configure the assign task step of AEM Workflows to send email notifications to the users or assignees. So, enable email notifications.
  • A workflow can also use Adobe sign for digital signatures. If you plan to use Adobe Sign in a workflow, the configure Adobe Sign for AEM Forms before using it in a workflow.

Create a workflow model

A workflow model consists of logic and flow of a business process. It is made up of a series of the steps. These steps are AEM components. You can extend workflow steps with parameters and scripts to provide more functionality and control, as required. AEM Forms provides a few steps in addition to AEM steps available out of the box. For a detailed list of AEM and AEM Forms steps, see AEM Workflow Step Reference and Forms-centric workflow on OSGi - Step Reference.

AEM provides an intuitive user interface to create a workflow model using the provided workflow steps. For step-by-step instructions to create a workflow model, see Creating Workflow Models. The following example provides step-by-step instructions to create a workflow model for an approval and review workflow:

NOTE
You must be a member of the workflow-editor group to create or edit a workflow model.

Create a model for an approval and review workflow

Approval and review workflow are for the tasks which require human intervention to make decisions. The following example creates a workflow model for a mortgage loan application to be filled by a front-office banking agent. Once the application is filled, it is sent for approval. Later on, the approved application is sent to the applicant for electronic signatures using Adobe Sign.

The example is available as a package attached below. Import and install the example using the package manager. You can also perform the following steps to manually create the workflow model for the application:

The example creates a workflow model a mortgage application to be filled by a front-office banking agent. Once filled the application is sent for approval. Later on, the approved application is sent to the customer for electronic signatures using Adobe Sign. You can import and install the example using the package manager.

Get File

  1. Open the Workflow Models console. The default URL is https://[server]:[port]/libs/cq/workflow/admin/console/content/models.html/etc/workflow/models

  2. Select Create, then Create Model. The Add Workflow Model dialog appears.

  3. Enter the Title and Name (optional). For example, a mortgage application. Select Done.

  4. Select the newly created workflow model and select Edit. Now, you can add workflow steps to build business logic. When you first create a workflow model, it contains:

    • The steps: Flow Start and Flow End. These steps represent the beginning and end of the workflow. These steps are required and cannot be edited or removed.
    • An example Participant step named Step 1. This step is configured to assign a work item to the admin user. Remove this step.
  5. Enable email notifications. You can configure Forms-centric workflow on OSGi to send email notifications to the users or assignees. Perform the following configurations to enable email notifications:

    1. Go to AEM configuration manager at https://[server]:[port]/system/console/configMgr.
    2. Open the Day CQ Mail Service configuration. Specify a value for the SMTP server host name, SMTP server port, and “From” address fields. Click Save.
    3. Open the Day CQ Link Externalizer configuration. In the Domains field, specify the actual hostname/IP address and port number for local, author, and publish instances. Click Save.
  6. Create workflow stages. A workflow can have multiple stages. These stages are displayed in the AEM Inbox and report progress of the workflow.

    To define a stage, select the info-circle icon to open workflow model properties, open the Stages tab, add stages for the workflow model, and select Save & Close. For the example mortgage application, create stages: loan request, loan request status, to be signed documents, and signed loan document.

  7. Drag-and-drop the Assign Task steps browser to the workflow model. Make it the first step of the model.

    The assign task component assigns the task, created by workflow, to a user or group. Along with assigning the task, you can use the component to specify an adaptive form or a non-interactive PDF for the task. The adaptive form is required to accept input from users and non-interactive PDF or a read-only adaptive form is used for review only workflows.

    You can also use the step to control the behavior of the task. For example, creating an automatic document of record, assign the task to a specific user or group, the path of the submitted data, the path of data to be pre-populated, and default actions. For detailed information about the options of the assign task step, see Forms-centric workflow on OSGi - Step Reference document.

    workflow-editor

    For the mortgage application example, configure the assign task step to use a Read-only adaptive form and display PDF Document once the task is complete. Also, select to user group allowed to approve the loan request. On the Actions tab, disable the Submit option. Create an actionTaken variable of String data type and specify the variable as the Route Variable. For example, actionTaken. Also, add the Approve and Reject routes. The routes are displayed as separate actions (buttons) in AEM Inbox. The workflow selects a branch based on the action (button) a user taps.

    You can import the example package, available for download in the starting of the section, for the complete set of values of all the fields of the assign task step configured for example, mortgage application.

  8. Drag-and-drop the OR Split component from step browser to the workflow model. The OR Split creates a split in the workflow, after which only one branch is active. This step enables you to introduce conditional processing paths into your workflow. You add workflow steps to each branch as required.

    You can define routing expression for a branch using a rule definition, ECMA script, or an external script.

    Use the expression editor to create routing expressions for Branch 1 and Branch 2. These routing expressions help choose a branch based on the user action in AEM Inbox.

    Routing expression for Branch 1

    When a user taps Approve in AEM Inbox, Branch 1 is activated.

    OR Split example

    Routing expression for Branch 2

    When a user taps Reject in AEM Inbox, Branch 2 is activated.

    OR Split example

    For information on creating routing expressions using variables, see Variables in AEM Forms workflows.

  9. Add other workflow steps to build the business logic.

    For the mortgage example, add a generate document of record, two assign task steps, and a sign document step to Branch 1 of the model, as displayed in the image below. One assign task step is to display and send to be signed loan documents to the applicant and another assign task component is to display signed documents. Also, add an assign task component to branch 2. It is activated, when a user taps Reject in AEM Inbox.

    For the complete set of values of all the fields of the assign task steps, document of record step, and sign document step configured for example, mortgage application, import the example package, available for download in the starting of this section.

    The workflow model is ready. You can launch the workflow through various methods. For details, see Launch a Forms-centric workflow on OSGi.

    workflow-editor-mortgage