Sorry, we didn't find any relevant articles for you.

Send us your queries using the form below and we will get back to you with a solution.

GMapPatternSequenceGen Generator

Generates a formatted alphanumeric sequence, such as CASE-AB-000042, from a sequence position held by the G-Map server so that values continue across runs and never repeat across concurrent engines. 

The GMapSequencePatternGen supports configurable alphanumeric sequence patterns. The current sequence is retrieved for consecutive runs and the next value is generated according to the configured pattern. This generator supports concurrent requests without generating duplicate values as well. 

Pattern Example

CASE-AA-000001
CASE-AA-000002
CASE-AA-000003
…

The sequence position is persisted by G-Map, allowing it to continue across runs and preventing duplicate values when multiple engines run concurrently.

The generator works similarly to GMapGetJumpValueGen: it reserves a batch of values from the server in one call and then counts locally. Unlike the jump-value generator, it produces formatted values based on a configurable pattern.

Concurrency: reservations are serialized on the G-Map server, so concurrent engines never receive overlapping values.

 

Generator Parameters

Parameter Description Required
configPath Defines the base path where a configuration file contains the REST URL and port for connecting to a G-MapServer. Y
configSubDir Defines an optional subdirectory where a configuration file contains the REST URL and port for connecting to a G-MapServer. N
configName Defines the name of the configuration file that contains the REST URL and port for connecting to a G-MapServer. Y
mapKeyName Defines the name of the key to query for within the namespace of the G-MapServer. Y
namespace Defines the namespace within a G-Map Server to store key/value data. Y
pattern Output format, including any fixed text, such as CASE-{A:2}-{N:6}. See next section for more details.  Y
startValue Sample-data seed, such as CASE-AA-000001; ignored for real data N
batchSize Number of values reserved from the server per network call. Y
batchByLoopCount True reserves the scenario loop count instead of batchSize. When set to ‘True’, batchSize is still required,though its value is ignored in that case. Y

Important: Attributes configured with the same namespace and mapKeyName share the same reservation and generate the same values within a run. To generate different values, use different mapKeyName values.

 

Parameter Value Example

Below is an example Generator configuration:

Properties File

This Generator requires a Properties file. Create a properties file such as Config.properties (default parameter value) or PatternSequence.properties. It should contain the following information: 

  • namespace - the namespace within a G-Map Server to store key/value data.
  • key - the key to query for within the namespace
  • initialValue - starting value for the pattern sequence
  • url - url used for the REST connection
  • port - port used for the REST connection

Example

namespace=caseNumber
key=caseId
initialValue=CASE-AA-000001
url=http://localhost
port=8500

Pattern Syntax

A pattern consists of fixed text and variable segments.

Segment Meaning Example

{N:w}

Numeric segment, width w, 1-based and zero-padded

{N:6} → 000001 … 999999

{A:w}

Alphabetic segment, width w, base-26 and A-padded

{A:2} → AA … ZZ

Other text

Literal prefix, separator, suffix, or other fixed text

CASE-, -, /US

Pattern Rules

  • The number is the least significant segment. It rolls first.
  • When the numeric segment reaches its maximum, it resets to its minimum and the alphabetic value advances.
  • Numeric segments are 1-based. The first value is ...001, never ...000.
  • The final value in the range is usable. Capacity represents the total number of usable values in the sequence.
  • Each {A} segment is an independent counter. 
  • Segments may use different widths. 
  • The rightmost segment advances first.
  • A segment only advances when the one to its right wraps.

Pattern Examples

Pattern Sequence Capacity

CASE-{A:2}-{N:6}

CASE-AA-000001 → CASE-AA-999999 → CASE-AB-000001 → … → CASE-ZZ-999999

675,999,324

CLAIM-{A:3}-{N:5}

CLAIM-AAA-00001 → … → CLAIM-AAB-00001 → … → CLAIM-ZZZ-99999

1,757,582,424

{A:1}{N:8}{A:1}

A99999999A → A00000001B, the left letter advances only after the right one wraps: A99999999Z → B00000001A

67,599,999,324

Generator Usage

Step 1 - Start the G-Map Server

Start the G-Map server and leave it running:

genrocket -gmap 8500

Note: -gmap accepts an optional cache region.

genrocket -gmap 8500 memonly

Step 2 - Configure the REST Connection

Configure the generator's configPath and configName so that they resolve to a REST configuration pointing to:

http://localhost:8500/rest/

Step 3 - Seed the Starting Value

This step uses the created properties file. For example, the PatternSequence.properties shown below: 

namespace=caseNumber
key=caseId
initialValue=CASE-AA-000001
url=http://localhost
port=8500

If you have not created the properties file, please do so. Then seed G-Map using the command below:

genrocket -gmapipsv /full/path/PatternSequence.properties

Alternative: Seed with curl

The sequence can also be seeded directly through the REST API:

curl -s -X POST http://localhost:8500/rest/putInGroup \
  -H "Content-Type: application/json" \
  -d '{"data":[{"groupName":"caseNumber.caseId","key":"caseId","value":"CASE-AA-000001"}]}'

The seed's namespace and key must match the generator configuration:

namespace  = caseNumber
mapKeyName = caseId

Therefore:

groupName = caseNumber.caseId
key = caseId

Step 4 - Configure the Generator

Assign the GMapPatternSequenceGen to an attribute and configure the required parameters. Remember to save the change once finished. 

Example Parameter Values

  • configPath = <REST config directory>
  • configName = Config.xml
  • namespace = caseNumber
  • mapKeyName = caseId
  • pattern = CASE-{A:2}-{N:6}
  • batchSize = 1000
  • batchByLoopCount = False

Step 5 - Run the Scenario

Run the scenario:

genrocket -r /path/to/YourScenario.grs

The generated values will be:

CASE-AA-000001
CASE-AA-000002
CASE-AA-000003
...

The sequence position is persisted on the G-Map server, so a subsequent run continues from the previously stored position.

Resetting the Sequence

Warning: Clearing the cache resets persisted G-Map values. Do this only when resetting the sequence is intentional.

 

The sequence position is persisted in the G-Map cache.

To restart the sequence from the beginning, clear the G-Map cache:

genrocket -gmaprstche 8500

Then seed the sequence again.

Checking the Current Position

The current stored value can be retrieved with:

curl -s -X POST http://localhost:8500/rest/getFromGroup \
  -H "Content-Type: application/json" \
  -d '{"groupName":"caseNumber.caseId","key":"caseId"}'

Note: This is useful for verifying the position before or after a scenario run.

 

Troubleshooting

G-Map value not found or null

Error: groupName, <group>, with keyValue, <key>, was not found or returned a null value

This error occurs when the G-Map has not been seeded before the first run. Complete Step 3 in the above example to seed the starting value, and then run the Scenario again.

Sequence Exausted

Error: G-Map pattern sequence <group>.<key> for pattern '<pattern>' is exhausted (capacity <n>)

This error occurs when all available values in the sequence have been used. The capacity represents the number of usable values; the final value in the range is usable. 

Invalid Seed Value

Error: Value '<value>' does not match pattern ‘<pattern>’

This error occurs when the seed value does not conform to the configured pattern. Numeric segments are 1-based; for example, a numeric segment ending in 000 is not valid and will be rejected.