Soft delete workflow

In this tutorial you create a workflow that helps you change the status of an asset to Missing from source instead of permanently deleting it.

Prerequisites

  • Access to the Workflow Designer for designing the workflow.
  • Access to a Collibra environment as a user with the Sysadmin global role or a global role that has at least the Workflow Administration global permission for deploying the workflow.
  • Optionally, access to the Collibra Console for troubleshooting.

For details about the Workflow Designer, see the Workflow Designer documentation.

Create a new app for your workflow

Access the Workflow Designer and create a new app:

  1. In the navigation bar, select Apps.
  2. In the top left corner of the Apps tab, click ✚ Create app.
  3. Enter the required information:
    • App name: Soft delete asset workflow
    • App key: The app key is automatically generated based on the App name value.
    • Description: Although optional, the descriptions allow you to see an overview of the workflow purpose, for example This workflow allows you to soft delete assets by changing the status of the selected asset to "Missing from resource" instead of completely removing the asset from Collibra.
  4. Click Create new app.

Your newly created app appears in the App models list on the Apps tab and you are redirected to the app editor page.

Create a new process for your app

  1. In the app editor page, click ✚ Add model.
  2. In the What would you like to do? dialog box, select Create a new model for the appProcess.
  3. Enter the required information:
    • Model name: Delete asset
    • Model key: The model key is automatically generated based on the Model name value.
    • Description: Although optional, the descriptions allow you to provide an overview of the workflow purpose.
  4. Click Create new model.

Your newly created process appears in the app editor and you are redirected to the process editor page.

Edit the process of your workflow

  1. In the app editor, select your process.

    The process editor opens.

    Your process already contains a start event.

  2. From the Shape repository, drag a Script task to the canvas and place it to the right of the start event.

  3. From the Shape repository, drag an End event to the canvas and place it to the right of the script task.

  4. Click the start event and then drag and drop a Sequence flow over the script task.
  5. Click the script tasks and then drag and drop a Sequence flow over the end event.

Add a form property to your start event

You use a form property in the start event to define the process variable that contains the ID of the new status of the asset. You can access it later in the process by referencing the ID you have set. Once you deploy the workflow in Collibra, you can also update the value from the Variables section in the workflow definition settings page.

  1. On the canvas, select the start event.
  2. In the attribute bar, click Form Properties.

    The Form properties dialog box appears.

  3. Click + Add item
  4. Enter the required information:

    • Id: statusId
    • Name: The status ID of the deleted asset.
    • Responsibilities: String
    • Default00000000-0000-0000-0000-000000005066
    • Required: Yes
    • Readable: No
    • Writable: Yes
  5. Click OK to save the form property.

Create a script for your script task

The script changes the status of the selected asset to the one defined by the statusId variable.

  1. On the canvas, select the script task.
  2. In the attribute bar, click Script.
  3. Add the following script:
    import com.collibra.dgc.core.api.dto.instance.asset.ChangeAssetRequest
    
    assetApi.changeAsset(ChangeAssetRequest.builder()
    	.id(item.id)
    	.statusId(string2Uuid(statusId))
    	.build()
    );
  4. Click OK to save the script.

Save your work.

For more information about scripts, see the Introduction to Builders tutorial.

Deploy your workflow

You deploy a workflow by exporting the app from the Workflow Designer as a ZIP file and uploading it to your Collibra environment.

  1. Export the app:
    1. In Workflow Designer, go to the Apps tab.
    2. Select your app.

      The app editor opens.

    3. Click Export.

      The Export app dialog box appears.

    4. Select Deployable app zip for direct upload to Collibra Platform.
    5. Click Export and save the file on your machine.
  2. Upload the ZIP file to Collibra:
    1. On the main toolbar, click Products icon, and then click Cogwheel icon Settings.
      The Collibra settings page opens.
    2. Click Workflows.
      The Workflows settings page appears on the Definitions tab page.
    3. Click Upload a file and select the workflow definition you want to deploy or drag and drop your workflow in the upload section.

      A progress bar displays the upload progress. In case the update fails, you see an error message.

    Uploading a workflow with the same process ID as an existing workflow in Collibra replaces the existing workflow.

    Collibra does not accept two workflows with the same display name.

Configure the workflow settings

To fine tune the workflow you must change the default configuration in Collibra:

  1. On the main toolbar, click Products icon, and then click Cogwheel icon Settings.
    The Collibra settings page opens.
  2. Click Workflows.
    The Workflows settings page appears on the Definitions tab page.
  3. Select the Delete asset workflow.
  4. On the workflow definition page, in the Applies To section, click Edit.
  5. From the drop-down list, select Asset.
  6. Click Save.

    The Applies To dialog box appears.

  7. Click Save.
  8. At the right of the title bar, click to enable the workflow.

Additional resources