startProcessInstanceByMessage

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2012 11:08 AM
Hi,
I'm trying to utilise a model containing a none start event and a message start event, which has a different entry point into the flow.
In my unit test I'm therefore utilising the startProcessInstanceByMessage method on the runtime service and using the message name as defined against the process. However this results in an Activiti Exception: "Cannot start process instance by message: no subscription to message with name 'sessionResumptionMessage' found.".
I've compared my test with those packaged in the engine project and can't really see any obvious differences. Is there any restriction on using both a none start and message start event in the same model?
Here is a code snippet from the unit test:
Many thanks
Ali
I'm trying to utilise a model containing a none start event and a message start event, which has a different entry point into the flow.
In my unit test I'm therefore utilising the startProcessInstanceByMessage method on the runtime service and using the message name as defined against the process. However this results in an Activiti Exception: "Cannot start process instance by message: no subscription to message with name 'sessionResumptionMessage' found.".
I've compared my test with those packaged in the engine project and can't really see any obvious differences. Is there any restriction on using both a none start and message start event in the same model?
Here is a code snippet from the unit test:
@Test @Deployment(resources = { "diagrams/NewSymptomSelection.bpmn" }) /** * Symptom selection business process - Tests found test. */ public void testSymptomSelectionFlowTestsFound() { { Map<String, Object> variables = new HashMap<String, Object>(); variables.put("workflowEvent", "symptomSelection"); ProcessInstance pi = runtimeService.startProcessInstanceByMessage("sessionResumptionMessage", variables);
If anyone can point me in the right direction then I'd be very grateful.Many thanks
Ali
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 06:16 PM
How does your bpmn xml looks like regarding this start event?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 02:13 AM
Below is my flow diagram. plz help.
Also can someone help how to post flow diagram in this forum?
This diagram I copied in MS word and saved as text file might not be useful.
Thanks in advance for help.
Also can someone help how to post flow diagram in this forum?
This diagram I copied in MS word and saved as text file might not be useful.
Thanks in advance for help.
FlowDiagram.txt.zip
1 KB
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 02:38 AM
Hi,
The links you posted do not work for me. But you can have a look on following test in the git repository to see how signal start event works. Following example is not exactly the same, but maybe it can help.
org.activiti.engine.test.bpmn.event.message.MessageStartEventTest#testMessageStartEventAndNoneStartEvent
https://github.com/Activiti/Activiti/blob/fd1e6259142d8050f5ab3c7d81b33e303b1b85ef/modules/activiti-...
Martin
The links you posted do not work for me. But you can have a look on following test in the git repository to see how signal start event works. Following example is not exactly the same, but maybe it can help.
org.activiti.engine.test.bpmn.event.message.MessageStartEventTest#testMessageStartEventAndNoneStartEvent
https://github.com/Activiti/Activiti/blob/fd1e6259142d8050f5ab3c7d81b33e303b1b85ef/modules/activiti-...
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 07:09 AM
I have exactly same issue. Trying to start a process with messageStartEvent. This is how I am trigering the flow in my main method:
public static void main(String[] args)
{ repositoryService.createDeployment().addClasspathResource("diagrams/messageProcess.bpmn20.xml").deploy();
Map<String, Object> processVariables1 = new HashMap<String, Object>();
processVariables1.put("newCustomerId","Ram");
ProcessInstance processInstance = runtimeService.startProcessInstanceByMessage("newCustomerRequest", processVariables1);
}
I am getting exception: Cannot start process instance by message: no subscription to message with name 'newCustomerRequest' found
public static void main(String[] args)
{ repositoryService.createDeployment().addClasspathResource("diagrams/messageProcess.bpmn20.xml").deploy();
Map<String, Object> processVariables1 = new HashMap<String, Object>();
processVariables1.put("newCustomerId","Ram");
ProcessInstance processInstance = runtimeService.startProcessInstanceByMessage("newCustomerRequest", processVariables1);
}
I am getting exception: Cannot start process instance by message: no subscription to message with name 'newCustomerRequest' found

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 07:30 AM
I think I got my answer.
From user Guide:
<b>Message start events are only supported on top-level processes. Message start events are not supported on embedded sub processes.</b>
My usecase is: to halt at a wait state that should get triggered from outside (without user task) and continue the flow.
Any suggestion (please elaborate simple things also, m new to activiti) would be highly appreciated and very helpful.
Also, plz tell me how to upload my workflow images (without using google site if possible) on this forum.
From user Guide:
<b>Message start events are only supported on top-level processes. Message start events are not supported on embedded sub processes.</b>
My usecase is: to halt at a wait state that should get triggered from outside (without user task) and continue the flow.
Any suggestion (please elaborate simple things also, m new to activiti) would be highly appreciated and very helpful.
Also, plz tell me how to upload my workflow images (without using google site if possible) on this forum.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 09:50 AM
Any suggestion (please elaborate simple things also, m new to activiti) would be highly appreciated and very helpful.
May be this test can help you:
org.activiti.engine.test.bpmn.event.signal.SignalEventTest#testSignalCatchIntermediateAsynch
Also, plz tell me how to upload my workflow images (without using google site if possible) on this forum.I use references… .

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2013 07:30 AM
Thanks Martin. Had gone through the repository code. I am now able to resolve my earlier issue now.
But still i am facing issue in my new implementation. Here I am having 'message start event inside a subprocess' thats gets triggered outside by java service task using 'runtimeService.startProcessInstanceByMessage("waitMessage");'
Please help me why I am getting exception as <b>"Exception in thread "main" org.activiti.engine.ActivitiException: Cannot start process instance by message: no subscription to message with name 'waitMessage' found.". </b>
Many thanks for any help..
But still i am facing issue in my new implementation. Here I am having 'message start event inside a subprocess' thats gets triggered outside by java service task using 'runtimeService.startProcessInstanceByMessage("waitMessage");'
Please help me why I am getting exception as <b>"Exception in thread "main" org.activiti.engine.ActivitiException: Cannot start process instance by message: no subscription to message with name 'waitMessage' found.". </b>
Many thanks for any help..

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2013 06:50 AM
Thanks Martin.
