clsGenerateID step

Use this step to generate a new ID value.

Last published at: June 11th, 2024

Description:

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

 

Inputs

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

 

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
  • Define a variable/global to store the result after execution
  • Click the “generateID” step to configure its “Settings” properties. Provide a name to the step. Provide the ID text value. Provide a variable/global to store the result. 

 

  • Click the “generateID” step to configure its “Advanced” properties. Provide the ID start value. The step searches for the last numeric value for ID TYPE (e.g., ATP) in the degenerated 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. Suppose there's a last entry of the ID TYPE. In that case, the step generates the following value (ID) in sequence, assigns it to variable/global, and inserts a new record in the degenerated table.   

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute. Render the process instance. Click on the process step to view its properties. The step should generate the following ID in sequence using the format configured.