Forum Stats

  • 3,875,482 Users
  • 2,266,929 Discussions
  • 7,912,229 Comments

Discussions

Load datacontrol data on taskflow method call

abdiel
abdiel Member Posts: 33
edited Apr 25, 2018 11:42AM in JDeveloper and ADF

I'm using Jdeveloper 12.2.1.3 and ADF as UI for Oracle BPM.

The use case is that I need to show read only data in a region view, as a result of a SOAP web service call. The web service operation call need an String id as a parameter, passed to the region as a parameter, and saved in a manage bean. After the web service call, I must set the binding layer with values, or maybe call a loadData(String id) method in the datacontrol used in the view.

The question is where to execute the web service call?, since in the constructor of the manage bean the parameters passed to the region are still null, and if I use a default activity in the taskflow with a method call, the parameter value has it's value, but there is no access to the binding layer since the view is not loaded yet. Is there any way of load the datacontrol data without using the binding layer from a taskflow method call? or is there a better approach.

Best Regards

Tagged:

Best Answer

  • SanjeevChauhan
    SanjeevChauhan Member Posts: 1,554 Gold Trophy
    edited Apr 25, 2018 12:56AM Answer ✓

    You can use default activity for this. Default activity will execute webservice and set output in datacontrol. Page following next will be showing data from datacontrol. Binding pointing to datacontrol will get created when you drag and drop.

    You can consume webservices two ways

    1. Creating a proxy: I prefer this way as it gives more handle. You can create a webservice proxy. You will get all java classes to execute webservice. One of sample class is a client class, where it shows how you can invoke webservice. You can either use same class or create a new POJO class as a client. This class should have a method to invoke webservice, it can take string as input. Now output of webservice can be stored as instance variables. Something like this

    public class MyClientClass {

          private Employee employee;

         

          public void invokeEmployeeService(String empId){

                  //Invoke your service here

                  //Store output of service in employee instance variable

                  this.employee = myservice.getEmployee(empId);

           }

         public Employee getEmployee(){

                   return employee;

        }

    }

    Now expose above class as datacontrol.

    Now directly drag and drop method from datacontrol on your task-flow as default activity. Pass it empId

    Now on page Directly drag and drop employee from drag and drop. You will see that bindings are created.

    Effectively you are calling a webservice and storing its output in datacontrol-binding and showing that on Page.

    2. Creating a datacontrol: You can adopt this approach as well. In this you can directly created datacontrol for webservice and you will get above methods created in datacontrol. Now drag and drop method as default activity on flow and then drag and drop data on page.

    Thanks

    Sanjeev.

Answers

  • SanjeevChauhan
    SanjeevChauhan Member Posts: 1,554 Gold Trophy
    edited Apr 25, 2018 12:56AM Answer ✓

    You can use default activity for this. Default activity will execute webservice and set output in datacontrol. Page following next will be showing data from datacontrol. Binding pointing to datacontrol will get created when you drag and drop.

    You can consume webservices two ways

    1. Creating a proxy: I prefer this way as it gives more handle. You can create a webservice proxy. You will get all java classes to execute webservice. One of sample class is a client class, where it shows how you can invoke webservice. You can either use same class or create a new POJO class as a client. This class should have a method to invoke webservice, it can take string as input. Now output of webservice can be stored as instance variables. Something like this

    public class MyClientClass {

          private Employee employee;

         

          public void invokeEmployeeService(String empId){

                  //Invoke your service here

                  //Store output of service in employee instance variable

                  this.employee = myservice.getEmployee(empId);

           }

         public Employee getEmployee(){

                   return employee;

        }

    }

    Now expose above class as datacontrol.

    Now directly drag and drop method from datacontrol on your task-flow as default activity. Pass it empId

    Now on page Directly drag and drop employee from drag and drop. You will see that bindings are created.

    Effectively you are calling a webservice and storing its output in datacontrol-binding and showing that on Page.

    2. Creating a datacontrol: You can adopt this approach as well. In this you can directly created datacontrol for webservice and you will get above methods created in datacontrol. Now drag and drop method as default activity on flow and then drag and drop data on page.

    Thanks

    Sanjeev.

This discussion has been closed.