> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/workflows/designing-workflows/processes/process-execution/listeners/alternatives-to-api-v1-listeners.md).

# Alternatives to API v1 listeners

This section provides examples of alternatives to Java Core API v1 listeners.

## ActionMailSender

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.tasklistener.ActionMailSender
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.ActionMailSender
</code></pre></td></tr></tbody></table>

## CheckMandatoryFieldCombinationTaskListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.tasklistener.CheckMandatoryFieldCombinationTaskListener
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.CheckMandatoryFieldCombinationTaskListener
</code></pre></td></tr></tbody></table>

## RunAsExecutionListener

{% hint style="info" %}
Using this listener is erroneous and causes inconsistencies in the activity stream.It is removed without providing a replacement.
{% endhint %}

## RunAsReleaseExecutionListener

{% hint style="info" %}
Using this listener is erroneous and causes inconsistencies in the activity stream.It is removed without providing a replacement.
{% endhint %}

## SendEscalationEventExecutionListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.executionlistener.SendEscalationEventExecutionListener
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.SendEscalationEventExecutionListener
</code></pre></td></tr></tbody></table>

## SetActivityStreamListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.listener.SetActivityStreamListener
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.SetActivityStreamListener
</code></pre></td></tr></tbody></table>

## SetFormSubtitleTaskListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.tasklistener.SetFormSubtitleTaskListener
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.SetFormSubtitleTaskListener
</code></pre></td></tr></tbody></table>

## SetMembersExecutionListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.core.workflow.activiti.executionlistener.SetMembersExecutionListener
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>com.collibra.dgc.workflow.api.listener.SetResponsibilitiesExecutionListener
</code></pre></td></tr></tbody></table>

## SetRoleResourceTaskListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>&#x3C;userTask id="userTask1" name="usertask1" activiti:candidateUsers="user(Admin), role(Normal), role(Business Steward), role(Community Manager)">
    &#x3C;extensionElements>
        &#x3C;activiti:taskListener event="create" class="com.collibra.dgc.core.workflow.activiti.tasklistener.SetRoleResourceTaskListener">
            &#x3C;activiti:field name="resourceId" expression="${resourceIdToOverride}" />
            &#x3C;activiti:field name="resourceType" expression="${resourceTypeToOverride}">&#x3C;/activiti:field>
        &#x3C;/activiti:taskListener>
    &#x3C;/extensionElements>
&#x3C;/userTask>
</code></pre></td></tr></tbody></table>

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>&#x3C;scriptTask id="scripttask1" name="scripttask1" scriptFormat="groovy" activiti:autoStoreVariables="false">
    &#x3C;script>&#x3C;![CDATA[
        execution.setVariableLocal("itemResourceIdCandidateOverride", ${resourceIdToOverride});
        execution.setVariableLocal("itemResourceTypeCandidateOverride", ${resourceTypeToOverride});
    ]]>&#x3C;/script>
&#x3C;/scriptTask>
</code></pre></td></tr></tbody></table>

## SetValueTaskListener

<table><thead><tr><th>API v1</th></tr></thead><tbody><tr><td><pre><code>&#x3C;userTask id="usertask1" name="usertask1" activiti:candidateUsers="role(Reviewer)">
&#x3C;extensionElements>
    ...
    &#x3C;activiti:taskListener event="create" class="com.collibra.dgc.core.workflow.activiti.tasklistener.SetValueTaskListener">
        &#x3C;activiti:field name="resultVariable">
            &#x3C;activiti:string>
		        &#x3C;![CDATA[proposedUsers]]>
		    &#x3C;/activiti:string>
        &#x3C;/activiti:field>
        &#x3C;activiti:field name="userExpression">
            &#x3C;activiti:expression>
	            &#x3C;![CDATA[${reviewerUserExpression}]]>
	        &#x3C;/activiti:expression>
        &#x3C;/activiti:field>
    &#x3C;/activiti:taskListener>
    ...
&#x3C;/extensionElements>
&#x3C;/userTask>
</code></pre></td></tr></tbody></table>

Add the following script as a step before **usertask1**.

<table><thead><tr><th>API v2</th></tr></thead><tbody><tr><td><pre><code>&#x3C;scriptTask id="scripttask1" name="Set reviewer as proposed users" scriptFormat="groovy" activiti:autoStoreVariables="false">
    &#x3C;script>&#x3C;![CDATA[
        String userNames = users.getUserNamesCsv("${reviewerUserExpression}");
        execution.setVariableLocal("proposedUsers", userNames);
    ]]>&#x3C;/script>
&#x3C;/scriptTask>
</code></pre></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.collibra.com/workflows/designing-workflows/processes/process-execution/listeners/alternatives-to-api-v1-listeners.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
