-
Bug
-
Resolution: Unresolved
-
Critical
-
1.30.0.Final
-
False
-
None
-
False
-
---
-
---
-
-
The workflow must correlate with the given event attribute despite the state where the instance is.
For example, a workflow with an event definition like this one:
"events": [ { "name": "CreditCheckCompletedEvent", "type": "creditCheckCompleteType", "source": "creditCheckSource", "correlation": [ { "contextAttributeName": "customerId" } ] } ],
The instance must correlate with this event despite the state and the way the workflow started. So, in the states, we might have:
"states": [ { "name": "CheckCustomer", "type": "operation", "actions": [{ "functionRef": { "refName": "callCheckCustomerService", "arguments": { "customer": "${ .customer }" } }], "transition": "CheckCredit" }, { "name": "CheckCredit", "type": "callback", "action": { "functionRef": { "refName": "callCreditCheckMicroservice", "arguments": { "customer": "${ .customer }" } } }, "eventRef": "CreditCheckCompletedEvent", "end": true } ]
Note that the customer data model is already presented in the workflow context after running the first two states. In the callback state, the workflow should be able to resume if receive an event like this one:
{ "specversion" : "1.0", "type" : "creditCheckCompleteType", "datacontenttype" : "application/json", ... "data": { "creditCheck": [ { "customerId": "customer123", "score": 580, "decision": "Denied", "reason": "Low credit score. Recent late payments" } ] } }
Note the customerId field in the CE data payload.
Note that the customerId field could also be an extension field:
{ "specversion" : "1.0", "type" : "creditCheckCompleteType", "datacontenttype" : "application/json", "customerId": "12345", ... "data": { "creditCheck": [ { "score": 580, "decision": "Denied", "reason": "Low credit score. Recent late payments" } ] } }
- relates to
-
KOGITO-6729 SW Events Correlation Implementation
- Resolved