clsgenerateid step

Last published at: May 14th, 2024

Description:

Generates a new value, using the start value as reference for first time, adding +1 to the last stored value in deGenerateID table for a specific ID type. For eg. the step generates new value 1001, if the previous value is 1000 and ID Type is ATP.  

Delete

Inputs

  • idType – Provide a string (for eg. ATP)
  • idStartValue (optional) – Provide numeric start value (for eg. 12350) to create for first time or leave it empty for subsequent use
  • varGlobalNextValue –Variable / Global to store the next value generated (using start value as reference and adding +1 to last stored value in the deGenerateID table for the idType)
Delete

Returns

  • True – step executed successfully 
  • False - step failed to execute 

Usage:

Example:

Let’s build and execute the generateIDDef example:

  • Create a new definition called “generateIDDef”
  • Select the definition and click the “design” button
  • Drag a generateID step to the canvas
  • Connect the dots between the start and generateID step

  • Click on the “generateID” step to configure its properties as shown on the below graphic 
  • The step searches for last numeric value for ID TYPE (eg. ATP) in deGenerateID table. The step creates a new record for the ID TYPE when there's no previous value and assigns the same value  (12350) to the variable/global in the above reference. If there's a previous entry of the ID TYPE, the step generates the next value (ID) in sequence, assigns it to variable/global and inserts a new record in deGenerateID table.   
  • Save the process definition, create a process instance and execute.  The step should generate an unique ID for the type. Navigate to Process Instances and render the instance to view the generated ID.