[jBPM] New message: "Re: how to find all processInstance"
by ciccio ciccio
User development,
A new message was posted in the thread "how to find all processInstance":
http://community.jboss.org/message/528166#528166
Author : ciccio ciccio
Profile : http://community.jboss.org/people/ciccioVega
Message:
--------------------------------------------------------------
I'm trying by myself to make query to db with
JbpmConfiguration instance = JbpmConfiguration.getInstance();
JbpmContext context = instance.getCurrentJbpmContext();
try {
Session hibernateSession = context.getSession();
Query query = hibernateSession
.createSQLQuery("select id_ from...
with jbpm-3.1.4.jar. But i have an exception:
13:07:10,879 INFO [JbpmConfiguration] using jbpm configuration resource 'jbpm.cfg.xml'
13:07:10,895 DEBUG [JbpmConfiguration] loading defaults in jbpm configuration
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'default.jbpm.context'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.hibernate.cfg.xml'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.business.calendar'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.default.modules'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.converter'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.action.types'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.node.types'
13:07:10,942 DEBUG [ObjectFactoryImpl] adding object info 'resource.parsers'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'resource.varmapping'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'jbpm.msg.wait.timout'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'jbpm.byte.block.size'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'mail.smtp.host'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'jbpm.task.instance.factory'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'jbpm.variable.resolver'
13:07:10,957 DEBUG [ObjectFactoryImpl] adding object info 'jbpm.mail.address.resolver'
13:07:10,957 DEBUG [JbpmConfiguration] loading specific configuration...
13:07:10,973 ERROR [STDERR] Exception in thread "Thread-26"
13:07:10,973 ERROR [STDERR] org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
13:07:10,973 ERROR [STDERR] at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:284)
13:07:10,973 ERROR [STDERR] at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:256)
13:07:10,973 ERROR [STDERR] at it.vega.jbpm.demo.MyListenerStop.proviamo(Unknown Source)
13:07:10,973 ERROR [STDERR] at it.vega.jbpm.demo.MyListener$1.directoryChange(Unknown Source)
13:07:10,973 ERROR [STDERR] at it.vega.jbpm.demo.dirListener.DirectoryMonitor.fireNotify(Unknown Source)
13:07:10,973 ERROR [STDERR] at it.vega.jbpm.demo.dirListener.DirectoryMonitor.checkRemovals(Unknown Source)
13:07:10,989 ERROR [STDERR] at it.vega.jbpm.demo.dirListener.DirectoryMonitor.run(Unknown Source)
13:07:10,989 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
13:07:10,989 ERROR [STDERR] Caused by: org.jbpm.JbpmException: no ObjectInfo class specified for element 'import'
13:07:10,989 ERROR [STDERR] at org.jbpm.configuration.ObjectFactoryParser.parse(ObjectFactoryParser.java:139)
13:07:10,989 ERROR [STDERR] at org.jbpm.configuration.ObjectFactoryParser.parseElements(ObjectFactoryParser.java:117
)
13:07:10,989 ERROR [STDERR] at org.jbpm.configuration.ObjectFactoryParser.parseElementsStream(ObjectFactoryParser.ja
va:110)
13:07:10,989 ERROR [STDERR] at org.jbpm.JbpmConfiguration.parseObjectFactory(JbpmConfiguration.java:303)
13:07:10,989 ERROR [STDERR] at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:280)
13:07:11,004 ERROR [STDERR] ... 7 more
So... Any idea? Is there a simple way to find all processInstance given processInstanceId or Key?
Can anyone help me?
TIA
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528166#528166
16 years, 2 months
[jBPM] New message: "Test workflow with JUnit"
by tamisier laure
User development,
A new message was posted in the thread "Test workflow with JUnit":
http://community.jboss.org/message/528146#528146
Author : tamisier laure
Profile : http://community.jboss.org/people/lauretamisier
Message:
--------------------------------------------------------------
Hy,
I try to write Junit test in order to test a workflow jBpm.
I have the following file, but when i run the test, i have an error when it reads the cfg file
---the process
<process name="test" xmlns="http://jbpm.org/4.3/jpdl">
<start name="start" g="98,157,48,48">
<transition name="to ok" to="ok" g="-29,-18"/>
</start>
<state name="ok" g="210,178,92,52">
<transition name="to end" to="end" g="-9,-19"/>
</state>
<end name="end" g="366,210,48,48"/>
</process>
-----------The Test class
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import junit.framework.TestCase;
public class StateTest extends TestCase {
public void testMainScenario() {
// parse the process definition
ProcessDefinition testProcess = ProcessDefinition.
parseXmlResource("fr/ucanss/workflow/test.jpdl.xml");
// create a new process instance for the given process definition
ProcessInstance processInstance = new ProcessInstance(testProcess);
assertNotNull("definition should be not null", testProcess);
assertNotNull("instance should be not null", processInstance);
assertNotNull("root token should be not null", processInstance.getRootToken());
assertNotNull("start node should be not null", processInstance.getRootToken()
.getNode());
}
}
------ I have a file jbpm.cfg.xml
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
</jbpm-configuration>
---- my error
org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:320)
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:272)
at org.jbpm.JbpmConfiguration$Configs.getObjectFactory(JbpmConfiguration.java:488)
at org.jbpm.JbpmConfiguration$Configs.hasObject(JbpmConfiguration.java:500)
at org.jbpm.util.ClassLoaderUtil.getClassLoader(ClassLoaderUtil.java:65)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:160)
at fr.ucanss.test.StateTest.testMainScenario(StateTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.jbpm.JbpmException: no ObjectInfo class specified for element 'import'
at org.jbpm.configuration.ObjectFactoryParser.parse(ObjectFactoryParser.java:139)
at org.jbpm.configuration.ObjectFactoryParser.parseElements(ObjectFactoryParser.java:117)
at org.jbpm.configuration.ObjectFactoryParser.parseElementsStream(ObjectFactoryParser.java:110)
at org.jbpm.JbpmConfiguration.parseObjectFactory(JbpmConfiguration.java:355)
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:314)
... 25 more
Thanks to help me
Laure
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528146#528146
16 years, 2 months
[jBPM] New message: "Test workflow with JUnit"
by tamisier laure
User development,
A new message was posted in the thread "Test workflow with JUnit":
http://community.jboss.org/message/528145#528145
Author : tamisier laure
Profile : http://community.jboss.org/people/lauretamisier
Message:
--------------------------------------------------------------
Hy,
I try to write Junit test in order to test a workflow jBpm.
I have the following file, but when i run the test, i have an error when it reads the cfg file
---the process
<process name="test" xmlns="http://jbpm.org/4.3/jpdl">
<start name="start" g="98,157,48,48">
<transition name="to ok" to="ok" g="-29,-18"/>
</start>
<state name="ok" g="210,178,92,52">
<transition name="to end" to="end" g="-9,-19"/>
</state>
<end name="end" g="366,210,48,48"/>
</process>
-----------The Test class
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import junit.framework.TestCase;
public class StateTest extends TestCase {
public void testMainScenario() {
// parse the process definition
ProcessDefinition testProcess = ProcessDefinition.
parseXmlResource("fr/ucanss/workflow/test.jpdl.xml");
// create a new process instance for the given process definition
ProcessInstance processInstance = new ProcessInstance(testProcess);
assertNotNull("definition should be not null", testProcess);
assertNotNull("instance should be not null", processInstance);
assertNotNull("root token should be not null", processInstance.getRootToken());
assertNotNull("start node should be not null", processInstance.getRootToken()
.getNode());
}
}
------ I have a file jbpm.cfg.xml
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
</jbpm-configuration>
---- my error
org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:320)
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:272)
at org.jbpm.JbpmConfiguration$Configs.getObjectFactory(JbpmConfiguration.java:488)
at org.jbpm.JbpmConfiguration$Configs.hasObject(JbpmConfiguration.java:500)
at org.jbpm.util.ClassLoaderUtil.getClassLoader(ClassLoaderUtil.java:65)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:160)
at fr.ucanss.test.StateTest.testMainScenario(StateTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.jbpm.JbpmException: no ObjectInfo class specified for element 'import'
at org.jbpm.configuration.ObjectFactoryParser.parse(ObjectFactoryParser.java:139)
at org.jbpm.configuration.ObjectFactoryParser.parseElements(ObjectFactoryParser.java:117)
at org.jbpm.configuration.ObjectFactoryParser.parseElementsStream(ObjectFactoryParser.java:110)
at org.jbpm.JbpmConfiguration.parseObjectFactory(JbpmConfiguration.java:355)
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:314)
... 25 more
Thanks to help me
Laure
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528145#528145
16 years, 2 months