Alternatives to API v1 listeners

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

ActionMailSender

API v1
com.collibra.dgc.core.workflow.activiti.tasklistener.ActionMailSender
API v2
com.collibra.dgc.workflow.api.listener.ActionMailSender

CheckMandatoryFieldCombinationTaskListener

API v1
com.collibra.dgc.core.workflow.activiti.tasklistener.CheckMandatoryFieldCombinationTaskListener
API v2
com.collibra.dgc.workflow.api.listener.CheckMandatoryFieldCombinationTaskListener

RunAsExecutionListener

Using this listener is erroneous and causes inconsistencies in the activity stream.
It is removed without providing a replacement.

RunAsReleaseExecutionListener

Using this listener is erroneous and causes inconsistencies in the activity stream.
It is removed without providing a replacement.

SendEscalationEventExecutionListener

API v1
com.collibra.dgc.core.workflow.activiti.executionlistener.SendEscalationEventExecutionListener
API v2
com.collibra.dgc.workflow.api.listener.SendEscalationEventExecutionListener

SetActivityStreamListener

API v1
com.collibra.dgc.core.workflow.activiti.listener.SetActivityStreamListener
API v2
com.collibra.dgc.workflow.api.listener.SetActivityStreamListener

SetFormSubtitleTaskListener

API v1
com.collibra.dgc.core.workflow.activiti.tasklistener.SetFormSubtitleTaskListener
API v2
com.collibra.dgc.workflow.api.listener.SetFormSubtitleTaskListener

SetMembersExecutionListener

API v1
com.collibra.dgc.core.workflow.activiti.executionlistener.SetMembersExecutionListener
API v2
com.collibra.dgc.workflow.api.listener.SetResponsibilitiesExecutionListener

SetRoleResourceTaskListener

API v1
<userTask id="userTask1" name="usertask1" activiti:candidateUsers="user(Admin), role(Normal), role(Business Steward), role(Community Manager)">
    <extensionElements>
        <activiti:taskListener event="create" class="com.collibra.dgc.core.workflow.activiti.tasklistener.SetRoleResourceTaskListener">
            <activiti:field name="resourceId" expression="${resourceIdToOverride}" />
            <activiti:field name="resourceType" expression="${resourceTypeToOverride}"></activiti:field>
        </activiti:taskListener>
    </extensionElements>
</userTask>
API v2
<scriptTask id="scripttask1" name="scripttask1" scriptFormat="groovy" activiti:autoStoreVariables="false">
    <script><![CDATA[
        execution.setVariableLocal("itemResourceIdCandidateOverride", ${resourceIdToOverride});
        execution.setVariableLocal("itemResourceTypeCandidateOverride", ${resourceTypeToOverride});
    ]]></script>
</scriptTask>

SetValueTaskListener

API v1
<userTask id="usertask1" name="usertask1" activiti:candidateUsers="role(Reviewer)">
<extensionElements>
    ...
    <activiti:taskListener event="create" class="com.collibra.dgc.core.workflow.activiti.tasklistener.SetValueTaskListener">
        <activiti:field name="resultVariable">
            <activiti:string>
		        <![CDATA[proposedUsers]]>
		    </activiti:string>
        </activiti:field>
        <activiti:field name="userExpression">
            <activiti:expression>
	            <![CDATA[${reviewerUserExpression}]]>
	        </activiti:expression>
        </activiti:field>
    </activiti:taskListener>
    ...
</extensionElements>
</userTask>

Add the following script as a step before usertask1.

API v2
<scriptTask id="scripttask1" name="Set reviewer as proposed users" scriptFormat="groovy" activiti:autoStoreVariables="false">
    <script><![CDATA[
        String userNames = users.getUserNamesCsv("${reviewerUserExpression}");
        execution.setVariableLocal("proposedUsers", userNames);
    ]]></script>
</scriptTask>