abas Software AG

The Workflow Designer is a graphical editor, using which you can model and configure your workflows. You can create and save new workflows as well as load and edit existing ones. The saving format is XML.

Workflow Designer is available at the path <tenant>.[<region>].<domain>/workflow/designer/ (for Hybrid-Cloud installation) or at the path <hostname>/workflow/designer/ (for On-Premises installation).

In order to work with the workflow designer, you need to have specific permissions. You need to be in the camunda-admin group in the Administration Overview.

1. Aufbau

The Workflow Designer consists of four components:

1.1. Toolbar

The toolbar contains symbols for process mapping, which can be used via drag and drop. This allows you to easily and quickly create and edit workflows.

Symbol Function

designer icon handtool

Move entire diagram

designer icon lassotool

Select and move part of workflow

designer icon spacetool

Remove or enlarge empty area

designer icon globalconnect

Connect elements

designer icon startevent

Create Start Event

designer icon intermediateevent

Create Intermediate Event

designer icon endevent

Create End Event

designer icon task

Create Task

designer icon exclusive gateway

Create Exclusive Gateway

designer icon subprocess

Create Subprocess

designer icon dataobjectref

Not supported.

designer icon datastoreref

Not supported.

designer icon pool

Represent organizational units and responsibilities

1.2. Design Area

In this area, the workflows are drawn.

1.3. Properties Panel

Using the Properties Panel, you can define the functions of individual elements as well as sequences and dependencies.

1.4. Action Bar

The Action Bar contains buttons using which you can manage workflows.

Button Function

designer button open exec wf

Open executable workflow

designer button open non exec wf

Open not executable workflow

designer button create new wf

Create new workflow

designer button download

Download workflow in XML format

designer button download svg

Download workflow in SVG format

designer button shortcuts

Display shortcut

designer button deploy

Deploy workflow

designer button hide properties panel

Display or hide Properties Panel#

designer button reset zoom

Reset view

2. Creating a workflow

Design your workflow on a piece of paper first, including properties and variables.

To create a workflow in the Workflow Designer, proceed as follows:

  1. Configure Id, Name and Executable.

  2. Add elements.

  3. Configure the properties of the Start Event.

  4. Configure the properties of the User Task.

  5. Configure the properties of the Service Task.

  6. Configure the properties of the Send Task.

2.1. Configuring Id, Name and Executable

2.1.1. Id

The Id must always be unique. It is used as the identifier for this workflow by the process engine. It is useful to choose a meaningful description.

2.1.2. Name

The name is displayed in the Workflow Task Overview. Therefore, choose a meaningful name. Workflows can then be distinguished more easily.

A variable from the type Boolean can only be used in the following format:
${<varName>?<text for case: true>':'<text for case: false>'}

2.1.3. Executable

Activate this check box if a workflow should be executable. If this check box is not activated, it will be ignored by the process engine, e.g. when creating a workflow.

2.2. Adding elements

Drag elements such as tasks, events and gateways from the toolbar and drop them onto the Design Area. Alternatively, you can add elements using their context menu.

Create the workflow with all elements first and edit the properties in the next step.

2.3. Editing the properties of the Start Event

At least one Start Event is required to start the workflow. To edit the properties of the Start Event, click the event. The corresponding Properties Panel opens.

Initiator

The Initiator field is only available in the Start Event. The variable name for the initiator (person who starts the workflow) is defined here. This variable can be accessed later.

You can select the following events in addition to the empty Start Event:

  • Message Start

  • Timer Start

  • Conditional Start

  • Signal Start

Note that only one empty Start Event is permitted. However, multiple Message Start and Signal Start Events are possible.

Further information can be found under Camunda User Documentation - Start event.

2.4. Editing the properties of a User Task

2.4.1. Element Template

You can select predefined element templates in this field, which, for example, allow communication with abas ERP. You can choose between the following element templates:

2.4.2. abas Standard Task

The User Task is assigned to one user (Assignee), multiple users (Candidate Users) and/or groups (Candidate Groups). The users and groups are defined in the Administration Overview . The assignment of a User Task is supported by autocompletion. If a user is entered who does not exist, the input field is highlighted in yellow.

We recommend assigning a task to multiple users and/or a group and not to only one person. The advantage is that another person can perform the task, for example if a person is sick. Assigning a task to a specific person is only useful if only this very person should perform the task. An example could be a management decision.
Variables can be used for every field in the Properties Panel. For example, the following variables can be entered in the Assignee field:
${currentWorker}: user who performed the task previously
${initiator}: user who started the workflow
2.4.2.1. Assignee

With the entry in this field, you assign the task to exactly one person.

2.4.2.2. Candidate Users

With the entry in this field, you assign the task to a list of users. The individual users are separated by a comma.

2.4.2.3. Candidate Groups

With the entry in this field, you assign the task to one or multiple groups. The individual groups are separated by a comma.

2.4.2.4. Task description

You can describe what the user should do in this field. The text will be displayed in the Workflow Task Overview. The text can also contain variables.

A variable from the type Boolean can only be used in the following format:
${<varName>?<text for case: true>':'<text for case: false>'}

Example:
"Please approve the sales order for ${customerName} at a sum of ${price} ${currency} which was already ${isChecked?'checked':'not checked'}!" .

You can attach documents or links to a task. They will be displayed in the Workflow Task Overview.

Examples:

Only hyperlinks are possible.
2.4.2.6. ERP Config

Select the ERP client in which the task should be performed in this field. The clients are defined as variables in the docker-compose.yml file.

2.4.2.7. Due Date

With the entry in this field, you define the due date of the task as a particular date or period. The entry must comply with the ISO 8601 standard.

Examples:

  • 2018-01-12T12:15:00Z

  • P6D: 6 days

  • PT6H: 6 hours

  • P1DT12H: 1 day and 12 hours

2.4.2.8. Priority

With the entry in this field, you define the priority of the task: from 0 (lowest priority) to 100 (highest priority). The default value is 50.

We recommend the following values for priorities:

Value Priority

[0..19]

Lowest

[20..39]

Low

[40. .59]

Normal

[60..79]

High

[80..100]

Highest

2.4.2.9. Select notification template

In this field, a notification defined in Administration Overview can be selected. This notification can be set as mandatory. An existing standard notification is overridden in the case of a selection.

This function is available from Version 1.1.0.

2.4.3. abas ERP Workflow

To establish a connection to abas ERP, select the abas ERP Workflow template. It can be used, for example, to create or edit a sales order.

2.4.3.1. abas command

Enter an abas command which is to be executed in this field.
Example:
<(Sales)><(New)>,(SalesOrder)

2.4.3.2. Lock object

With the entry in this field, you define if the specified ERP object can be edited by other users:

  • Yes means that the object is locked for other users.

  • No means that the object is released for editing for other users.

The default setting is Yes.

2.4.3.3. Enable automation

With the entry in this field, you define if the task should be ended automatically after saving the specified ERP object:

  • Yes means that the task is ended.

  • No means that the task must be ended explicitly.

The default setting is Yes.

2.4.3.4. abas ERP - Parameter Mapping

In this section, content from abas ERP fields can be stored in variables. These can be accessed in the further sequence flow. To allocate the content of an abas ERP field to a variable, click the + button. To cancel the allocation, click the x. Enter the english field name without underscore in the left column and a unique variable name in the right column.

Any unique name can be chosen for the variable. Only the prefix abas_ must not be used.
abas ERP-Feld Variable Field type Format

id

objectId

Field

<engl. field name>

totalNetAmt

price

Field

<engl. field name>

customer^descrOperLang

customerName

Reference field

<engl. field name>^<engl. field name>

t:product

product

Table column

t:<engl. field name>

1:price

firstPrice

Table field

<row number>:<engl. field name>

When reading the fields from abas ERP, the data types Boolean, Integer, Double and String are not taken into account, but all are converted to the data type java.lang.String.

For a Boolean field, only ${prnt} must be written to check if the value is true.
The abas field price is of the Double type. In an expression, only ${price > 60} must be written to check if the value of the price field is greater than 60.
2.4.3.5. Question and Answer

In this section, a question can be defined which should be displayed when finishing a task.

Question text

Enter the question here, e.g. Release sales order?

Type of expected answer

You can choose between a predefined answer or an individually created answer here. To create an individual answer, click the + button.

Name of workflow parameter

This field defines a variable which is selected as a preset answer, e.g. approval.

2.4.3.6. Evaluation Script

A Groovy script can be written here which checks if the task can be completed. For example, you can write an evaluation script which triggers a RuntimeException if the condition is not met. In this way, the user receives an error message if the condition was not met and they cannot complete the task.

You can use a field value from the specified ERP object. It must have the following format: bpmEditor.<EnglischerFeldname>. Reference fields are also supported (e.g. bpmEditor.referenceField.field1).

The constructor empty(bpmEditor.<engl. field name>) checks if the field is empty. For a reference field (e.g. bpmEditor.referenceField.field1) it is checked first if the refernceField field is empty and subsequently if the field1 field is empty.

From version 0.201.2 the variable is called bpmEditor (in earlier versions it is called editor).

Example:

if(empty(bpmEditor.totalNetAmt)){
        throw new RuntimeException("The net total cannot be 0!");
}

It is checked if the net total field of the sales order is empty. If it is empty, the user receives the message "The net total cannot be 0!" and cannot complete the task.
2.4.3.7. Select notification template

In this field, a notification defined in Administration Overview can be selected. This notification can be set as mandatory. An existing standard notification is overridden in the case of a selection.

This function is available from Version 1.1.0.

2.4.4. Dynamic form

This template is displayed as a form which must/can be filled in by the user in the Workflow Task Overview.

The abas BPM Basic variant does not include dynamic forms..
A dynamic task is only displayed in the Workflow Task Overview and not in the Infosystem PROCESSCENTER.
2.4.4.1. Dynamic Form Fields

You can define the input fields which are displayed in the Workflow Task Overview in this section.

Variable name
With the entry in this field, you define the name of the variable.

Type
With the entry in this field, you define the type of the variable.

Typ Description

String

Text field

Boolean

Check box

Number

Number field

Number(String)

Outdated text field for numbers (should not be used)

Date

Date field

List

List with predefined entries

Key/Value List

List with predefined entries

Key/ Value List:
Über den Eintrag im Feld Key definieren Sie den Schlüssel und im Feld Display Name den Wert, der im Task Overview angezeigt wird.
Um die Variable zu verwenden, müssen Sie ${<variableName>.key} oder ${<variableName>.value} schreiben.

Label
With the entry in this field, you define the label.

Default value
With the entry in this field, you define a default value.

Required
With the entry in this field, you define if the field is a mandatory field.

Validation
With the entry in this field, you define a condition. Specify a regular expression. e.g. [a-zA-z] for letters only. The condition is only available for the types String and Number.

Validation Message
With the entry in this field, you define a message which is displayed if the entered value does not meet the condition.

The ERP Config field is optional for the dynamic template. If the field is empty, the field is ignored.

Example:
elementtemplate usertask dynaform
Open figure

The form is displayed as follows in the Workflow Task Overview:
userdashboard dynamicform
Open figure

2.5. Editing the properties of a Service Task

Using a Service Task, you can automatically perform services.

2.5.1. Element Template

In this field, you can select predefined element templates which perform certain tasks in abas ERP. You can choose between the following element templates:

The fields Object ID and ERP Config are handled equally in every Service Task.

2.5.1.1. Object ID

With the entry in this field, you define which object should perform a task. Enter the abas ERP object ID here.

2.5.1.2. ERP Config

With the entry in this field, you define the ERP client in which the task should be performed. The clients are defined as variables in the docker-compose.yml file.

2.5.2. Lock Record

This element template allows you to lock a data record in the abas ERP context. Then no other employee can edit the data contained in it.

2.5.2.1. Lock Variable

To lock a data record, a variable must be defined. This is the English name of the field which is responsible for locking the object. In some objects in abas ERP, this variable is of the Boolean type, in other objects it is of the String type. If the value is a Boolean value (e.g. "transLock"), it is set to true. If the value is a String value, the variable must be ', S'.

2.5.3. Unlock Record

This element template allows you to unlock a data record.

2.5.3.1. Unlock Variable

To unlock a data record, a variable must be defined. This is the English name of the field which is responsible for unlocking/locking the object. In some objects in abas ERP, this variable is of the Boolean type, in other objects it is of the String type. If the value is a Boolean value (e.g. "transLock"), it is set to false. If the value is a String value, the ', S' convention must be removed.

2.5.4. Set fields

This element template allows you to fill/write abas ERP fields in already existing data objects.

2.5.4.1. EDP Variables

To set a field, click the + button. Enter the English field name from the abas ERP screen in the Key field, e.g. zipCode. Enter a workflow variable or any value in the Value field, e.g. ${zipCode}. The field can also contain a FreeMarker script.

2.5.5. Execute ERP Command

This element template allows you to execute abas ERP commands.

2.5.5.1. ERP Command

With the entry in this field, you define the abas ERP command, e.g. <(Sales)>${objectId}<(Transfer)>.

2.5.6. Create abas ERP object

This element template allows the automatic creation of a data record.

2.5.6.1. Database Group

With the entry in this field, you define the database group. It can consist of the database number and group number, e.g. 3:22, or of the respective names, e.g (Sales):(SalesOrder).

2.5.6.2. New object variables

With the entry in this field, you define which values are written in abas ERP fields. To fill a field, click the + button. To cancel the allocation, click the x. Enter the English field name without underscore in the left column and the value to be written in the right column.

Examples are listed in the section abas ERP - Parameter Mapping.

2.5.6.3. abas ERP - Parameter Mapping

In this section, content from abas ERP fields can be stored in variables. These can be accessed in the further sequence flow. To allocate the content of an abas ERP field to a variable, click the + button. To cancel the allocation, click the x. Enter the english field name without underscore in the left column and a unique variable name in the right column.

Any unique name can be chosen for the variable. Only the prefix abas_ must not be used.
abas ERP-Feld Variable Field type Format

id

objectId

Field

<engl. field name>

totalNetAmt

price

Field

<engl. field name>

customer^descrOperLang

customerName

Reference field

<engl. field name>^<engl. field name>

t:product

product

Table column

t:<engl. field name>

1:price

firstPrice

Table field

<row number>:<engl. field name>

When reading the fields from abas ERP, the data types Boolean, Integer, Double and String are not taken into account, but all are converted to the data type java.lang.String.

For a Boolean field, only ${prnt} must be written to check if the value is true.
The abas field price is of the Double type. In an expression, only ${price > 60} must be written to check if the value of the price field is greater than 60.

2.5.7. Run abas ERP Infosystem

This element template allows you to run an infosystem. The header fields in the infosystem can be filled, the infosystem can be started and the field values can be read.

2.5.7.1. abas ERP Infosystem to run

With the entry in this field, you define the infosystem which should be run. The workspace/searchword of the infosystem format must be used for this, e.g. vk/AUO.

2.5.7.2. Set Infosystem fields

With the entry in this field, you define the header fields which should be filled. To fill a field, click the + button. To cancel the allocation, click the x. Enter the English field name without underscore in the left column and the value to be written in the right column. To run the infosystem, enter the value 1 in the start field.

Examples:

Infoystem field name Value

kkuli

${customerId}

start

1

2.5.7.3. abas ERP - Parameter Mapping

In this section, content from abas ERP fields can be stored in variables. These can be accessed in the further sequence flow. To allocate the content of an abas ERP field to a variable, click the + button. To cancel the allocation, click the x. Enter the english field name without underscore in the left column and a unique variable name in the right column.

Any unique name can be chosen for the variable. Only the prefix abas_ must not be used.
abas ERP-Feld Variable Field type Format

id

objectId

Field

<engl. field name>

totalNetAmt

price

Field

<engl. field name>

customer^descrOperLang

customerName

Reference field

<engl. field name>^<engl. field name>

t:product

product

Table column

t:<engl. field name>

1:price

firstPrice

Table field

<row number>:<engl. field name>

When reading the fields from abas ERP, the data types Boolean, Integer, Double and String are not taken into account, but all are converted to the data type java.lang.String.

For a Boolean field, only ${prnt} must be written to check if the value is true.
The abas field price is of the Double type. In an expression, only ${price > 60} must be written to check if the value of the price field is greater than 60.

2.6. Editing the properties of a Send Task

Using a Send Task, you can automatically send messages.

2.6.1. Element Template

With the entry in this field, you define the element templates. You can choose between the following element templates:

2.6.2. Simplified email notification

This element template allows you to send an email.

2.6.2.1. Recipient

With the entry in this field, you define the email addresses of the recipient. Multiple recipients are separated by commas. CC|BCC email addresses are separated by the pipe character. You can also enter variables and groups.

Example:
${customer}|cc:maxmustermann@abas.com|bcc:test@abas.com

2.6.2.2. Subject

With the entry in this field, you define the subject of the email.

2.6.2.3. Message

With the entry in this field, you define the message text.

2.7. Editing the properties of an Exclusive Gateway

An Exclusive Gateway splits the workflow into different sequence flows. Depending on the precondition, one certain sequence flow is selected. You can also define a default outgoing flow which is always selected if none of the other sequence flows could be selected.

The individual conditions are written in the sequence flows. To do so, you must click the sequence flow and then select the Condition Type. To define a default outgoing flow, click the sequence flow first, then the Settings button and finally select Default Flow. A default outgoing flow is represented by a sequence flow with a slash (Example).

If the conditions for all outgoing sequence flows cannot be met, the workflow cannot be continued and an error message is displayed. More detailed information can be found here or in the Camunda User Documentation - Exclusive gateway.

2.7.1. Condition Type

With the entry in this field, you define the type of the condition. You can choose between Expression and Script.

2.7.1.1. Expression

With the entry in this field, you define the expression. For example, the entry ${price > 1000.0} defines that the workflow should select this sequence flow if the price variable is greater than 1000.

2.7.1.2. Script

With the entry in this field, you define the script. You can write in Groovy, JavaScript, JRuby or Jython. Detailed information on scripting can be found in the Camunda User Documentation - Scripting.

2.8. Editing the properties of a Parallel Gateway

A Parallel Gateway splits the workflow into different sequence flows. They are all executed in parallel. No conditions are defined for Parallel Gateways, as all outgoing sequence flows are executed directly.

More detailed information can be found here or in the Camunda User Documentation - Exclusive gateway.

2.9. Deploying a workflow

After completing the modeling, you must save the workflow in the process engine. Click the designer button deploy button (Deploy Workflow) to do so.

If the deployment was successful, the system displays a message with the title The deployment was successful.
If the Executable property of the workflow is not activated, the workflow cannot be started.

3. BPMN 2.0 basic elements

Category Name Symbol Description

Tasks

User Task

100

Must be performed by a person.

Service Task

100

Automatically performed by the system.

Send Task

100

Automatically sends an email.

Script Task

100

Automatically runs a script.

Advanced:

Business Rule Task, Manual Task, Receive Task
Embedded Subprocess, Event Subprocess, Transaction Subprocess, Call Activity
Loop Task, Multi Sequential Instance Task, Multi Parallel Instance Task

Events

Start

100

Starts the workflow.

Intermediate

95

Indicates that something is happening.

End

80

Ends the workflow.

Advanced:

Timer Event, Interrupting Event, Non-interrupting Event, Throwing Event, Catching Event, Escalation Event, Error Event, Terminate Event, Link Event, Signal Event, Compensation Event, Cancel Event, Conditional Event, Message Event

Connecting objects

Sequence flow

element sequence flow

Connects tasks, gateways and events. Defines the sequence of the activities.

Default flow

element default flow

Is selected if no other sequence flow can be selected.

Lanes and Pools

Lanes

200

Graphical representation of a workflow of an organization, a unit or a system. All activities of this unit are displayed within this area.

Pools

200

Graphical representation of a workflow of an organization. Can consist of multiple lanes.

400
Open figure
Open file

Gateways

Exclusive Gateway (Or)

70

Splits the workflow into different sequence flows. Depending on the precondition, one certain sequence flow is selected.

400
Open figure
Open file

Parallel Gateway (And)

70

Splits the workflow into different sequence flows. They are all executed in parallel.

400
Open figure
Open file

Advanced:

Inclusive Gateway, Event based Gateway, Complex Gateway

4. BPMN 2.0 elements for advanced users

4.1. Tasks

Manual Task
100
A Manual Task is completed immediately without user action. It is used to represent a workflow step, e.g. the collection of data.

Receive Task
100
Not supported by abas BPM.

Business Rule Task
100
Not supported by abas BPM.

Loop Task
100
Not supported by abas BPM.
In the following example, a variant which replaces a Loop Task is shown.

Multi Sequential Instance Task
100
A Multi Sequential Instance Task is sequentially duplicated by a defined number of times.

Example without a Multi Sequential Instance Task:
500
Open figure
Open file

Multi Parallel Instance Task
100
A Multi Parallel Instance Task is duplicated in parallel by a defined number of times.

Example without a Multi Parallel Instance Task:
520
Open figure
Open file

4.2. Subprocesses

Embedded Subprocess
100
An Embedded Subprocess is an activity which includes other activities. The subprocess is part of a larger workflow. It is defined completely in the higher level workflow.

Example of an expanded subprocess:
550
Open figure
Open file

Example of a collapsed subprocess:
400
Open figure

Event Subprocess
120
The Event Subprocess can be seen as an Embedded Subprocess which can only be started by a certain event.

Transaction Subprocess
120
The Transaction Subprocess behaves in the same way as an Embedded Subprocess. It is used to group multiple activities to a transaction. The result of a transaction subprocess is a joint success or failure.

Call activity
100
A Call Activity calls another workflow which is outside the workflow.

Example of the Order pizza workflow which calls the Set table workflow:
550
Open figure - Order pizza
Open file - Order pizza

4.3. Gateways

Inclusive Gateway
80
An Inclusive Gateway can split/synchronize a sequence flow into different flows depending on the conditions.

Event based Gateway
70
An Event-based Gateway is always followed by one or more events. Depending on the event, a certain sequence flow is selected.

Complex Gateway
70
The Complex Gateway is not supported by abas BPM.

4.4. Events

Timer Event
element event timer
The execution of the workflow is delayed until a certain point in time has been reached or a period has expired. Time must be specified according to the ISO8601 standard.

Examples:

  • PT30S (until 3 seconds from now)

  • P1D (until tomorrow from now)

  • 2017-08-09/2017-08-30 (from 9 to 30 August 2017)

  • 2017-08-09 (until 9 August 2017)

Interrupting Event
100
The Interrupting Event is attached to a task. If the event occurs before the task is completed, the task is canceled.

Non-interrupting Event
100
The Non-interrupting Event is attached to a task. If the event occurs before the task is completed, the task is not canceled. However, the event sequence flow is executed in parallel.

Throwing/Catching Event
220
220
Triggering events are used to cause an event. They are displayed with icons filled in black.
Catching events are used to wait for an event. They are displayed with icons filled in white.

Escalation Event
element event escalation
The Escalation Event is used to respond to a crisis. When the crisis (escalation) has occurred, the event can be created (thrown). Another event can wait for it and handle the crisis. The Escalation Event which triggers (throws) an escalation is often integrated in a subprocess. The event which catches an escalation is often integrated in the higher level workflow.

Error Event
element event error
An Error Event generates an error and stops all activities in a subprocess. The event can be caught or thrown.

Terminate Event
element event terminate
A Terminate Event ends the entire area in which it is integrated as well as all subprocesses.

Link Event
element event link
The Link Event links two certain points in the workflow without graphically representing a sequence flow. It is used to graphically represent workflows more easily.

Signal Event
element event signal
The Signal Event starts another workflow.

Example eines Workflows, der den Pizza essen Workflow startet:
500
Open figure
Open file

Example of the Eat pizza workflow:
320
Open figure
Open file

Compensation Event
element event compensation
A Compensation Event can throw an event to which already completed tasks can react.

Cancel Event
element event cancel
The Cancel Event can only be used in connection with a Transaction Subprocess. The Cancel End Event is thrown in the subprocess. It can be caught by a Cancel Event, cancels the transaction and triggers all compensation in the subprocess.

Conditional Event
element event conditional
The Conditional Event is triggered when a certain condition occurred.

Message Event
element event message
Not supported by abas BPM.

5. Additional features

5.1. Task Listener

A task listener is used to execute custom logic or an expression upon the occurrences of a certain task-releated event. There are four types of the events that will be invoked on the task:

  • Create: occurs when the task has been created.

  • Assignment: occurs when the task has been assigned. E.g. when a user has unclaimed the task and another has claimed the task, the assignment of the task has been changed. The assignment event has been take place at this point.

  • Complete: occurs when the task is completed.

  • Delete: occurs just before the task is deleted.

In the task listener the DelegateTask object is available that can be used e.g. to get the name, assignee of the task, etc. For more detailed information, please refer to the Camunda Javadoc - DelegateTask

For each event you can define the listeners, the listeners can have the type Java Class, expression, delegate expression and script:

  • Java Class: here you can set the delegation that should be called, later we will show you our standard listeners that you can use.

  • Expression: specifies an expression that will be executed.

As an example:

<camunda:taskListener event="create" expression="${task.setVariableLocal('user', task.getAssignee())}" />

In this example we create a new local varaible user and set it as the current assignee of the task, when the create event of this task has been invoked.

  • Delegate expression: allows to specify an expression that resolves to an object implementing the TaskListener interface.

  • Script: specify a script as task listener.

As an example:

 <userTask id="task">
    <extensionElements>
      <camunda:taskListener event="create">
        <camunda:script scriptFormat="groovy">
          println task.eventName
        </camunda:script>
      </camunda:taskListener>
    </extensionElements>
  </userTask>
It is only possible to get the values from the variables with the type string and number.
Variables from the type date and boolean can NOT be used.

In standard we have several task listeners that you can easily use by defining the java class:

EmailNotification

The EmailNotification listener can be used to send an information mail to the current assignee of the task, informing that he has got a new task to do. With the standard java class de.abas.wf.core.mail.EmailNotification, a notification mail will be sent to the assignee of the task.

GroupEmailNotification

The GroupEmailNotification listener can be used to send an information email the current candidates users and candidate groups of the task, informing that there is an open task to do. If the task has no assignee. With the standard java class de.abas.wf.core.mail.GroupEmailNotification, notification mails will be sent to candidate users and groups of the task.

GeneralEmailNotification

The GeneralEmailNotification listener can be used to send an email. You can define the To, CC and BCC addresses of the recipients and the subject and the body text of the email.

With the standard java clas de.abas.wf.core.mail.GeneralEmailNotification you can easily send an email, and the following fields are available:

  • to: The recipent of the email. In this field you can enter:

    • Valid email address

    • Id of the camunda user: this camunda user will get the mail, if the email address of the user has been set correctly in camunda.

    • Name of the camunda group: all camunda users from this group will get the mail.

    • Expressions, if the value of the expression will be resolved as one of types mentioned above.

If the to field is not set, the current assignee and the candidate users and the candidate groups of the current task will be used as recipents.
  • cc: The cc recipents of the email. You can use the same types as in to field.

  • bcc: The bcc recipents of the email. You can use the same types as in to field.

  • from: The from address of the email.

If the from field is not set, the email address from the docker-compose.yml for the camunda docker container will be used.
  • subject: The subject of the email.

  • body: The body text of the email.

In all fields the Expression are possible if you select the type of the field as Expression rather than String.

As an example:

Another example is looking like this in bpmn file:

<bpmn:userTask id="Task_1ohz78e" name="Check email" camunda:modelerTemplate="abasWorkflowModel_userTask_df" camunda:candidateGroups="marketing">
      <bpmn:extensionElements>
        ...
        <camunda:taskListener class="de.abas.wf.core.mail.GeneralEmailNotification" event="complete">
          <camunda:field name="to">
            <camunda:expression>${task.assignee}</camunda:expression>
          </camunda:field>
          <camunda:field name="subject">
            <camunda:expression>Congratulations! You have completed the workflow task ${task.name}</camunda:expression>
          </camunda:field>
          <camunda:field name="body">
            <camunda:expression>The mail to ${customer} with the content ${content} will be sent immediately!</camunda:expression>
          </camunda:field>
        </camunda:taskListener>
      </bpmn:extensionElements>
      ...
    </bpmn:userTask>

For more detailed information about the task listener, you can refer to the Camunda User Documentation - Task listener

For more detailed information about the user task, you can refer to the Camunda User Documentation - User task

5.2. Exercises

5.2.1. Sales order release process

Exercise: Sales order release process

In this exercise we want to design a sales order release process, that when the sales order having a value greater then 10,000 Euro, it should be firstly approved by the head of the department and afterwards the sales order will be put into the printing queue.

The following functionalities should be included:

  1. At the first step, the user "wf1" will create a new sales order, and he cannot save this sales order when the netto sum is 0.

  2. Then it will be checked, if the netto sum of the just created sales order is greater than 10,000 Euro, if no, the workflow will ends, if yes, it will go to the next steps.

  3. If the sales order having netto sum value greater than 10,000, this sales order will be firstly locked, by activiating the transLock(vsperre) checkbox on the sales order.

  4. Then it should be checked manually by the user wf2, and the wf2 will check this sales order and decide if to approve it or not. Since it is possible that the wf2 is in vacation that he is not able to work on the task. We want to add a candidate group sales-manager in this task.

  5. After the wf2 user has checked the sales order, he can close the task by answering the question that if he wants to approve it or not.

  6. If the wf2 user has approved the sales order, we should remove the lock from the sales order and put this sales order into the print queue by activating the prnt(druck) button. After that, the workflow will end.

  7. If the wf2 user does not approve the sales order, an notification email will be sent to the creator of this workflow and the workflow will then ends up.

  • If the camunda group sales-manager is not avaiable, you can create this group and add members into it in Administration Overview

  • For the User tasks you can use the element template abas ERP Workflow

  • For the Service task to lock the sales order, you can use the element template Lock Record

  • For the Service task to put this sales order into the print queue, you can use the element template Set fields

Solution: Sales order release process

  • Firstly, create the whole bpm process.

exercise design salesorderrelease

  • Set the properties of the whole bpm process.

    • Navigate to the General tab.

    • Set an ID for the process, Enter SalesOrderRelease in the field Id.

    • Enter Sales order release process as the name of this workflow process in the Name field.

    • Activate the Executable check box.

  • Set the properties of the Start Event.

    • Navigate to the General tab.

    • Enter initiator in the Initiator field. This define a workflow process variable with the name initiator that indicates the person who has started the workflow.

  • Set the properties of the User Task Create sales order.

    • Navigate to the General tab.

    • Select the element template abas ERP Workflow in the Element Template field for this User Task. Once selected, some Custom Fields will be provided in the properties panel and some abas-specific attributes have been automatically configured.

    • Enter the user wf1@abas.com in the Assignee field.

    • Select Yes in the dropdown list Lock object. Here we select yes to ensure that this sales object could not be processed concurrently by others.

    • Select Yes in the dropdown list Enable automation. If yes is selected, the task will be completed after the sales order has been saved in abas ERP, otherwise, the user has to explicitly close the task as completed or terminate the task after completing it.

    • In the field abas command enter <(Sales)><(New)>,(SalesOrder).Here the sales order object will then be opened in new mode in abas.

    • In the field ERP Config the default configuration has been set automatically, we don’t have to change anything here since we use the default configuration, otherwise you can enter the name of the configuration here as defined in the abasConfiguration.json file.

    • In the section abas ERP - Parameter Mapping we define here several workflow process variables that will be used later in this workflow.

Table 1. abas Parameter Mapping
abas-ERP Property Workflow Parameter

id

objectId

totalNetAmt

price

customer^descrOperLang

customerName

curr^ISO3Alpha

currency

  • Enter the following script in the Evaluation Script field.

if(empty(bpmEditor.totalNetAmt)){
        throw new RuntimeException("The net total cannot be 0!");
}

In our case the net total of the sales order should not be zero, otherwise an error message saying "The net total cannot be 0!" will be displayed and the task cannot be completed. The workflow does not continue at this point.

  • Navigate to the Listeners tab.

  • Click the + button in the Task Listener field to create a new Task Listener.

  • Select assignment in the Event Type field.

  • Select Java Class in the Listener Type field.

  • Enter the java classname de.abas.wf.core.mail.EmailNotification in the Java Class field.

By doing this, the user wf1 will be informed per email that a new task has been assigned to him.

  • Set the properties of the outgoing flow Yes after the exclusive gateway.

    • Navigate to the General tab.

    • Select Expression in the Condition Type field.

    • Enter the following expression in the Expression field. This expression defines the condition that the net total is greater than or equal to 10,000.

The workflow process variable price is declared in the Create sales order task and it is mapped from the field totalNetAmt in abas ERP.

${price >= 10000.0}

The other outgoing flow with the condition No is a default sequence flow and additional properties are not necessary here.

  • Set the properties of the Service task Lock sales order.

    • Navigate to the General tab.

    • Select the element template Lock Record in the Element Template field.

    • In the field Lock Variable enter the field name transLock . So this field will be set to true after the execution of this service task.

    • In the field Object ID we specify the id of the abas object that should be locked. The variable objectId has been set in the previous User task Create sales order.

    • In the field ERP Config we use the default configuration.

  • Set the properties of the User task Check sales order

    • Navigate to the General tab.

    • Select the element template abas ERP Workflow in the Element Template field.

    • Enter wf2 in the Assignee field and set the group sales-manager in the field Candidate groups.

    • Select Yes in the dropdown list Lock object.

    • Select No in the dropdown list Enable automation. Therefore, this task will not be automatically closed and the user has to complete it explicitly.

    • Enter Please approve the sales order for ${customerName} at a sum of ${price} ${currency}! in the field Task description. This information will be shown in the Workflow Task Overview.

    • Enter <(Sales)>${objectId}<(Edit)> in the abas command field to set the abas command for editing the current sales object.

    • In the field ERP Config we use the default configuration.

    • Enter the text Release sales order? in the Question text field in the Question and Answers section.

    • Select Predefined answers in the Type of expected answer field.

    • Click the + button and enter the first answer Yes .

    • Click the + button once more and enter the second answer No . The result is that the user will be asked the question Release sales order? and they should choose either Yes to release or No to reject.

    • Enter a variable name approval in the Name of workflow parameter field, then the answer of the user will be saved as a workflow parameter approval. E.g. if the user answers "Yes", this variable approval will be set to "Yes".

  • Set the properties of the Outgoing flow No after the gateway Release sales order?

    • Navigate to the General tab.

    • Select the type Expression in the Condition Type field.

    • Write the following expression in the Expression field to indicate that this flow will be chosen if the variable approval equals No.

${approval == 'No'}

The process variable approval has been initialized and set to the value of the answer from the user in the Check sales order User Task.

The other outgoing flow is a default flow, we only have to assign the name Yes to it and don’t need to configure anything else.

  • Set the properties of the Send Task Send notification to creator

    • Navigate to the General tabl.

    • Select the element template Simplified email notification in the Element Template field.

    • Set the Recipients in the Recipient field. Here we set ${initiator}|cc:wf2@abas.com,sales-manager, so that the initiator of the workflow will get this notification mail, and the user wf2@abas.com and the users in camunda group sales-manager will also get the mail as cc copy.

    • Enter a subject for this email message, e.g., Your sales order ${objectId} in the Subject field.

    • Enter the message to be sent, e.g., Your sales order ${objectId} has been rejected! in the Message field.

  • Set the properties of the Service task Release sales order

    • Navigate to the General tab.

    • Select the element template Unlock Record in the Element Template field.

    • In the field Unlock Variable we should use the same variable transLock as we defined in the Sevice task Lock sales order. After the execution of this service task the field transLock will be set back to false .

    • In the field Object ID we use the default value ${objectId}.

    • In the field ERP Config we use the default configuration.

  • Set the properties of the Service task Put sales order into printing queue

    • Navigate to the General tab.

    • Select the element template Set fields in the Element Template field.

    • Under the Custom Fields - EDP Variables add one Key-Value pair: Key: prnt, Value: (Yes). In order to set the boolean field prnt in ERP to true.

    • In the field Object ID we use the default value ${objectId}.

    • In the field ERP Config we use the default configuration.

  • Deploy the workflow.

    • Click on the button Deploy BPMN at the bottom to deploy the process.

Until now, you have designed a simple sales order release process and deployed to the workflow engine. After that, you can start the workflow and work on it.

Download the Sales order release process bpmn file

5.2.2. New employee process

Exercise: New employee process

In this exercise we want to model a process that the information about new employees should be gathered and used to create a employee data in abas ERP.

The following functionalities should be included:

  1. The user wf1 or wf2 will firstly enter some basic information about an employee, e.g. the firstname, lastname and the address of the employee

  2. Afterwards the group hr will enter the information like the job title, the join date of the employee

  3. Then a new employee data object will be created in erp based on the available information.

  4. Then a notification email will be sent to person who have worked on the tasks

  5. And the user wf3 will get a task to check the just created employee in erp that he open this employee object by performing the task.

  • If the camunda group hr is not avaiable, you can create this group and add members into it in Administration Overview

  • For the User tasks to gather the basic information of the employee you can use the element template Dynamic form.

  • For the Service task to create new object in erp, you can use the element template Create abas ERP object

Solution: New employee process

  • Firstly, create the whole bpm process.

exercise design newemployee

  • Set the properties of the whole bpm process.

    • Navigate to the General tab.

    • Set an ID for the process, Enter NewEmployee in the field Id.

    • Enter New Employee Process as the name of this workflow process in the Name field.

    • Activate the Executable check box.

  • Set the properties of the User Task Enter new employee basic information.

    • Navigate to the General tab.

    • Select the Element template Dynamic form

    • In the field Candidate users select the users wf1 and wf2

    • In The field Task description enter a description, e.g. Please enter the basic information of the new employee

    • In the section Dynamic Form Fields create the fields that will be shown on the formular as following:

      • Variable name firstName: Type String, Label Please enter the first name of the new employee, Required Yes

      • Variable name lastName: Type String, Label Please enter the last name of the new employee, Required Yes

      • Variable name street: Type String, Label Please enter the street, Required No

      • Variable name city: Type String, Label Please enter the city, Required No

      • Variable name zipCode: Type String, Label Please enter the zip code, Required No, Validation [0,9]{5}, Validation Message Only letters are allowed

    • Navigate to the Listeners tab.

    • Click the + button in the Task Listener field to create a new Task Listener.

    • Select complete in the Event Type field.

    • Select Script in the Listener Type field.

    • Enter groovy in the Script Format field.

    • Select Inline Script in the Script Type event.

    • Enter the following script in the Script field:

task.setVariable('worker',task.assignee)

This script will be executed at the complete event of this user task. And a new variable worker will be set with the value of the current assignee.

  • Set the properties of the User Task Enter job information.

    • Navigate to the General tab.

    • Select the Element template Dynamic form

    • In the field Candidate groups select the group hr

    • In The field Task description enter a description, e.g. Please enter information for the new employee ${firstName} ${lastName}

    • In the section Dynamic Form Fields create the fields that will be shown on the formular as following:

      • Variable name jobTitle: Type String, Label Please enter the job title of the new employee Required Yes

      • Variable name joinDate: Type Date, Label Please enter the joining date Required Yes, Validation [0-9]{2}\.[0-9]{2}\.[0-9]{4}, Validation Message dd.mm.yyyy

    • Navigate to the Listeners tab.

    • Click the + button in the Task Listener field to create a new Task Listener.

    • Select complete in the Event Type field.

    • Select Script in the Listener Type field.

    • Enter groovy in the Script Format field.

    • Select Inline Script in the Script Type event.

    • Enter the following script in the Script field:

newWorker = worker + ',' + task.assignee
task.setVariable('worker',newWorker)

This script will be executed at the complete event of this user task. And the variable worker will be overwritten with the value of the current assignee and the assignee of the previous task.

  • Set the properties of the Service task Create employee in erp

    • Navigate to the General tab.

    • Select the Element template Create abas ERP object

    • In the field Database Group enter the database object that you want to create (Employee):(Employee)

    • In the section New object variables enter the the erp field name and value: swd - ${lastName}
      addr - ${lastName}, ${firstName}
      street - ${street}
      zipCode - ${zipCode}
      town - ${city}
      jobTitle - ${jobTitle}
      joinDate - ${joinDate}

    • In the section abas ERP - Parameter Mapping enter the following: id - employeeId

The id of the erp object will be mapped as the workflow variable employeeId

  • Set the properties of the Send task Send notification email

    • Navigate toe the General tab.

    • Select the Element template Simplified email notification

    • In the field Recipient set the recipients ${worker}|cc:wf1@abas.com,wf2@abas.com,hr

    • In the field Subject set the subject New employee ${firstName} ${lastName} has been created

    • In the field Message set the message New employee ${firstName} ${lastName} has been created in erp with the ID ${employeeId}

  • Set the properties of the User task Check the employee

    • Navigate to the Element template abas ERP Workflow

    • In the field Assignee set the user wf3

    • In the field Task description enter the description New employee ${firstName} ${lastName} has been created by ${worker}

    • In the field abas command set the command <(Employee)>${employeeId}<(Edit)>

  • Deploy the workflow.

    • Click on the button Deploy BPMN at the bottom to deploy the process.

Until now, you have designed a simple new employee process and deployed to the workflow engine. After that, you can start the workflow and work on it.

Download the New employee process bpmn file

5.3. abas bpm extensions

abas bpm extensions documentation
This document explains, how you can integrate abas bpm extensions.

5.4. Business Hours

Business hours documentation
This document explains, how you can enable and work with business hours.