1 2 Previous Next 23 Replies Latest reply on May 7, 2010 10:46 PM by rebody Go to original post
      • 15. Re: Problem Signaling a Waiting Execution
        Thanks Ronald.  You didn't offend me at all.  In fact, I appreciate all of he help you have provided.  Your explanation jives with what I expected.  The issue I'm having seems to be that I cannot get the Execution to advance from one node to the next.  I'm going to try and build a simple Java test app that will orchestrate the entire workflow programatically.  My assumption had been that jBPM did that automatically by simply signalling the Process Instance.  I'll let you nkow how it goes.  
        • 16. Re: Problem Signaling a Waiting Execution
          kukeltje

          Well, jBPM does 'automatically' transition from one node to the other automatically IF the type of node is not one that is a wait-state  (state, task and custom, the latter depending on the implementation). All other nodes transition 'automatically'.

           

          Transitioning from a waitstate to the next state is done by a signal from an external system. For that to happen, pass a relevant id (task, execution, activity) to that external system and use it to signal jBPM when the external system is finished. jBPM can never know when this needs to take place. There is one exception. Timers on transitions in wait-states can also advance the execution.

           

          For calling external things, The java node is for simply calling external java classes. If you want more, implement e.g. your own custom node. It's not that difficult and if you take a look at the tests/examples in the source.

           

          Ronald

          • 17. Re: Problem Signaling a Waiting Execution
            kukeltje

            Looking at the fact that you have multiple different eventlisteners, I assume they all do different things right? I suggest to take a look at 'custom' nodes and if you do want your node to behave as a wait state and have a signal from the outside, look in the 'custom' example in the distribution. If you do not want it to behave as a waitstate,

             

            Basically:

             

            waitstate: see the link in the docs, implement that interface. Do the take() in the signal (with or without transition name) and make sure there is a  execution.waitForSignal() in there

             

            automatic: implement the ActivityBehaviour interface and do the take() at the end in the one method that needs to be implemented.

             

            Ronald

            • 18. Re: Problem Signaling a Waiting Execution

              Ronald, -- Thank you for all of your advice.  I finally got it working!  Looks like the advice you gave me worked out.  I created a simple Java app that:

               

              1. Created an instance of the ProcessEngine

              2. Deployed the ProcessDefinition

              3. Performed external work

              4. Signalled the execution to advance to the next node when the external work was done.

               

              So here's another question.  Is there any way to deploy this app programatically to the jBPM console app so that I can demo the workflow utilizing the built-in functionality of the jBPM console app?
              • 19. Re: Problem Signaling a Waiting Execution

                Santanu, -- Thank you for all of your advice.  I finally got it working!  Looks like the advice you gave me worked out.  I created a simple Java app that:

                 

                1. Created an instance of the ProcessEngine

                2. Deployed the ProcessDefinition

                3. Performed external work

                4. Signalled the execution to advance to the next node when the external work was done.

                 

                So here's another question.  Is there any way to deploy this app programatically to the jBPM console app so that I can demo the workflow utilizing the built-in functionality of the jBPM console app?
                • 20. Re: Problem Signaling a Waiting Execution
                  kukeltje

                  sure, just make sure the database you use in your testcase references the same database as your console. Deploying then via the testcase makes it visible in the console. You can also upload via the console or... in jbpm 3, deploy via the deploy tab in eclipse when you have the processdefinition in the designer open.

                  • 21. Re: Problem Signaling a Waiting Execution
                    felixkjose

                    Hi Andy,

                     

                    I am new to JBPM-4.3. And I am also facing the same problem. If you dont mind can you please send me the code for the sample application. I think I am also having a similar kind of requirement. I am expecting a response from you.

                     

                    Thank You and Regards,

                    Felix K Jose

                    • 22. Re: Problem Signaling a Waiting Execution

                      The question I have is ?Where 's the best place to signal a state node to continue when you have a registered EventListener. Since the argument to pubilc void notify(EventListenerExecution execution) methodis an Execution. Can you call execution.signalExecution(execution.getId)

                      from inside the EventListener. The documentation says that the best ways to signal the process to contine 

                      • 23. Re: Problem Signaling a Waiting Execution
                        rebody

                        Hi Ron,

                         

                          If you want to signal a waiting execution after a period time.  You could use timer like this.

                         

                        <process name="TimerTransition" xmlns="http://jbpm.org/4.3/jpdl">
                        
                          <start>
                            <transition to="guardedWait" />
                          </start>
                        
                          <state name="guardedWait">
                            <transition name="go on" to="next step" />
                            <transition name="timeout" to="escalation">
                              <timer duedate="10 minutes" />
                            </transition>
                          </state>
                        
                          <state name="next step" />
                          <state name="escalation" />
                        
                        </process>
                        

                         

                          You could find more information in the developer guide.

                         

                        http://docs.jboss.com/jbpm/v4/devguide/html_single/#timertransition

                        1 2 Previous Next