For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add an attachment with a workflow

You can use workflows to add attachments to a community domain or asset in your Collibra Platform.

Example workflow

Take the user task script tasks from this example workflow and integrate the upload functionality into your own wrokflow. The user task asks for a file to be uploaded. The script task retrieves the required information from that file and uses the AddAttachmentRequest builder of the Java Core API to attach it to the current resource.

The user task form has a fileUpload field with the ID file that is marked as required.

The Groovy script task performs the following operations:

  • Sets a fileName and a fileStream variable that are required by the add attachment request builder:

  • Builds the add attachment request:

    The item variable refers to the current resource you are attaching the file to: a community, domain or asset. You use it to access the WorkflowBusinessItem bean of the Workflow Java API.

  • Attaches the uploaded file to the current resource:

Here is the complete script:

There is no need to explicitly import com.collibra.dgc.core.api.component.instance.AttachmentApi and com.collibra.dgc.core.api.component.file.FileApi. In the context of workflow script tasks, the <Resource>Api interfaces (such as AssetApi, CommunityTypeApi, FileApi, and so on) are already instantiated and accessible via <resource>Api variables (such as assetApi, communityTypeApi, fileApi, and so on).

Last updated

Was this helpful?