Collaboration Model, Pool communication

hello there, i am currently doing a school project,but i have encounter a problem:

i am trying to model a collaboration model, i want to ask is it possible to make the service tasks in different pools to communicate with each other. cause i saw some papers said that it is impossible for two pool communicate with each other when deploy in camunda engine

Thank you very much

1 Like

Hi @Tony72595,

For communication that crosses the boundaries of your process’ pool, you need to use message flows . To account for additional complexity, communication with message flows needs to be defined more explicitly than intra-pool sequence flow communication. Therefore, BPMN uses events. Each incoming message is received by a catching event — the organization waits for the corresponding incoming message.

Here’s an example:

The delivery address for the package is provided from the order website. Later, you confirm the arrival of the package by sending a message back to the website. Interaction is not limited to activities, but also occurs between pools! The message flows have these little circles on their tail — that’s where you plug them on the activities (or events) to signalize an outgoing message. Because the different lanes are part of your organizational context, you don’t have any kind of message flows occurring within them — use sequence flows instead.


You cannot have sequence flow that traverses pool boundary. To represent details of collaboration (i.e. how do they exchange messages) between participants you should use Message Flows. Those are arrows drawn with dashed line.
image
Message Flows are only allowed between the pools. You cannot have message flow inside a pool.

4 Likes

Thank you so much!!!, i didnt expect such a specific explanation!!!

Hello,
I’m new beginner to Camunda. Do you have an example implementing collaboration model using Spring Boot or JEE.
Thank you

@HEss you can try this example:

Delegates::

@Slf4j
@Component
public class ProductEnquiryDelegate implements JavaDelegate {

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
		FlowElement flowElement = execution.getBpmnModelElementInstance();
		log.info("Flow Element Type::{}", flowElement.getElementType().getTypeName());
		if (flowElement.getName().equals("Forward Message")) {
			runtimeService.createMessageCorrelation("RECIEVE_ENQUIRY_MESSAGE")
					.processInstanceBusinessKey(execution.getProcessBusinessKey())
					.setVariable("text", execution.getVariable("text")).startMessageOnly().correlate();
		} else {
			runtimeService.createMessageCorrelation("RECIEVE_PRODUCT_MESSAGE")
					.processInstanceBusinessKey(execution.getProcessBusinessKey())
					.setVariable("reply", execution.getVariable("reply")).correlate();
		}

	}

}

@Slf4j
@Component
public class EnquiryLoggerDelegate implements JavaDelegate {

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		if(execution.getBpmnModelElementInstance().getName().equals("Log Reply Message")) {
			log.info("Reply Message:{}", execution.getVariable("reply"));
		}else {
			log.info("Text Message:{}", execution.getVariable("text"));
		}
		
	}

}

Bpmn File: PRODUCT_ENQUIRY_PROCESS.bpmn (14.1 KB)

1 Like

Hi @HEss,

here you can find a complete example: GitHub - camunda-consulting/messaging-example: Showing message exchange between independent process engines on spring-boot.

Hope this helps, Ingo

1 Like

Hello @Ingo_Richtsmeier, @aravindhrs
Thank you very much, I’ll try them for sure.

Hello @Ingo_Richtsmeier,
Following steps to run the project, I get this error. I’ve tried to solve the issue, but it didn’t.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.191 s
[INFO] Finished at: 2021-04-13T08:33:45Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.7.RELEASE:run (default-cli) on project orderFulfiller: An exception occurred while running. null: InvocationTargetException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat: Error creating bean with name ‘org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration’: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$$EnhancerBySpringCGLIB$$934e0685]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘resourceConfigCustomizer’ defined in class path resource [org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration$JacksonResourceConfigCustomizer.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer]: Factory method ‘resourceConfigCustomizer’ threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement: javax.xml.bind.annotation.XmlElement → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Hi @HEss,

the project is 3 years old and tested with Java 8. For Java >=9 you have to add the JAXB dependecies explicitly like

    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.1</version>
    </dependency>

Hope this helps, Ingo

Hi @HEss,

if you like you can update the project to the latest Camunda version (7.15 will be released today) together with the matching Spring-Boot version (Spring Boot Version Compatibility | docs.camunda.org) and create a pull request.

Cheers, Ingo