[JBoss JIRA] Created: (JBPM-1307) jBPM tries to use Hibernate transaction even if configured with isTransactionEnabled = false
by Mauro Molinari (JIRA)
jBPM tries to use Hibernate transaction even if configured with isTransactionEnabled = false
--------------------------------------------------------------------------------------------
Key: JBPM-1307
URL: http://jira.jboss.com/jira/browse/JBPM-1307
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core Engine
Affects Versions: jPDL 3.2.2
Reporter: Mauro Molinari
The method org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is accessing the Hibernate transaction even if jBPM is configured not to use transactions:
<service name="persistence">
<factory>
<bean
class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<field name="isTransactionEnabled">
<false />
</field>
<field name="isCurrentSessionEnabled">
<true />
</field>
</bean>
</factory>
</service>
This causes a serious problem when you're using jBPM inside a JTA environment and you want to control JTA transactions by yourself. For instance, we're using Spring to manage transactions a JBoss Transactions as the JTA implementation. We are not using JNDI in any way, but when we try to call processInstance.end(), a call to org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is performed and Hibernate tries to create a new JTATransaction by querying an empty JNDI InitialContext.
The only workaround we could find is the one outlined here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117325#4117325
that is, subclassing JobSession in order to use Spring TransactionSynchronizationManager.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years
[JBoss JIRA] Created: (JBPM-1173) Fork Node doesn't support conditions on Transitions
by Britt Miner (JIRA)
Fork Node doesn't support conditions on Transitions
---------------------------------------------------
Key: JBPM-1173
URL: http://jira.jboss.com/jira/browse/JBPM-1173
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2
Reporter: Britt Miner
Assigned To: Tom Baeyens
Documentation does not clearly provide any limits to where conditions on Transitions can be used, but the Fork Node doesn't support Transition conditions. For instance
<fork name='FORK_1' >
<transition name='t1' to='NODE_A'>
<condition>#{false}</condition>
</transition>
<transition name='t2' to='NODE_B'/>
</fork>
will fail with a "transition condition #{false} evaluated to 'false'" error when the fork attempts to take transition 't1'. Why provide for this? Someone might want to:
<fork name='FORK_1' >
<transition name='startMyProject' to='...'/>
<transition name='orderEngine to='...'>
<condition>#{needsEngine}</condition>
</transition>
<transition name='orderWheels to='...'>
<condition>#{needsWheels}</condition>
</transition>
...etc...
</fork>
Correcting the issue is as simple as making the following change to org.jbpm.graph.node.Fork.java:
// BRITT --replace the following line with the code below
// to check conditions before adding valid transitions...
//transitionNames = getLeavingTransitionsMap().keySet(); //original line
Iterator iter = leavingTransitions.iterator();
while (iter.hasNext()) {
Transition candidate = (Transition) iter.next();
String conditionExpression = candidate.getCondition();
if (conditionExpression != null) {
Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, executionContext);
if (Boolean.TRUE.equals(result)) {
transitionNames.add(candidate.getName());
}
}else{
transitionNames.add(candidate.getName());
}
}
if (transitionNames.size() == 0) {
transitionNames.add(this.getDefaultLeavingTransition().getName());
this.getDefaultLeavingTransition().removeConditionEnforcement();
log.warn("All transition conditions have evaluated to 'false'. Taking the default transition.");
}
// --BRITT
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1115) Broken datamodel when a detached ProcInst is saved
by Britt Miner (JIRA)
Broken datamodel when a detached ProcInst is saved
--------------------------------------------------
Key: JBPM-1115
URL: http://jira.jboss.com/jira/browse/JBPM-1115
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2
Reporter: Britt Miner
Assigned To: Tom Baeyens
I've noticed (accidentally of course, -ahem-) that if you attempt to call jbpmContext.save(processInstance) on a pi that was loaded outside of the current session, Hibernate will save a new pi with a new Id--however it will reference the same rootToken, etc. as the original pi, and all kinds of unexpected behavior quietly ensues.
Of course, loading a fresh copy of the pi immediately before you do anything with it avoids the problem; however, a lot of serious data integrity hangs on remembering to do that every time. (for instance, when a pi being viewed in a UI is injected into an action component, the programmer must remember to load up a fresh copy before working on it.)
Since failing to re-load a detached pi can result in what seems to be a broken jBPM data model, jBPM should probably be doing something itself to avoid the problem.
I think there are possibly two ways to prevent this from happening:
1) Simply changing the HibernateSaveOperation.save(processInstance) method to saveOrUpdate() seems to perform cleanly.
2) Do a check on the pi, and throw an error if it doesn't belong to the current hibernate session.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1126) ProcessDeifnition substates load into top level node list
by James Violette (JIRA)
ProcessDeifnition substates load into top level node list
---------------------------------------------------------
Key: JBPM-1126
URL: http://jira.jboss.com/jira/browse/JBPM-1126
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM 3.1.4
Environment: ANY
Reporter: James Violette
Assigned To: Tom Baeyens
Priority: Minor
The ProcessDefinition.hbm.xml nodes list must have a where clause to avoid loading substate nodes into the top level node list.
The released nodes list definition
<list name="nodes" cascade="all">
<cache usage="nonstrict-read-write"/>
<key column="PROCESSDEFINITION_" />
<list-index column="NODECOLLECTIONINDEX_" />
<one-to-many class="org.jbpm.graph.def.Node" />
</list>
should be
<list name="nodes" cascade="all" where="superstate is null" >
<cache usage="nonstrict-read-write"/>
<key column="PROCESSDEFINITION_" />
<list-index column="NODECOLLECTIONINDEX_" />
<one-to-many class="org.jbpm.graph.def.Node" />
</list>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month