I want to write a general template bpmn process for implementing a general template SAGA transaction, with using camunda-connector-kafka/pulsar. In the general template SAGA bpmn process, the start event message contains all the parameters configured for a concrete SAGA. If all the parameters in the configuration are dynamic/configurable, the general template SAGA bpmn process would be more flexible.
With general template SAGA bpmn process, to support a concrete SAGA, application developer just need to implement every single micro service which only know kafka/pulsar without knowing Camunda/Zeebe, and then a gateway application produce a kafka/pulsar message which including all the parameters for the concrete SAGA, then a process instance of the general template SAGA bpmn process will be created to implement the concrete SAGA.
(By the way, without eval() function, the general template SAGA bpmn process can be written, the drawback is that the flexibility is a little worse.)
The data structure of the start event message of general template SAGA bpmn process is like code below, and followed by the screen shot of the general template SAGA bpmn process (not done yet) (not using compensation event as Camunda 8.4 has not supported it).
‘class CorrelationBetweenMessageAndProcessInstancePath’ contains two fields, each of them is a FEEL expression. In the input box ‘Correlation key (process) fx’ in the screen shot, I wish I can input like ‘=eval(…correlationBetweenMessageAndProcessInstancePath.correlationKeyExpressionInVariableInProcessInstancePath)’
public class SagaModel {
public final List<TransactionStage> transactionStageList;
public class TransactionStage {
public final List<TransactionCommandPair> transactionCommandPairList;
public class TransactionCommandPair {
public final TransactionCommand doCommand;
public final TransactionCommand undoCommand; //compensate
public class TransactionCommand {
public final RequestInfoFromCoordinatorToMessageBroker requestInfoFromCoordinatorToMessageBroker; //Coordinator might be a process engine such as zeebe/camunda 8
public final ResponseInfoToCoordinatorFromMessageBroker responseInfoToCoordinatorFromMessageBroker;
public class RequestInfoFromCoordinatorToMessageBroker {
public final MessageBrokerAndTopicInfo messageBrokerAndTopicInfo;
public final MessageInfo messageInfo;
public final VarialeMappingInCoordinator varialeMappingInCoordinator;
public final ErrorHandlingInCoordinator errorHandlingInCoordinator;
public class ResponseInfoToCoordinatorFromMessageBroker {
public final MessageBrokerAndTopicInfo messageBrokerAndTopicInfo;
public final String subscriptionName;
public final CorrelationBetweenMessageAndProcessInstancePath correlationBetweenMessageAndProcessInstancePath; //Correlation in coordinator such as zeebe/camunda 8
public final VarialeMappingInCoordinator varialeMappingInCoordinator;
public class CorrelationBetweenMessageAndProcessInstancePath {
public final String correlationKeyExpressionInVariableInProcessInstancePath; //FEEL in zeebe/camunda 8
public final String correlationKeyExpressionInMessage; //FEEL in zeebe/camunda 8