-
Enhancement
-
Resolution: Done
-
Major
-
None
-
NEW
-
NEW
The idea behind this jira is allow the customize not only the sequence name / prefix of the cases but also the expression for generating the caseId using MVEL templates.
- It will provide some functions like:
- LPAD (left padding)
- RPAD (right padding)
- TRUNCATE( truncante by left)
- UPPER
- It will provide some implicit variables like:
- CASE_PREFIX_ID
- DEPLOYMENT_ID
- CASE_DEFINITION_ID
- Case Variables. They could be use for replacement expansion.
- global variable will be provided to modify the standard way of generating case ID
System.getProperty("org.kie.jbpm.cases.id.generator.default_prefix", "CASE");
For instance. At present this works the default expressions
prefix := "CASE"
this generates the next sequence:
CASE-0000000001 CASE-0000000002 CASE-0000000003 CASE-0000000004
another example for the same processId
case variable => type = "type1" prefix = "HR-@{UPPER(type})"
this would generate (sequence name /prefix would be HR-TYPE1)
HR-TYPE1-0000000001 HR-TYPE1-0000000002 HR-TYPE1-0000000003
providing a different case variable i.e (type = 3type) would generate:
HR-3TYPE-0000000001 HR-3TYPE-0000000002 HR-3TYPE-0000000003
with sequence name / prefix HR-3TYPE
If the case variable IS_PREFIX_SEQUENCE is set to false (default value is true) it won't create any sequence and the caseIdPrefix expression evalution will become the caseId
case var => CORRELATION_KEY=my correlation key case var => IS_PREFIX_SEQUENCE=false prefix = @{CORRELATION_KEY}
this will generate
caseId = my correlation key
Keep in mind that this would cause that this allows different sequence for the same case definition.
The last option would be to implement your own CaseIdGenerator and specify the class through property (only available in kie-server)
-Dorg.kie.server.cases.generator