Skip to main content
Skip table of contents

Workflow

Definition

Workflows are used to implement a validation process requiring one or several step(s) of validation to validate an activity.

Each step is represented by a task, which can require a human intervention (UserTask) or be fully autonomous (ScriptTask).

How to configure

You can access the Workflow configuration :

  • by clicking on "Portal" → “Workflows

  • by clicking on "System" → "Configurations" → "Business Model" and perform an import/export.

Global Parameters

Property name

Type

Mandatory

Description

id

String

YES

The id is the unique identifier of the Workflow.

It is case sensitive and no special characters (except - or _) are allowed.

name

String

YES

The Workflow name.

The name may be different from the identifier.
Specifying the name first allows you to define automatically the identifier.
Must be at least 4 characters long.

description

String

NO

Allows to describe the purpose of the Workflow.

The workflow configuration is then built on two mains children :

  • <bpmn> : the Activiti workflow, which describes the logic flow and the relations between the steps

  • <configuration> : the Memority bindings to allow users and Memority to interact during the workflow (GUIs, optional or required comments, links with identities, …)

XML
<ctdbum:Workflow>
  <bpmn></bpmn>
  <configuration></configuration>
</ctdbum:Workflow>

Process part

The procedure details how to implement the tasks of the process. The procedures are called to solve data (duration of a timer, user who can perform a user task) and to execute actions.
The process describes the logic flow of the Workflow.

Domain

Code

Version and encoding: each Workflow starts by announcing the version and encoding.

XML
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:search="http://www.memority.com/toolkit/search-expression/1_0" xmlns:activiti="http://activiti.org/bpmn" xmlns:ctd="http://www.memority.com/citadel/bpmn/1_0" xmlns:ctdbum="http://www.memority.com/citadel/bum/1_0" xmlns:ctdcore="http://www.memority.com/citadel/core/1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="test">
<process id="endvaliditydate_update" name="endvaliditydate_update">
</process>
</definitions>

Definitions: each Workflow starts by announcing the Definitions.

Process

Properties

For some properties it is possible to configure them either by GUI (GUI column) or in the BPMN (Code column).

If the tags are not configured in the BPMN, they are displayed in the GUI.

Property name

Description

GUI

Code

id

The id is the unique identifier of each Process.

It is case sensitive and no special characters (except - or _) are allowed.

(error)

XML
<process id="endvaliditydate_update" name="endvaliditydate_update">
</process>

name

The Process name.

Children

Property name

Description

GUI

Code

startEvent

Used to define the starting point of the Workflow with an id which is usually "start".

(error)

XML
<startEvent id="start"/>

endEvent

Used to define the ending point of the Workflow with an id, which is usually "end".

(error)

XML
<endEvent id="end"/>

userTask

A user task is used to model work that needs to be done by an actor.

Used to define a user task for the Workflow.
If the Workflow must include several user tasks, you will duplicate the <userTask> tag.

(error)

scriptTask

The task script allows a user task not to be sent (in this example, if the modified user is a "VIP" the first validation user task will not be sent).

It is possible to send a notification with a script task.

(error)

boundaryEvent

Allows to define events triggered by events or actions during a task execution.

(error)

sequenceFlow

Used to link all configured tasks of the Process.

(error)

startEvent

Used to define the starting point of the Workflow with an id which is usually "start".

Property name

Description

GUI

Code

id

The id is the unique identifier of each event.

It is case sensitive and no special characters (except - or _) are allowed.

(error)

XML
<startEvent id="start"/>

endEvent

Used to define the ending point of the Workflow with an id, which is usually "end".

Property name

Description

GUI

Code

id

The id is the unique identifier of each event.

It is case sensitive and no special characters (except - or _) are allowed.

(error)

XML
<endEvent id="end"/>
userTask

A user task is used to model work that needs to be done by an actor.

Used to define a user task for the Workflow.
If the Workflow must include several user tasks, you will duplicate the <userTask> tag.

Property name

Description

GUI

Code

id

The id is the unique identifier of each User task.

It is case sensitive and no special characters (except - or _) are allowed.

(error)

Case with configuration by GUI:

XML
<userTask id="validation_step" name="Validation" skipExpression="" activiti:dueDate="">
</userTask>

Case with configuration by BPMN:

XML
<userTask id="validation_step" name="Validation" skipExpression="${shouldSkip} activiti:dueDate="PT2H">

name

The User task name (optional).

(error)

skipExpression

The skip expression is used to decide whether or not a User Task should be skipped (when evaluated to true ). 

The skip expression can be set either as an attribute on the User Task in the BPMN template, or as a tag on the User Task configuration in the Workflow.

The skip expression is an UEL expression which has access to the Execution Variables.

(tick)

dueDate

Each task has a field, indicating the due date of this task.

The due date is purely informative. Everything related to expiration should be handled with Timer Boundary Events.

(tick)

scriptTask

The task script allows a user task not to be sent (in this example, if the modified user is a "VIP" the first validation user task will not be sent).

It is possible to send a notification with a script task.

Property name

Description

GUI

Code

id

The id is the unique identifier of the Script task.

It is case sensitive and no special characters (except - or _) are allowed.

(error)

XML
<scriptTask id="scriptTask" name="Some Script Task" skipExpression="">
    <script>
        def vip = FEATURE.fields.vip as String
        LOG.error('vip = ' + vip)
        VARS.skip = vip == "VIP"
        LOG.error('VARS.skip = ' + VARS.skip)
        return ActionOutcome.success()
    </script>
</scriptTask>

name

The Script task name (optional).

Configuration information about cancellation by requester are detailed in the dedicated page.

boundaryEvent

Allows to define events triggered by events or actions during a task execution.

Refer to the activity documentation (https://www.activiti.org/userguide/ ) to configure all types of events.

A boundary event is defined by:

  • a unique identifier (id)

  • a reference to the activity to which the event is attached through the attachedToRef attribute (id of a User task).

Property name

Description

GUI

Code

id

(error)

Example with an errorEventDefinition:

XML
<boundaryEvent id = "validation_rejected" attachedToRef="validation_step">
    <errorEventDefinition errorRef="REJECTED"></errorEventDefinition>
</boundaryEvent>

Example with a timeout:

XML
<boundaryEvent id="timeout" cancelActivity="true" attachedToRef="validation_step">
    <timerEventDefinition>
        <timeDuration>P1W</timeDuration>
    </timerEventDefinition>
</boundaryEvent>

attachedToRef

cancelActivity

sequenceFlow

Used to link all configured tasks of the Process.

A sequence flow is defined by:

  • a sourceRef (id of the start task)

  • a targetRef  (id of the end task)

Property name

Description

GUI

Code

sourceRef

(error)

XML
<sequenceFlow sourceRef="start" targetRef="validation_step"/>
<sequenceFlow sourceRef="validation_step" targetRef="end"/>
<sequenceFlow sourceRef="validation_rejected" targetRef="end_rejected"/>
<sequenceFlow sourceRef="timeout" targetRef="end_rejected"/>

targetRef

Task configurations

Comments

Allows to define the actions for which a comment is mandatory.

Property name

Description

GUI

key

Used to put the id of the user task.

(error)

value

commentMandatory

Used to declare the actions for which a comment is mandatory or not.

claim

Used to define if the comment is mandatory or not when an actor claims the user task.

complete

Used to define if the comment is mandatory or not when the user task is finished.

delegate

Used to define if the comment is mandatory or not when an actor delegates the user task.

reject

Used to define if the comment is mandatory or not when an actor rejects the user task.

unclaim

Used to define if the comment is mandatory or not when an actor unclaims the user task.

Example
XML
<configuration>
    <taskConfigurations>
        <entry>
            <key>validation_step</key>
            <value xsi:type="ctdbum:UserTaskType">
                <commentMandatory>
                    <claim>true</claim>
                    <complete>true</complete>
                    <delegate>true</delegate>
                    <reject>true</reject>
                    <unclaim>true</unclaim>
                </commentMandatory>
            </value>
        </entry>
    <taskConfiguration>
</configuration>

Delegation

Allows to define if delegation is authorized and for whom.

Property name

Description

GUI

key

Used to put the id of the user task.

(error)

value

delegation

Used to declare the properties of the delegation of the user task.

allowed

Used to define if the delegation is authorized or not.

autoApproveAfterResolution

Allows to define the result of the user task when the actor approve it:

  • If true, the user task is approved after the actor validates it.

  • If false, the user task returns to the Workflow dashboard of the initial actor (used for an info request for example).

autoRejectAfterResolution

Allows to define the result of the user task when the actor reject it:

  • If true, the user task is rejected after the actor rejects it.

  • If false, the user task returns to the Workflow dashboard of the initial actor (used for an info request for example).

scope

Allows to limit the search results.

The objectKind must be IDENTITY.

searchWidget

Allows to configure how the delegates can be searched by using an AdvancedObjectReference widget.

Example
Delegation Example
XML
<configuration>
    <taskConfigurations>
        <entry>
            <key>validation_step</key>
            <value xsi:type="ctdbum:UserTaskType">
                <delegation>
                    <allowed>true</allowed>
                    <autoApproveAfterResolution>true</autoApproveAfterResolution>
                    <autoRejectAfterResolution>true</autoRejectAfterResolution>
                    <scope type="EXPRESSION" objectKind="IDENTITY">
                        <searchExpression>
                            <search:Prop op="EQUALS" name="enabled">
                                <value script="false">true</value>
                            </search:Prop>
                        </searchExpression>
                        <objectTypes>
                            <objectType>Employee</objectType>
                        </objectTypes>
                    </scope>
                    <searchWidget>
                        <config>
                            <actions>
                                <action id="user-card-read" xsi:type="ctdbum:ButtonWidgetType">
                                    <hidden>false</hidden>
                                    <config>
                                        <align>LEFT</align>
                                        <authenticationLevelSufficient>false</authenticationLevelSufficient>
                                        <borderless>true</borderless>
                                        <circle>true</circle>
                                        <color>blue-ebonyclay</color>
                                        <icon>fa fa-user-circle-o</icon>
                                        <label>true</label>
                                        <link>feature://user-card-read/{dataKey.id}</link>
                                        <linkTarget>SELF</linkTarget>
                                        <outline>false</outline>
                                        <size>XS</size>
                                    </config>
                                </action>
                            </actions>
                            <allowExport>false</allowExport>
                            <columns>
                                <column>
                                    <attribute>true</attribute>
                                    <dataKey>id</dataKey>
                                    <dataType>string</dataType>
                                    <dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
                                    <ellipsis>false</ellipsis>
                                    <hidden>false</hidden>
                                    <sortAs>ALPHA</sortAs>
                                    <sortDirection>ASC</sortDirection>
                                    <sortable>true</sortable>
                                    <sorted>false</sorted>
                                    <type>general</type>
                                </column>
                            </columns>
                            <rowClickActions/>
                            <additionalSearchAttributes/>
                            <displayFrozenOperators>true</displayFrozenOperators>
                            <frozen>NO</frozen>
                            <modes>
                                <mode>MULTICRITERIA</mode>
                                <mode>SIMPLE</mode>
                                <mode>FORMULA</mode>
                            </modes>
                            <objectReferences/>
                            <searchExpression>
                                <search:And>
                                    <search:Prop op="IS_NOT_NULL" name="id"/>
                                    <search:Prop op="EQUALS" name="lastName"/>
                                    <search:Prop op="EQUALS" name="firstName"/>
                                </search:And>
                            </searchExpression>
                        </config>
                    </searchWidget>
                </delegation>
            </value>
        </entry>
    <taskConfiguration>
</configuration>

Allows to define which type of actors can perform actions on the Workflow.

It is possible to configure several identity links.

Property name

Description

GUI

key

Used to put the id of the user task.

(error)

value

identityLinks

Used to declare which actors can perform actions on the Workflow.

scope

Allows to limit the search results.

The objectKind must be IDENTITY.

type

Allows to choose a type of actor:

  • ADMIN

  • CANDIDATE

  • SECONDARY CANDIDATE

  • COMMENTER

  • OWNER

  • ASSIGNEE

It is better to always configure an administrator to manage the Workflow (if the candidate is deleted for example).

Example
Identity links Example
XML
<configuration>
    <taskConfigurations>
        <entry>
            <key>validation_step</key>
            <value xsi:type="ctdbum:UserTaskType">
                  <identityLinks>
                     <scope type="EXPRESSION" objectKind="IDENTITY">
                        <searchExpression>
                           <search:Prop op="EQUALS_LIKE" name="id">
                              <value script="false">admin</value>
                           </search:Prop>
                        </searchExpression>
                        <objectTypes>
                           <objectType>superUser</objectType>
                        </objectTypes>
                     </scope>
                     <type>ADMIN</type>
                  </identityLinks>
                  <identityLinks>
                     <scope type="EXPRESSION" objectKind="IDENTITY">
                        <searchExpression>
                           <search:Prop op="EQUALS_LIKE" name="id">
                              <value script="false">ILZKW289</value>
                           </search:Prop>
                        </searchExpression>
                        <objectTypes>
                           <objectType>Employee</objectType>
                        </objectTypes>
                     </scope>
                     <type>CANDIDATE</type>
                  </identityLinks>
            </value>
        </entry>
    <taskConfiguration>
</configuration>

Notifications

Allows to configure notification(s) on actions on the Workflow using:

  • notification id

  • action scripts

It is possible to configure the same email definitions for different actions.

Before configuring a Notification in a workflow, it is mandatory to have configured notifications (emails part).

Properties name

Description

GUI

key

Used to put the id of the user task.

(error)

value

notifications

Used to configure which notification should be sent on which actions.

initializationActions

Used to define the notification actions to be executed when launching a Workflow.

interruptingTimerBoundaryEventActions

Used to define the notification actions to be executed when the timer boundary event is interrupted.

claimActions

Used to define the notification actions to be executed when an actor claims a user task.

unclaimActions

Used to define the notification actions to be executed when an actor unclaims a user task.

delegateActions

Used to define the notification actions to be executed when an actor delegates a user task.

resolveActions

Used to define the notification actions to be executed when an actor approves a user task.

completeActions

Used to define the notification actions to be executed when a user task is finished.

rejectActions

Used to define the notification actions to be executed when an actor rejects a user task.

resolveWithRejectionActions

Used to define the notification actions to be executed when a user task is resolved with a rejection

skipActions

Used to define the notification actions to be executed when a user task is skipped.

Cancellation actions

It is possible to define cancellation actions on the whole workflow who will be triggered in order of declaration when the workflow is cancelled.

Notifications must be of type CITADEL_WORKFLOW__FEATURE_EXECUTION or CITADEL_WORKFLOW__ROLE_ASSIGNMENT_OPERATION_EXECUTION

Example

Configuration using notificationId

Configuration using Action script

XML
<configuration>
    <taskConfigurations>
        <entry>
            <key>validation_step</key>
            <value xsi:type="ctdbum:UserTaskType">
                  <notifications>
                     <initializationActions>
                        <action class="actionNotification">
                           <config xsi:type="ctdrule:CitadelNotificationConfigurationType">
                              <notifications>user_task_approve</notifications>
                           </config>
                        </action>
                     </initializationActions>
                     <interruptingTimerBoundaryEventActions/>
                     <claimActions/>
                     <unclaimActions/>
                     <delegateActions/>
                     <resolveActions>
                        <action class="actionNotification">
                           <config xsi:type="ctdrule:CitadelNotificationConfigurationType">
                              <notifications>user_task_approve</notifications>
                           </config>
                        </action>
                     </resolveActions>
                     <completeActions/>
                     <rejectActions/>
                     <resolveWithRejectionActions/>
                     <skipActions/>
                  </notifications>
            </value>
        </entry>
    <taskConfiguration>
</configuration>
XML
NOTIFY.buildNotification("notification-role")
.withActor("identity")
.role("identity")
.email("huriye.brown@external.company.com")
.end()
.send();
return ActionOutcome.success();

User interface

For each configured user task, you must configure a User Interface. 
A User interface allows to configure a validation screen for the actor of the Workflow.

Property name

Description

GUI

Version and encoding

Each User interface starts by announcing the version and encoding.

(error)

Definitions

Each User interface starts by announcing the Definitions.

Edit widget

It is possible to configure an edit widget. In this case, the actor can perform an update on the pre-filled value.

Display widget

It is possible to configure a display widget. In this case, the actor can just see the pre-filled value.

Role request widget

It is possible to configure a role request widget. In this case, the actor can see role information, perform an update on dimensions or not (according to the configuration).

Example
User Interface Example
XML
<?xml version="1.0" encoding="UTF-8"?>
<ctdbpmn:ui xmlns:ctd="http://www.memority.com/citadel/1_0" xmlns:ctdbpmn="http://www.memority.com/citadel/bpmn/1_0" xmlns:ctdbum="http://www.memority.com/citadel/bum/1_0" xmlns:ctdcore="http://www.memority.com/citadel/core/1_0" xmlns:ctdidm="http://www.memority.com/citadel/idm/1_0" xmlns:ctdrep="http://www.memority.com/citadel/rep/1_0" xmlns:ctdrule="http://www.memority.com/citadel/rule/1_0" xmlns:ctdtnt="http://www.memority.com/citadel/tnt/1_0" xmlns:kit="http://www.memority.com/toolkit/1_0" xmlns:rule="http://www.memority.com/toolkit/rule/1_0" xmlns:ruleaddon="http://www.memority.com/toolkit/addons/rule/1_0" xmlns:search="http://www.memority.com/toolkit/search-expression/1_0" xmlns:settings="http://www.memority.com/toolkit/addons/settings/1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <screen>
      <views>
         <view id="view1">
            <sections>
               <section id="section1">
                  <layout>SINGLE</layout>
                  <columns>
                     <column>
                        <widgets>
                           <widget id="id" xsi:type="ctdbum:AttributeEditorWidgetType">
                              <hidden>false</hidden>
                              <config>
                                 <editor>
                                    <displayWidget xsi:type="ctdbum:TextDisplayWidgetType">
                                       <hidden>false</hidden>
                                       <config>
                                          <backgroundColor>#ffffff</backgroundColor>
                                          <bold>false</bold>
                                          <fontSize>INHERIT</fontSize>
                                          <italic>false</italic>
                                          <textAlign>LEFT</textAlign>
                                          <textColor>#000000</textColor>
                                          <underline>false</underline>
                                       </config>
                                    </displayWidget>
                                 </editor>
                                 <label>Id</label>
                                 <lockedInUi>false</lockedInUi>
                                 <mode>READ</mode>
                                 <multiValued>false</multiValued>
                                 <override>false</override>
                              </config>
                              <attributeId>id</attributeId>
                           </widget>
                        </widgets>
                     </column>
                  </columns>
               </section>
            </sections>
         </view>
      </views>
      <frame>
         <actions/>
         <collapsible>false</collapsible>
         <display>NONE</display>
         <initiallyCollapsed>false</initiallyCollapsed>
         <title>true</title>
      </frame>
   </screen>
</ctdbpmn:ui>

Read Next

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.