[JBoss jBPM] - Sub processe definition is null
by PsmithInOz
There seems to be an issue running processes outside of the container when they contain sub-process. The following code is a simple test that has one process with a contained node that is a sub-process. This code produces the following error:
Exception in thread "main" org.jbpm.JbpmException: can't create a process instance when processDefinition is null
| package com.mincom.ellipse.test;
|
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
|
| public class SubProcessTest {
|
| public static void main(String[] args) {
| ProcessDefinition superDef = ProcessDefinition.parseXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\"?><process-definition xmlns=\"\" name=\"super\"><start-state name=\"start-state1\"><transition to=\"node1\"></transition></start-state><node name=\"node1\"><transition to=\"process-state1\"></transition></node> <process-state name=\"process-state1\"><sub-process name=\"sub\"></sub-process><transition to=\"end-state1\"></transition></process-state><end-state name=\"end-state1\"></end-state></process-definition>");
| ProcessDefinition subDef = ProcessDefinition.parseXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\"?><process-definition xmlns=\"\" name=\"sub\"><start-state name=\"start-state1\"><transition to=\"node1\"></transition></start-state><node name=\"node1\"><transition to=\"end-state1\"></transition></node><end-state name=\"end-state1\"></end-state></process-definition>");
| ProcessInstance superInst = new ProcessInstance(superDef);
| ProcessInstance subInst = new ProcessInstance(subDef);
|
| while(!superInst.hasEnded()) {
| superInst.signal();
| }
| }
| }
|
I've done some reading about this and it seems that the JbpmContext must be initialised and any sub process definitions loaded before the super process is called and signalled. However what do you do if you are unit testing the process or indeed running processes that are not long running or deployed to the database?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219712#4219712
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219712
17 years, 1 month
[JBoss jBPM] - spring/jbpm - custom configuration jbpm.cfg.xml
by asiletto
hi all,
I'm working on a webapp with jbpm3.1, spring2.5.5, spring-modules-jbpm31 0.8-20070311155753
it work all perfectly, now i'd like to have a custom MessageServiceFactory on jms. i've seen the JmsMessageServiceFactory which load the jms resource via jndi.
I would like to read the MessageServiceFactory from the spring context (or al least have a reference to my jmsTemplate bean configured inside spring), is there any way to do that?
I load the jbpm configuration with org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean from the file jbpm.cfg.xml
<bean id="jbpmConfiguration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
| <property name="sessionFactory" ref="sessionFactory"/>
| <property name="configuration" value="/WEB-INF/config/jbpm/jbpm.cfg.xml"/>
| </bean>
|
I think I've to write my custom MessageServiceFactory, but I don't know how to reference the spring context inside the implementation...
any suggestion will be appreciated
thanks ;)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219555#4219555
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219555
17 years, 1 month