3 Replies Latest reply on Jan 14, 2015 2:03 AM by sanjay05222

    REST

    rogerparkinson

      Using kie-wb 6.1.0.Final I'm designing a jbpm process, just a test one at this point. It seems to work okay in that I can run it and see it stepping from one human task to another etc, except for one point where I call a REST service.

      I already built the same process using the Eclipse plugin and it runs just fine there, including the REST task, so I think I know roughly what the problem is, just not how to solve it.

       

      In Eclipse I defined an entry in properties: Result Mapping which took the results from the task variables and put them into process variables. These were the results of the REST call (Status, Result and StatusMsg). Now in the Workbench I don't see how to do this. What I can see in the properties is the Assignments and DataInputSet which define the input parameters. and DataOutputSet which seems to be the equivalent of the Result Mapping I used in Eclipse. But in Result Mapping I gave the task variable and the process variable. DataOutputSet only allows me to define what looks like the task variable. What can I use to map these to process variables?

       

      I'm not yet sure if the REST call is working or not. I suspect not. The URL is http://www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency=#{fromCurrency}&ToCurrency=USD and I think the WB doesn't like the #{fromCurrency} which works in Eclipse. But either way I need to map those variables.

       

      Thanks for any help

        • 1. Re: REST
          dosten

          When you add a REST service using workbench, it will be populated with the appropriate input variables and assignments.  You just need to set the variable values in the Assignments dialog (set the To Value).  For the result, add a Data Output assignment: From Object = Result, Assignment Type = is mapped to, To Object = $your_process_var.

          • 2. Re: REST
            rogerparkinson

            You are right. And when you add one from Eclipse there are various fields missing.

            I conclude that the Eclipse plugin is not useful for adding rest service.

            • 3. Re: REST
              sanjay05222

              I think same goes for REST and WS services , eclipse plugin doesn't event show it in the Palette at all.  but related to that I have question for the kie bench when I show the  WS example which was check weather works fine and I can see in the assignments for the async task parameter is mapped to the usZipCode.  what we have to do if the Parameter is not a String instead it is a Pojo ? How can we map it . I have my example below and I am not able to assign the parameter which will be input for the web service operations.

               

              Check Weather Takes Operations Method a String Type .

              paratmetr.png

              My Problem

              paramter2.png

              I added the data input as Parameter and also updated to the ObjectDataType in the workItem.wid still it shows me error in mapping the Parameter to the Pojo NotifcationDTO ? any help would be highly appreciated .

              I get this error and the Data Input just vanishes

              paramter3.png

               

              Guys Please let me know if you have any suggestions

               

              thanks

              Sanjay Gautam