4 Replies Latest reply on Dec 2, 2009 3:54 PM by saraswati.santanu

    How signal as a state to a task?

      Hi

      I have a state that has an event that is consumed until the flag reaches a certain value. When you reach this value need to turn to another task. As I do this, some examples in java

      <state g="438,14,92,52" name="verificar repo">
       <on event="start">
       <timer duedate="1 minutes" repeat="10 seconds"/>
       <event-listener class="com.configuracion.eventos.VerificarReposicion">
       <field name="documento"><object expr="#{resReposicion}"/></field>
       <field name="caf"><object expr="#{txtCaf}"/></field>
       </event-listener>
       </on>
       <transition to="enviar email"/>
       </state>
      
       <mail g="562,14,107,54" name="enviar email">
       <to addresses="carlosj@audifarma.com.co"/>
       <subject>Prueba</subject>
       <text>Prueba</text>
       <transition to="fin_1"/>
       </mail>
      


      As would be the method "notify" in class "com.configuracion.eventos.VerificarReposicion" to pass the signal....

      Thanks

        • 1. Re: How signal as a state to a task?

          Help me, please with signal in process

          • 2. Re: How signal as a state to a task?
            kukeltje

            I think the reason no-one responded is because your post is vague. The 'notify' you refer to is nowhere to be found, you probably want the timer to take a transition but the transition to take is nowhere to be found.... etc... So I suggest looking at jBPM testcase (in the source) or the examples and look how things are done there. Then if you have more information, please get back to us.

            • 3. Re: How signal as a state to a task?

              Sorry, I think it made me understand. I do not speak English

              I have the notify method, and I want to enforce the transition "send email", when the response variable equals "N"

              As I pass the signal to the next task???........... when he comes to the response variable "N", run the following task

              public void notify(EventListenerExecution execution) throws Exception {
               String response = execution.getVariable("response")+"";
               if (response.equals(null)) {
               response = new String();
               execution.setVariable("response", response);
               }
               ReposicionDao reposicion = new ReposicionDao();
               response = reposicion.verificarCarguePorReposicion(documento, caf);
               execution.setVariable("response", response);
               if(execution.getVariable("response").toString().equals("N")){
              
               ..................
               //SHOULD I PUT THAT CODE
              
               }
               }
              


              Thanks, excuse for my English

              • 4. Re: How signal as a state to a task?
                saraswati.santanu

                What I understood is if the value of the response variable is "N" then you want to move to mail node, else stay at the state node.

                You can use a decision node after the state node. In the decision node you evaluate response variable value - if it is "N" then go to the mail node, if it is anything else go back to the state node again.