1 Reply Latest reply on Jan 27, 2014 2:38 AM by jocelyn.duc

    How to process message start parameters?

    jocelyn.duc

      Hello,

       

      I am trying to get working a process starting with a Message Event.

       

      public void testImplicit() {
            KieSession ksession = createKnowledgeSession("message.bpmn2");
             
            Map<String, String> m = new HashMap<String, String>();
            m.put("name", "myName");
            m.put("request", "myRequest");
             
            ksession.signalEvent("Message-StartProcessMessage", m);
      }
      
      

       

      With this code, my process is starting. The next node is a script task which is printing the given parameters in the console

       

      System.out.println("x: " + x);
      
      

       

      The process:

      • Variables: x

       

      The message-start node:

      • Output: Result
      • OutputAssociations: Result->x

       

      Currently, the script node is printing

      x: Result
      
      

       

      I am expecting a HashMap but Result seems to be a String and I am unable to typecast it, so i can't get the name and the request. I am working on jBPM 6.0.0

       

      Thank you for your help

       

      Jocelyn

        • 1. Re: Parameters typecasting?
          jocelyn.duc

          The jBPM 5.4 examples contais a jUnit test which do the same, but with a single String parameter... But unable to display it...

           

          x:
          

           

          So what is wrong? Map/Hashmap is passed as parameter in signalEvent() function, output options are set, and then?