[jBPM Development] - Couldn't retrieve the node name for the process instance
by neeraj sharma
neeraj sharma [https://community.jboss.org/people/nsharm28] created the discussion
"Couldn't retrieve the node name for the process instance"
To view the discussion, visit: https://community.jboss.org/message/787574#787574
--------------------------------------------------------------
Hi,
When i am trying to retreive the node name for particular process instance. I am getting following Error.
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.NullPointerException
at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:68)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:103)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNodeName(NodeInstanceImpl.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:139)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:38)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:186)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:176)
below is the LOC, to get nodename
*System.out.println(("Node name "+((org.jbpm.workflow.instance.WorkflowProcessInstance)instance).getNodeInstances().iterator().next().getNodeName()));*
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787574#787574]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 9 months
[jBPM Development] - What is the best way to work with sessions and processes while using persistance
by Feki Ahmed
Feki Ahmed [https://community.jboss.org/people/bardelman] created the discussion
"What is the best way to work with sessions and processes while using persistance"
To view the discussion, visit: https://community.jboss.org/message/798036#798036
--------------------------------------------------------------
Hi,
Actually, i m a newbie in jbpm so please comment/criticize any wrong thing u think i m doing.
In order to work on processes with human tasks nodes and use persistance, i had the choice between creating a session for each process or to create a session for many processes in the same time.
i choosed the first solution as i can free the memory by disposing the session(with ksession.dipose()) before creating another one and reload it with the JPAKnowledgeService.loadStatefulKnowledgeSession(idsession,kbase, config, env); method when i need it again.
if i was working with the second solution, i create a session and i start processes with ksession.startProcess(..) but i don't know how to stop/pause those process instances in order to free memory ( i m working with jbpm 5.0.0) ..
Another problem happened is that processes in loaded session (in the first solution) seems being not actives (i coudn't get tasks from loaded sessions) and i think maybe becose the session was disposed .. (it was my topic for my previous asked question in here https://community.jboss.org/thread/221356?tstart=0
i also want to know if there is a way to get the persisted sessions list from database without implementing my own logic to do that , i think jbpm already have this logic.
cheers !
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/798036#798036]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 9 months
[jBPM Development] - Jbpm 5.4: testing user group assignment using JbpmJunitTestCase
by mayank sahai
mayank sahai [https://community.jboss.org/people/mesa] created the discussion
"Jbpm 5.4: testing user group assignment using JbpmJunitTestCase"
To view the discussion, visit: https://community.jboss.org/message/799618#799618
--------------------------------------------------------------
i am trying to Unit test user group assignment by extending JbpmJunitTestCase but encountering one exception.
i am setting up the test :
public MytTest() {
super(true);
setPersistence(true);
} -------------- this results in Exception being thrown ,
5591 INFO - UserGroupCallback registered from system property: org.jbpm.task.identity.DefaultUserGroupCallbackImpl
5591 INFO - UserGroupCallback registered: org.jbpm.task.identity.DefaultUserGroupCallbackImpl
5601 WARN - executing transaction with 0 enlisted resource
5691 ERROR - Could not commit session
org.jbpm.workflow.instance.WorkflowRuntimeException: [com.mayank.training.management:1 - EnterTraining:2] -- IOException while storing workItem 1: com.mayank.training.core.model.Training
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)
at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)
at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)
at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)
at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
at com.mayank.training.jbpm.TrainingManagementTest.testHumanTaskAssignedToSalesGroup(TrainingManagementTest.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.jbpm.test.KnowledgeSessionCleanup$1.evaluate(KnowledgeSessionCleanup.java:28)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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: java.lang.IllegalArgumentException: IOException while storing workItem 1: com.mayank.training.core.model.Training
at org.drools.persistence.info.WorkItemInfo.update(WorkItemInfo.java:140)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:46)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
... 45 more
5691 INFO - closing
7881 ERROR - Could not commit session
java.lang.RuntimeException: Could not find session data for id 1
at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:226)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:350)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.dispose(CommandBasedStatefulKnowledgeSession.java:241)
at org.jbpm.test.KnowledgeSessionCleanup$1.evaluate(KnowledgeSessionCleanup.java:38)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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: bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named jdbc/jbpm-ds
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:92)
at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:250)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:589)
at org.drools.persistence.jpa.JpaPersistenceContext.findSessionInfo(JpaPersistenceContext.java:21)
at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:224)
... 19 more
Caused by: bitronix.tm.recovery.RecoveryException: cannot start recovery on a PoolingDataSource containing an XAPool of resource jdbc/jbpm-ds with 0 connection(s) (0 still available)
at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:288)
at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:61)
at bitronix.tm.resource.ResourceRegistrar.register(ResourceRegistrar.java:87)
at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:104)
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:88)
... 43 more
Caused by: java.sql.SQLException: unable to connect to non-XA resource org.h2.Driver
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:108)
at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:341)
at bitronix.tm.resource.common.XAPool.createPooledObject(XAPool.java:283)
at bitronix.tm.resource.common.XAPool.grow(XAPool.java:391)
at bitronix.tm.resource.common.XAPool.getInPool(XAPool.java:371)
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:123)
at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:284)
... 47 more
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-161]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:377)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:267)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:72)
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:104)
... 53 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at org.h2.util.NetUtils.createSocket(NetUtils.java:110)
at org.h2.util.NetUtils.createSocket(NetUtils.java:91)
at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:91)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:373)
... 58 more
p.f.a. persistence.xml attached, it appears to me a configuration issue but unable to find any answer on web.
i am able to test process flow without using persistence.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799618#799618]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 10 months
[jBPM Development] - How to read a process definition in jbpm 5.4?
by Feki Ahmed
Feki Ahmed [https://community.jboss.org/people/bardelman] created the discussion
"How to read a process definition in jbpm 5.4?"
To view the discussion, visit: https://community.jboss.org/message/800086#800086
--------------------------------------------------------------
Hi,
In the documentation there is a paragraph about how to create a process programmatically using the Fluent Process API and then pass it into the KnowledgeBuilder as parameter in order to the session to start a process instance for it...
What i want is the opposite operation : reading a process definition programmatically node by node, whether to read it directly from the ".bpmn" file by indicating it s path or to get it from the jbpm/droos object that contains its instance (i dont know neither which is that object (the ksession ? the processInstance ?) nor what should i exactly get from that object :is it a RuleFlowProcess ? a WorkflowProcess ?
i was about to read a process definition .bpmn file using xml parsing and extract all informations i want which is not the appropriate way to do that.
Please , i need any example or even some advices for this issue. Thanks.
h2.
h2.
.
h2.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/800086#800086]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 10 months