Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-6663

[SW] Implement expression function calls from a condition element

    XMLWordPrintable

Details

    • 2022 Week 05-07 (from Jan 31)

    Description

      See: https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#using-functions-for-expression-evaluation

      Our implementation should be able to handle use cases like the description below.

      We do support expression functions, but their usage outside actions, we don't. For example:

      {
      "functions": [
        {
          "name": "isAdult",
          "operation": ".applicant | .age >= 18",
          "type": "expression"
        },
        {
          "name": "isMinor",
          "operation": ".applicant | .age < 18",
          "type": "expression"
        }
      ]
      }
      

      And in the state:

      {
      "states":[
        {
           "name":"CheckApplicant",
           "type":"switch",
           "dataConditions": [
              {
                "name": "Applicant is adult",
                "condition": "${ fn:isAdult }",
                "transition": "ApproveApplication"
              },
              {
                "name": "Applicant is minor",
                "condition": "${ fn:isMinor }",
                "transition": "RejectApplication"
              }
           ],
           "defaultCondition": {
              "transition": "RejectApplication"
           }
        }
      ]
      }
      

      See more details at: https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#using-functions-for-expression-evaluation

      Attachments

        Activity

          People

            ftirados Francisco Javier Tirado Sarti
            rhn-support-zanini Ricardo Zanini Fernandes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: