YearIDGenerator

Description

The handler generates a number, which can be used as a unique classification. Typically, the generated ID is integrated by the https://tim-doc.atlassian.net/wiki/spaces/eng/pages/228264358. The generated ID is set-up as such: YYYYxxxx; in which YYYY is the current year and xxxx represents a sequential counter number (Example: 20220001).

This counter is reset only with the change of the year.


Class

com.dooris.bpm.actionhandler.YearIDGenerator

Parameter

The generated ID can be called on using the variable #{key}, and can then be processed in the handler. If the variable is required as a process variable in the process development, the mandatory field must be set!

Parameter

Default value

Description

Valid examples

Parameter

Default value

Description

Valid examples

mandatoryFields

N/A

The user can set a variable to which the created value is written.

The variable name “id” should not be used!

IDwithYear

pattern

N/A

This parameter is optional and can be used to include process variable(s) in the process instance name. Here, the variable #{key} can be called upon.

  • Employee_name #{variablename} #{key}
    output:
    Employee_name variablename IDwithyear

  • Employee_name #{variablename}
    output:Employee_name variablename

length

4

The length parameter increases the ID length by a specified number of consecutive numbers.
length can be set manually. For example, if “length=5” is entered, the ID will be composed of the current year + 5 consecutive numbers.

If nothing is set manually, the ID is composed of the current year + 4 consecutive numbers by default.

 

prefix

N/A

This adds a specified prefix to the generated ID, with a blank space between the prefix and the ID.

 

 

Example

We have a process instance named ‘Year ID Generation’ with one task in this example. YearIDGenerator handler is set on the task.

Different combinations can be used for the desired output for the process instance name. Our for example contains only the parameter mandatoryFields.
We have a form with one input field which has the variable generatedID.
Actionhandler will generate an ID which will be stored in this variable and will be shown after the process is started, as you can see in the example screenshots below.

Parameter

Description

Example values

Parameter

Description

Example values

mandatoryFields

We put the variable name from the form here.

generatedID

Output after the configuration of the actionhandler:

Example 2:
As said before, different configurations are possible for this actionhandler. In this second example, we will also use the pattern parameter to directly change the instance name. We have a form with two fields which are supervisor (which will be used to enter the employee name) and generatedID (which will be used to store and show the generated ID).

Parameter

Description

Example values

Parameter

Description

Example values

mandatoryFields

We put the variable name from the form here.

generatedID

pattern

A pattern for the instance name can be created with text, process variables and key (which is the generated ID).
In the example:
Supervisor corresponds to text,
#{supervisor} corresponds to a process variable from the smart form and,
#{key} calls the generated ID which we created with the actionhandler

Supervisor #{supervisor} #{key}

These settings will automatically create a unique name based on the year for each started process instance.

Example change of the process instance name after clicking the 'Start process instance' button: