2 Replies Latest reply on Nov 30, 2006 9:31 PM by yy yy

    question about Wfp06MultiChoiceTest?

    yy yy Newbie

      sorry my English is poor.
      i try to change Wfp06MultiChoice's processdefine from String to xml,and deploy to database,but when i test ,it can't select singleness,it always fork to both transition.why?
      -------------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition xmlns="" name="yytest">
      <start-state name='start'>

      </start-state>





      scenario == 1


      scenario == 2











      <end-state name="end"></end-state>
      </process-definition>
      --------------------------------------------------------------
      processInstance = jbpmContext.loadProcessInstance(processInstanceId);
      ContextInstance ci = (ContextInstance) processInstance.getInstance( ContextInstance.class );
      processInstance.signal();
      ci.setVariable("scenario", new Integer(1));
      Token root = processInstance.getRootToken();
      System.out.println(root.getNode());
      root.signal();
      System.out.println(root.getNode());
      Token tokenB = root.getChild("to b");
      Token tokenC = root.getChild("to c");
      tokenB.signal();
      System.out.println("tokenB:"+tokenB.getNode());
      System.out.println("tokenC:"+tokenC.getNode());
      System.out.println(root.getNode());
      System.out.println(ci.getVariable("scenario"));
      ---------------------------------------------------
      result:

      State(a)
      Fork(multichoice)
      tokenB:Join(syncmerge)
      tokenC:State(c)
      Fork(multichoice)
      1

        • 1. Re: question about Wfp06MultiChoiceTest?
          yy yy Newbie

          xml file:
          -------------------------------------------------------
          <process-definition name="process">
          <start-state name='start'>

          <!--</span-->start-state>


          <!--</span-->state>


          #{scenario == 1} or #{scenario >= 3}<!--</span-->condition>
          <!--</span-->transition>

          #{scenario == 2} or #{scenario >= 3}<!--</span-->condition>
          <!--</span-->transition>
          <!--</span-->fork>


          <!--</span-->state>


          <!--</span-->state>


          <!--</span-->join>
          <!--</span-->process-definition>

          • 2. Re: question about Wfp06MultiChoiceTest?
            yy yy Newbie

            xml file:

            <?xml version="1.0" encoding="UTF-8"?>
            <process-definition xmlns="" name="yytest">
             <start-state name='start'>
             <transition to='a' />
             </start-state>
             <state name='a'>
             <transition to='multichoice' />
             </state>
             <fork name='multichoice'>
             <transition name='to b' to='b'>
             <condition>scenario == 1</condition>
             </transition>
             <transition name='to c' to='c'>
             <condition>scenario == 2</condition>
             </transition>
             </fork>
             <state name='b'>
             <transition to='syncmerge' />
             </state>
             <state name='c'>
             <transition to='syncmerge' />
             </state>
             <join name='syncmerge'>
             <transition to='end' />
             </join>
             <end-state name="end"></end-state>
            </process-definition>