12-18-2012 03:50 AM
List<ProcessDefinition> pds= repositoryService.createProcessDefinitionQuery()
.messageEventSubscription("messageNameInsideJMSPayload")
.list();
for (ProcessDefinition pd: pds)
{
RunBPMProcess.runtimeService.startProcessInstanceByMessage(messageName,
di.getId().toString(), processVariables);
}Option 2a - subscribe to a dynamic topic that maps directly to the Activiti message name or Activity Signal name. The tricky part here is how to parse the message or signal name from the BPMN process. I've managed to parse the message reference by using a custom BpmnParseListener, but I can only get the message reference, and not the message name from within the implementation.pec = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
if (pec instanceof ProcessEngineConfigurationImpl)
{
List<BpmnParseListener> preParseListeners = new ArrayList <>();
preParseListeners.add(new BPMNMessageAndSignalParser(pontus));
((ProcessEngineConfigurationImpl) pec).setCustomPreBPMNParseListeners(preParseListeners );
}b) Sending Messages:<?xml version="1.0" encoding="UTF-8" ?>
<definitions id="definitions"
targetNamespace="http://activiti.org/bpmn20"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<message id="pontusMessage" name="pontusMessage"/>
<signal id = "pontusSignal" name="pontusSignal"/>
<process id="test" name="PontusNetworks Test" isExecutable="true">
<startEvent id="start" />
<sequenceFlow id="flow1" sourceRef="start" targetRef="messageReceiver" />
<intermediateCatchEvent id="messageReceiver">
<messageEventDefinition messageRef="pontusMessage" />
</intermediateCatchEvent>
<sequenceFlow id="flow2" sourceRef="messageReceiver" targetRef="signalSender">
</sequenceFlow>
<intermediateThrowEvent id="signalSender">
<signalEventDefinition signalRef="pontusSignal" />
</intermediateThrowEvent>
<sequenceFlow id="flow3" sourceRef="messageReceiver" targetRef="theEnd2"/>
<endEvent id="theEnd2" />
</process>
</definitions>Thanks in advance for any ideas.
12-18-2012 01:18 PM
12-18-2012 01:48 PM
12-19-2012 03:21 AM
Thank you very much for the prompt reply. Unfortunately, using Camel isn't an option currently.
By looking at the Camel examples, It looks like the implementation was implemented using Delegates, which ideally I'd like to avoid.
I've managed to implement my subscription from JMS easily enough (and bumped into a bug in the process – http://jira.codehaus.org/browse/ACT-1497);
now, I'd like to intercept the intermediateThrowEvent command, but so far, I've been unable to do so.
Do you have any pointers on how to do that? I've tried putting a breakpoint in the actualCommandExecutor to see whether I could do it using CommandInterceptors , but it only seems to capture the StartProcessInstanceCmd, but nothing within the process itself.
12-21-2012 05:28 AM
12-21-2012 09:03 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.