Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9094

Add the ability to specify a Case Prefix Expression

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 7.37.0.Final
    • None
    • KieServer
    • NEW
    • NEW

    Description

      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.

      1. It will provide some functions like:
        1. LPAD (left padding)
        2. RPAD (right padding)
        3. TRUNCATE( truncante by left)
        4. UPPER
      1. It will provide some implicit variables like:
        1. CASE_PREFIX_ID
        2. DEPLOYMENT_ID
        3. CASE_DEFINITION_ID
        4. Case Variables. They could be use for replacement expansion.
      2. 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
      

      Attachments

        Activity

          People

            elguardian@gmail.com Enrique González Martínez (Inactive)
            elguardian@gmail.com Enrique González Martínez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: