Managing approval processes

For restricted data products that require approval, multiple approval steps and approvers might be needed. For example, both the first-line and second-line managers must approve a subscription to a data product. Custom approval processes provide workflow logic to automate the steps to approve subscriptions. Each approver in the approval process receives a task and a notification at the appropriate time to ensure all approvals are met before the data product is delivered. The approval process is based upon a workflow configuration, which is in turn based upon an imported workflow template file.

Required roles to complete this task
Data Product Hub collaborator role: Admin

Steps for creating custom approval processes

The procedure for creating a custom approval process requires several steps. First, a workflow developer creates a process definition using a third party application called Flowable. Then the administrator attaches the template to a workflow configuration in the Workflows service. The Data Product Hub administrator creates an approval process that is based on the workflow configuration. The data product producer can then select an approval process to control access to a restricted data product.

The following image outlines the steps for creating a custom approval process:

Steps for creating a custom approval process for data products

Step 1: Workflow developer creates template

The custom approval process requires a process definition template that describes the workflow process. The template can be an XML or a BPMN file. You must use Flowable to create process definitions and export them as XML or BPMN. Then you import the XML file into Data Product Hub. The template defines the steps required to approve or reject a request. For instructions on how to create a template, see Designing and creating custom workflows.

See Sample code for the workflow template for the start form properties that are required for a workflow template and for instructions for using the template to trigger approval or rejection of the request.

Tip: API calls that are created in the workflow template cannot be asynchronous. In Flowable, do not check the Asynchronous checkbox. In the XML file, ensure that the flowable:parallelInSameTransaction parameter is False for any Service Task.

Sample templates

You can access samples of workflow configuration templates for approval processes in the following GitHub repository: IBM/data-product-hub-workflow-samples.

The sample templates can be used as is or modified to fit your business needs. Following is a description of the samples:

  • One step approval process: A single task is assigned to multiple approvers and any of them can approve or reject the request. The approvers are pre-selected in the workflow configuration step so that the producer does not select approvers when creating a data product.

  • Two step approval process: There are two rounds of approvals required before the data product is delivered to the subscriber. In the workflow configuration, approvers are selected for both steps, usually two different approvers. Task are created representing the first step, and after that is approved, a new task will be assigned to the approvers for the second step. The data product is delivered after the second step is approved.

  • External approval process: Provides a scenario to create a request in an external system. Once a subscription is created, an API call is made to register the request with the external system. Then a task is assigned to a user that represents the external system. The actions for the task are approval or rejection, which are passed by using the API. See Approving requests with the API through an external system.

Step 2: Data Product Hub administrator creates a workflow configuration and assigns it to an approval process

After you create a process definition in Flowable, you import the XML file into Data Product Hub. Then you create a workflow configuration that contains the template.

Required roles to complete this task
IBM Software Hub predefined role: Administrator or an IBM Software Hub custom role with the Manage workflows permission

For more information about roles in IBM Software Hub, see Predefined roles and permissions in IBM Software Hub.

To import the XML template file into Workflows:

  1. Select Workflows from the main navigation menu.
  2. Select Access request for data products as the Workflow type.
  3. Select Workflow template files>Import files to upload the XML template. The supported file types are: ZIP, BPMN, and BPMN 20 XML.

After the file is uploaded, the next step is to create a Workflow configuration.

To create a Workflow configuration:

  1. Select Workflow configurations>New configuration.
  2. Enter a name and optional description. Then select the workflow template.
  3. Create the configuration.

After the workflow configuration is created, you are automatically routed to the next step, which is to configure the tasks that are defined by the template. Producers can then assign the approval task to a data product that requires approval.

Define the parameters for the approval task:

  • Task duration: Determines how long the task stays active in the approver's Task inbox.
  • Assignees: Add the users and user groups who are assigned to each step in the approval process.
  • Notifications: Choose the type of notifications to send to the Assignees and the Requester. You can also specify users and user groups to as recipients of notifications.

Click Activate to make the approval process available to data producers for controlling approving access to restricted data products.

Step 3: Data Product Hub producer creates a data product that requires approval and selects an approval process

The data product producer selects an approval process when creating a restricted data product. The approval process automates the tasks and the notifications for the approval of the subscription. Approvers receive the appropriate tasks in their Task inboxes to approve the subscription based on the workflow logic.

Approving requests with the API through an external system

Use the approval process with external call template to approve a request through an external system. For example, a request for a restricted data product creates a request in an external system. The approver takes action on the request in the external system. The external system reports the state of the request back to the workflow service.

You can access the sample template for external requests in the following GitHub repository: IBM/data-product-hub-workflow-samples.

The external system approval example requires the following elements:

  • A user in the system to represent actions.
  • A workflow template created in Flowable that makes an API call to the external system and creates a task in the Task inbox. The task can require approve or reject actions or other actions.
  • A task ID that is sent by the API call to the external service.

The external system makes an API call back to the workflow service to report the result by following these steps:

  1. For all API calls, get a bearer token that represents the external system. The bearer token will authenticate the user.
  2. To approve a request, call POST /v3/workflow_user_tasks/{task_id}/actions using the task_id with the following body:
{
  "action": "complete",
  "form_properties": [
    {
      "id": "action",
      "value": "approve"
    },
    {
      "id": "comment",
      "value": "explanation"
    }
  ]
}
Where values takes the following information:
The values for action are defined in the template. This sample uses approve and -reject actions as for this task.
The value for the comment is a user-defined explanation.