[jBPM] - rule.ConsequenceException only with JPA
by Gary Struthers
Gary Struthers [http://community.jboss.org/people/GaryS] created the discussion
"rule.ConsequenceException only with JPA"
To view the discussion, visit: http://community.jboss.org/message/620233#620233
--------------------------------------------------------------
I've adapted Salaboy's /04-jBPM5-PersistentEmergencyServiceProcess to my process and rule. I copied it's 2 process managers and jpa configuration and adapted his test class. The h2 database connection works. I made another process manager that doesn't use
JPAKnowledgeService, it just calls kbase.newStatefulKnowledgeSession()
My rule execute with kbase.newStatefulKnowledgeSession()
AFTER RULEFLOW COMPLETED process...
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.788 sec
But with JPAKnowledgeService
Hibernate: update ProcessInstanceInfo set lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?
BEFORE ACTIVATION FIRED rule:applicationReady activationId:applicationReady [3, 2] declarations: $process=WorkflowProcessInstance1 [processId=XXX,state=1](2); $vars=FreshmanReadPIvars [XXX](3) ruleflow-group: assignApplication
1 09/08 17:44:59,788[main] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction - Could not commit session
org.drools.runtime.rule.ConsequenceException: rule: applicationReady
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620233#620233]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - Re: How to fix: "The chosen transaction strategy requires access to the JTA TransactionManager" issue?
by sharyak
sharyak [http://community.jboss.org/people/sharyak] created the discussion
"Re: How to fix: "The chosen transaction strategy requires access to the JTA TransactionManager" issue?"
To view the discussion, visit: http://community.jboss.org/message/620451#620451
--------------------------------------------------------------
This one:
Caused by: java.lang.Throwable: Substituted for missing class org.hibernate.HibernateException - The chosen transaction strategy requires access to the JTA TransactionManager
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:46)
at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
at weblogic.deployment.EarPersistenceUnitRegistry.initialize(EarPersistenceUnitRegistry.java:72)
at weblogic.application.internal.flow.InitJpaFlow.prepare(InitJpaFlow.java:38)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620451#620451]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - Unclear on how to get a Process param into my WorkItem
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"Unclear on how to get a Process param into my WorkItem"
To view the discussion, visit: http://community.jboss.org/message/620414#620414
--------------------------------------------------------------
Hi,
I am defining my workflows using the BPMN2 Eclipse tool. When I run my WorkItem I need to get access to a parameter defined in the Process. I use this, which is not good because many Process may be running witht this same parameter in thei Stateful session.
[code]
|
|
| AClass myContext = null; |
|
|
|
| Iterator<ProcessInstance> it = ksession.getProcessInstances().iterator(); |
|
|
|
| while(it.hasNext()) { |
|
|
|
|
| ProcessInstance procInst =it.next(); |
|
|
|
|
| Map<String,Object> contxt = procInst.getProcess().getMetaData(); |
|
|
|
|
| if(contxt.containsValue("myContext")) { |
|
|
|
|
|
| myContext = (AClass) contxt.get("myContext"); |
|
|
|
| } |
|
|
|
| } |
|
|
|
| if(myContext != null) |
|
|
|
|
| service.run(aGrp, myContext); |
|
|
|
| manager.completeWorkItem(workItem.getId(), null); |
|
[/code]
salaboy pointed to his general examples for a similar question and I looked in all of them and could not see where theh recommended way of accessing a Process parameter is shown.
Thx.
David
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620414#620414]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - Unclear on how to get a Process param into my WorkItem
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"Unclear on how to get a Process param into my WorkItem"
To view the discussion, visit: http://community.jboss.org/message/620412#620412
--------------------------------------------------------------
Hi,
I am defining my workflows using the BPMN2 Eclipse tool. When I run my WorkItem I need to get access to a parameter defined in the Process. I use this, which is not good because many Process may be running witht this same parameter in thei Stateful session.
[code]
|
|
| AClass myContext = null; |
|
|
| Iterator<ProcessInstance> it = ksession.getProcessInstances().iterator(); |
|
|
| while(it.hasNext()) { |
|
|
|
| ProcessInstance procInst =it.next(); |
|
|
|
| Map<String,Object> contxt = procInst.getProcess().getMetaData(); |
|
|
|
| if(contxt.containsValue("myContext")) { |
|
|
|
|
| myContext = (AClass) contxt.get("myContext"); |
|
|
|
| } |
|
|
| } |
|
|
| if(myContext != null) |
|
|
|
| service.run(aGrp, myContext); |
|
|
| manager.completeWorkItem(workItem.getId(), null); |
[/code]
salaboy pointed to his general examples for a similar question and I looked in all of them and could not see where theh recommended way of accessing a Process parameter is shown.
Thx.
David
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620412#620412]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months