3 Replies Latest reply on Jul 29, 2014 3:30 PM by mystery blinky

    jBPM 6.0.1 mapping problem

    kondzik Newbie

      hi

      i am working with human tasks.

      i want send object or variables to jBPM 6 with start process and store them as object from data modeler in KIE workbench.

      How to do this?

       

      i am sending parameters to jBPM with rest: http://admin:admin@localhost:8080/jbpm-console/rest/runtime/xxx.epg:ccc:1.0/process/ccc.Proces2/start?map_state=tttt

      it is ok,

      now i want save my parameter "state" as Object.state.

      I have made Object in Data Modeler in kie workbench. Object has name, value,state.

       

      i can get my variable from post and show in human task forms, i can edit it and exchange between human tasks but still i cant save it as Object element.

       

      is it true that payloads in post request is skipped? i was trying with json object and nothing. Problem still open: http://stackoverflow.com/questions/22262459/jbpm-rest-calls-with-json

       

      How looks like object in url after call this code?:

         Map<String,Object> params = new HashMap<>();

        
      Person p = new Person();
        p
      .setName("Ayushya K Devmurari");
        p
      .setUniqueId("A007");
        p
      .setLoanAmmount(5_00_000.00);
        p
      .setIncome(2_40_000.00);

        params
      .put("Applicant1", p);

        kSession
      .startProcess("com.discusit.loanapplication", params);  

        • 1. Re: jBPM 6.0.1 mapping problem
          Maciej Swiderski Master

          complex object as process variables are only available with Java Remote API that utilizes commands and the execute method. If you don't want to use Java Remote API then you might want to try to simulate what it does by producing valid xml for the command and then use regular REST URL. Though I would recommend to stick to Java Remote API for this.

           

          As an alternative you might want to enhance your process to build up your object based on simple types via script task or some custom activities.

           

          HTH

          • 2. Re: jBPM 6.0.1 mapping problem
            kondzik Newbie

            yes, it's true. I confirm this information.

            It really works.

            I made map x,

            then I created an object of the same model which i have in kie workbench data modeller.

            After that I put on the map x object y named such that the variables declared in kie wokrbench.

            At the end i started process with params ; process name or id(i dont rememeber) and map x.

             

            Now i can work with objects.

             

            A big thanks to Maciej Swiderski

            • 3. Re: jBPM 6.0.1 mapping problem
              mystery blinky Newbie

              Can you please be a bit more clear about what you did to make this work?

               

              > then I created an object of the same model which i have in kie workbench data modeller.

               

              By this i think you mean you instantiated an object based on the class of the model you made in the workbench using the "Data Modeler" -- correct?

               

              > After that I put on the map x object y named such that the variables declared in kie wokrbench.

               

              I don't understand what you mean by "named such that the variables declared in kie workbench". Let's say the Data Model you created in the workbench is called "Person", is "Person" what you used as the key in your map? If not, what did you use as the key?

               

              No matter what i've tried, I still end up with "null" as the value of the process variable in my process instance.

               

              Can you give a concrete example of how you solved this?

               

              thanks