[Design of JBoss jBPM] - conditional transitions in 3.2GA - not working when using ex
by cristim1979
Hi,
I have this problem: some process definition using decisions worked well on JBPM 3.1.4, but when i tried upgrading to 3.2GA, it always chose the default transition (no decision was correctly evaluated).
After some tries, I've seen that the conditions simply do not work in that syntax - using the 'expression' as ATTRIBUTE of the condition tag - but works in the alternate one: using expression as child element.
Is this normal in 3.2 ?
from the userguide (18.4.29. condition):
"{content} For backwards compatibility, the condition can also be entered with the 'expression' attribute, but that attribute is deprecated since 3.2"
if it's still allowed (even deprecated), i was expecting it to still work, somehow...
this junit test shows this:
| import junit.framework.TestCase;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
|
| /**
| * JUnit test of JBPM to check issues regarding the sintax of conditional transitions.<br>
| * In 3.2 it seems that using the 'expression' ATTRIBUTE of the <condition> tag does not
| * work! (but only the alternative, where the expression is passed as a child element of the tag!)
| */
| public class TestDecisionAndConditionalTransitions extends TestCase
| {
|
| public void testDecision( )
| {
| String def1 = "<process-definition>" + " <start-state>" + " <transition to='d' />"
| + " </start-state>" + " <decision name='d'>"
| + " <transition name='t1' to='a'>"
| + " <condition>#{a == '1'}</condition>" + " </transition>"
| + " <transition name='t2' to='b'>"
| + " <condition>#{a == '2'}</condition>" + " </transition>"
| + " <transition name='t3' to='c'>"
| + " <condition>#{a == '3'}</condition>" + " </transition>"
| + " </decision>" + " <state name='a' />" + " <state name='b' />"
| + " <state name='c' />" + "</process-definition>";
|
| String def2 = "<process-definition>" + " <start-state>" + " <transition to='d' />"
| + " </start-state>" + " <decision name='d'>"
| + " <transition name='t1' to='a'>"
| + " <condition expression=\"#{a == '1'\"/>" + " </transition>"
| + " <transition name='t2' to='b'>"
| + " <condition expression=\"#{a == '2'\"/>" + " </transition>"
| + " <transition name='t3' to='c'>"
| + " <condition expression=\"#{a == '3'\"/>" + " </transition>"
| + " </decision>" + " <state name='a' />" + " <state name='b' />"
| + " <state name='c' />" + "</process-definition>";
|
| ProcessDefinition processDefinition1 = ProcessDefinition.parseXmlString( def1 );
| ProcessDefinition processDefinition2 = ProcessDefinition.parseXmlString( def2 );
|
| //test def 1 - should work
| ProcessInstance processInstance = new ProcessInstance( processDefinition1 );
| processInstance.getContextInstance( ).setVariable( "a", "2" );
| processInstance.signal( );
| assertEquals( processDefinition1.getNode( "b" ),
| processInstance.getRootToken( ).getNode( ) );
|
| //test def 2 - doesn't work on JBPM 3.2 ? (but used to work on 3.1.4 ?)
| ProcessInstance processInstance2 = new ProcessInstance( processDefinition2 );
| processInstance2.getContextInstance( ).setVariable( "a", "2" );
| processInstance2.signal( );
| assertEquals( processDefinition2.getNode( "b" ),
| processInstance2.getRootToken( ).getNode( ) );
| }
| }
| anonymous wrote :
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039931#4039931
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039931
18 years, 11 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Bug in transactional delivery in an MDB
by clebert.suconic@jboss.com
Just to add some information on this:
At JmsActivation the transactional attribute is taken in consideration. So.. even CF is a XAConnectionFActory it wouldn't use the XA method if the transactional parameter is false on a createSession request.
Relevant code:
| package org.jboss.resource.adapter.jms.inflow;
|
| public class JmsActivation implements ExceptionListener
| {
|
| ....
|
| protected TopicConnection setupTopicConnection(Context ctx, String
| user, String pass, String clientID) throws Exception
| {
| String topicFactoryRef = adapter.getTopicFactoryRef();
| log.debug("Attempting to lookup topic connection factory " +
| topicFactoryRef);
| TopicConnectionFactory tcf = (TopicConnectionFactory)
| Util.lookup(ctx, topicFactoryRef, TopicConnectionFactory.class);
| log.debug("Got topic connection factory " + tcf + " from " +
| topicFactoryRef);
| log.debug("Attempting to create topic connection with user " +
| user);
| TopicConnection result;
| if (tcf instanceof XATopicConnectionFactory &&
| isDeliveryTransacted)
| {
| XATopicConnectionFactory xatcf = (XATopicConnectionFactory)
| tcf;
| if (user != null)
| result = xatcf.createXATopicConnection(user, pass);
| else
| result = xatcf.createXATopicConnection();
| }
| else
| {
| if (user != null)
| result = tcf.createTopicConnection(user, pass);
| else
| result = tcf.createTopicConnection();
| }
| if (clientID != null)
| result.setClientID(clientID);
| result.setExceptionListener(this);
| log.debug("Using topic connection " + result);
| return result;
| }
|
| ....
| }
|
This way a non transacted Session would be aways a plain Connection...
but not for us!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039902#4039902
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039902
18 years, 11 months
[Design the new POJO MicroContainer] - Re: Idiot's guide to setting up mc build in Eclipse?
by bytor99999
Don't you see a group of tests that failed in the console like below?
| 08:15:18,683 INFO [ASeamAction] sorting - null, true
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.093 sec
| Running org.jboss.test.TemplatePopulatorTest
| Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
| Running org.jboss.test.TextareaMapConverterTest
| Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
|
| Results :
|
| Failed tests:
| testGetServices(org.jboss.test.NameOfSomeTest)
|
| Tests run: 15, Failures: 1, Errors: 0, Skipped: 1
|
It will give you a list of failed tests.
Mark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039894#4039894
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039894
18 years, 11 months