Approval Process Design and Implementation

This section is organized as follows:

[bok-callout]For a walk-through and configuration of this Workflow, we refer to Approval Process Walk Through.[/bok-callout]

BPMN Diagram

Step 1: Create a new Activiti project and/or Activiti diagram

The creation of a new Activiti project/diagram is explained in the section on Setting Up Your Workflow Design Workbench

Step 2: Change the Identifier, Name and Description of the Process

We refer to the section Designing Your First Workflow From Scratch, subsection “Change the Identifier, Name and Description of the Process” for an explanation on how  to change the identifier, name and description. For this case, name the workflow (e.g., the default would be “Approval Process”) and give it an identifier (e.g., the default name would be “approvalProcess”). 

Step 3: Create a Pool and Lanes

We refer to the section Designing Your First Workflow From Scratch, subsection “Defining a Pool and Lanes” for an explanation on how to change the identifier, name and description. Start with all 4 needed lanes:

  1. Start User
  2. Subject Matter Expert
  3. Stakeholder
  4. Steward

Step 4: Create a Start and End Event

Set the properties (of the start event):

Start Event > Properties Tab > Form

Form Properties (Configuration Variables)

Id Name Type Default Required Readable Writeable
smeUserExpression User expression for the “Subject Matter Expert” lane in the process string role(Subject Matter Expert) false false true
stakeholderUserExpression User expression for the Stakeholder lane in the process string role(Stakeholder) false false true
stewardUserExpression User expression for the Steward lane in the process string role(Steward) false false true
voteWarningTimeDuration Please enter time duration before a voting reminder is send string B5D false false true
voteTimeoutDuration Timeout before voting process is forced to continue string B7D false false true
voteCompletionPercentage Percentage required to vote before completion long 100 false false true
reviewWarningTimeDuration Time duration before sending reminder in “Review Definion” task string B5D false false true
reviewTimeoutDuration Time before review task is forced to continue string B7D false false true
reviewCompletionPercentage Percentage of users for “Review Definition” that need to complete their task before continuing long 100 false false true
commentTimeoutDuration ime duration before the comment subprocess is ended string B5D false false true
sendVotingActionEmails Send an action email to users that are required to vote in the process boolean false true false true

[bok-callout]For more information about Start and End Events, go to: Designing Your First Workflow From Scratch > Create a Start / End Event.[/bok-callout]

Step 5: Review Definition

Create a Call Activity that will call the Voting Sub-Process:

[bok-callout]For the design of the Voting Sub-Process, go to: Voting Sub-Process Design and Implementation.[/bok-callout]

Set the properties:

Service Call > Properties Tab > Main config

Setting Value Description
Called Element votingSubProcess

This is the Id of the Voting Sub-Process that is being called

Input Parameters See Below The variables or expressions that are being passed to the votingSubProcess
Output Parameters See Below The output variable from the call activity

Input Parameters: These are expressions and variables that are passed to the Voting Sub-Process

Source Source expression Target Target expression
  ${‘Please review the ‘}${item.getConceptTypeName()}${‘.’} decisionInfo  
smeUserExpression   voterUserExpression  
reviewCompletionPercentage   votePercentage  
  ${true} addComments  
  ${true} earlyComplete  
reviewWarningTimeDuration   voteWarningTimeDuration  
reviewTimeoutDuration   voteTimeoutDuration  
  ${“Review”} voteButtonLabel  
  ${“Review”} voteTaskName  
activityFilter   activityFilter  
sendVotingActionEmails   sendActionEmail  

Output Parameters:

Source Source expression Target Target expression Description
votingResult   votingResult   This is the final result of the Voting Sub-Process. It will be true or false

Service Call > Properties Tab > Listeners

Execution Listeners

Listener implementation Type Event Fields
com.collibra.dgc.core.workflow.activiti.listener.SetActivityStreamListener class start See Below

Field name String value Expression
startOnStatusChangeFrom Accepted  
resourceTypes AT  

 

Step 6: Rejected Definition

Create an exclusive gateway and a user task

Set the properties:

Sequence Flow (rejected) > Properties Tab > Main config

Property Value Description
Label width 39 The width of the label on the flow
Condition ${!votingResult.votingResult} This is the result variable from the Voting Subprocess. The “!” means that it is logically opposite, this means that if the “votingResult” variable is “false’ then “!votingResult” is true. Therefore the workflow would take this path.

User Task > Properties Tab > Main config

Property Value Description
Candidate users user(${startUser}) This notification will go to the start user
Documentation Correct the definition after it was rejected by ${users.current}. The start user will see this description on the yellow task ribbon.

User Task > Properties Tab > Listeners

Listener implementation Type Event Fields
com.collibra.dgc.core.workflow.activiti.listener.SetActivityStreamListener class start See Below

Fields:

Field name String value Expression
resourceTypes CM  


Step 7: Mark as “Under Review”

Add a service task to change the status of the Asset that is being approved.

Set the properties:

Sequence Flow (accepted) > Properties Tab > Main config

Property Value Description
Label width 45 The width of the label on the flow (accepted)
Condition ${votingResult.votingResult} This is the result variable from the Voting Sub-Process.

Service Task > Properties Tab >Main config

Property Value Description
Type Java Class Use Java Class for a delegate task
Service class com.collibra.dgc.core.workflow.activiti.delegate.StateChanger This is the StateChanger delegate class
Fields See Below These are the inputs for the delegate class

Fields:

Field name String value Expression Description
targetState 00000000-0000-0000-0000-000000005020   This is the UUID of the new state of the asset.

[bok-callout]This method can be found at: <yourCollibraDomain>/docs/index.html > core > Package: com.collibra.dgc.core.component.delegate > Interface: StateChanger
[/bok-callout]

Step 8: Create Comment Event Sub-Process

Create an Event Sub-Process that gets a comment from each stakeholder:

Set the properties:

EventSubProcess > Properties Tab > Multi instance

Property Value Description
Sequential No  
Collection ${users.getUserNamesWithError(stakeholderUserExpression)} This is the List that will be looped through
Element Variable currentStakeholder this is the item in the list that will be looped through the event sub-process

Due to the Multi-Instance settings, this Event Sub-Process will run as many times as there are Stakeholders. It allows every Stakeholder to make a comment.

[bok-callout]The getUserNamesWithError() method can be found at: <yourCollibraDomain>/docs/index.html > core > Package: com.collibra.dgc.core.component.bean > Interface: UsersBean
[/bok-callout]

Timer Boundary Event > Properties Tab > Main Config

Property Value Description
Cancel activity true  
Time duration ${commentTimeoutDuration} See configuration variables in Start Event

This Event Sub-Process is complete after all the Stakeholders post a comment or until the timeout duration is reached.

Step 9: Provide Comment

Set the properties:

User Task > Properties Tab > Main Config

Property Value Description
Candidate users user(${currentStakeholder}) Created on the Event Sub-Process Multi instance settings above.
Documentation Please provide comments. The Stakeholder will see this description on the yellow task ribbon.

User Task > Properties Tab > Form

Form Properties:

Id Name Type Required Readable Writeable Description
comment Comment textarea true true true The text area to post comment
commentButton Comment taskButton false true true The submit button

Step 10: Store Comment

Set the properties:

 

Service Task > Properties Tab > Form

Property Value Description
Type Expression  
Expression ${commentComponent.addComment(item.id, item.type, comment)} The expression to add a comment

[bok-callout]The addComment method can be found at: <yourCollibraDomain>/docs/index.html > core >Package: com.collibra.dgc.core.model.comment> Interface: CommentComponent
[/bok-callout]

Step 11: Process Comments

Create a user task that notifies the Subject Matter Expert to view the comments.

Set the properties:

User Task > Properties Tab > Main Config

Property Value Description
Candidate users ${smeUserExpression} See configuration variables
Documentation Please process the given comments. Additional text displayed on the yellow task ribbon

User Task > Properties Tab > Listeners

Task Listeners

Listener implementation Type Event Fields
com.collibra.dgc.core.workflow.activiti.listener.SetActivityStreamListener class start See Below

Fields:

Field name String value Expression Description
startTask comment_provide    
resourceTypes CM    

Step 12: Vote For Approval

Create a Call Activity that calls the Voting Sub-Process

[bok-callout]For the design and implementation of the Voting Sub-Process, go to: Voting Sub-Process Design and Implementation[/bok-callout]

Service Call > Properties Tab > Main config

Setting Value Description
Called Element votingSubProcess

This is the Id of the Voting Sub-Process that is being called

Input Parameters See Below The variables or expressions that are being passed to the votingSubProcess
Output Parameters See Below The output variable from the call activity

Input Parameters: These are expressions and variables that are passed to the Voting Sub-Process

Source Source expression Target Target expression
  ${“Please vote for the approval of the definition. If you want to reject, please provide a reason for doing so.”} decisionInfo  
stewardUserExpression   voterUserExpression  
voteCompletionPercentage   votePercentage  
  ${true} addComments  
  ${true} earlyComplete  
voteWarningTimeDuration   voteWarningTimeDuration  
voteTimeoutDuration   voteTimeoutDuration  
  ${“Review/Reject”} voteButtonLabel  
  ${“Approve”} voteTaskName  
sendVotingActionEmails   sendActionEmail  

Output Parameters:

Source Source expression Target Target expression Description
votingResult   votingResult   This is the final result of the Voting Sub-Process. It will be true or false

Step 13: Notify Stakeholders

Create a service task that sends out an email to the Stakeholders.

Set the properties:

Sequence Flow (rejected) > Properties Tab > Main config

Property Value Description
Label width 39 The width of the label on the flow
Condition ${!votingResult.votingResult} This is the result variable from the Voting Subprocess. The “!” means that it is logically opposite, this means that if the “votingResult” variable is “false’ then “!votingResult” is true. Therefore the workflow would take this path.

Service Task > Properties Tab > Main config

Setting Value Description
Service class com.collibra.dgc.core.workflow.activiti.delegate.MailSender MailSender Delegate class

Fields:

Field name String value Expression Description
template rejected   The input for the email template.
mailTo   ${stakeholderUserExpression} The input for the email recipient. It will be the voter.

This Delegate Class can be found at: <yourCollibraDomain>/docs/index.html > core >Package: com.collibra.dgc.core.workflow.activiti.delegate > Interface: MailSender


[bok-callout]For an explanation of using the MailSender Delegate, go to: Designing Your First Workflow From Scratch > Defining a service task that sends and email-notification[/bok-callout]

Step 14: Notify Start User

Create a service task that sends out an email to the Start User

Service Task > Properties Tab > Main config

Setting Value Description
Service class com.collibra.dgc.core.workflow.activiti.delegate.MailSender MailSender Delegate class

Fields:

Field name String value Expression Description
template rejected   The input for the email template.
mailTo   user(${startUser}) The input for the email recipient. It will be the start user

 

Step 15: Mark as “Accepted”

Create a service task that will change the state of the Asset to Accepted.

Set the properties:

Sequence Flow (accepted) > Properties Tab > Main config

Property Value Description
Label width 45 The width of the label on the flow
Condition ${votingResult.votingResult} This is the result variable from the Voting Sub-Process.

Service Task > Properties Tab > Main Config

Property Value Description
Type Java Class Use Java Class for a delegate task
Service class com.collibra.dgc.core.workflow.activiti.delegate.StateChanger This is the StateChanger delegate class
Fields See Below These are the inputs for the delegate class

Fields:

Field name String value Expression Description
targetState 00000000-0000-0000-0000-000000005009   This is the UUID of the new state of the asset.

Step 16: Notify Stakeholders

Create a service task to notify the Stakeholders. Refer to the other “Notify Stakeholders” service task above.

Set the properties:

Service Task > Properties Tab > Main config

Setting Value Description
Service class com.collibra.dgc.core.workflow.activiti.delegate.MailSender MailSender Delegate class

Fields:

Field name String value Expression Description
template approved   The input for the email template.
mailTo   ${stakeholderUserExpression} The input for the email recipient. It will be the start user

Step 17: Notify Start User

Create a service task to notify the Start User. Refer to the other “Notify Start User ” service task above.

Set the properties:

Service Task > Properties Tab > Main config

Setting Value Description
Service class com.collibra.dgc.core.workflow.activiti.delegate.MailSender MailSender Delegate class

Fields:

Field name String value Expression Description
template approved   The input for the email template.
mailTo   user(${startUser}) The input for the email recipient. It will be the start user

You have to login to comment.