Gathering a BPEL process's in and out parameters

This recipe will explain the ways of getting input and output parameters about a BPEL process. The information gathered is very important if we want to call the BPEL process from Java applications.

How to do it…

We are deploying the BPEL process on the BPEL server. The business process is now ready to be executed; however, we don't have any information about the business process besides the WSDL location of the business process.

  1. In the Oracle Enterprise Manager Console, we select the BPEL process from the tree, and click on the following icon:
    How to do it…
  2. We receive information about the business process endpoint URI and a location of the business process WSDL as shown in the following screenshot:
    How to do it…
  3. By entering the WSDL address into the web browser, we receive a description of the BPEL process interface. In this definition, we check for the input and output messages as follows:
    <wsdl: message name = "HelloWorldProcessRequestMessage">
      <wsdl: part name = "payload" element = "client:process"/>
    </wsdl: message>
    <wsdl: message name = "HelloWorldProcessResponseMessage">
      <wsdl: part name = "payload" element = "client: processResponse"/>
    </wsdl: message>
    <wsdl: portType name = "HelloWorldProcess">
      <wsdl: operation name = "process">
      <wsdl: input message = "client: HelloWorldProcessRequestMessage"/>
      <wsdl: output message = "client:HelloWorldProcessResponseMessage"/>
      </wsdl:operation>
    </wsdl:portType>
  4. The most interesting part of WSDL is the <wsdl:operation> element, which indicates the entry point, the functionality, and the input and output messages of the BPEL process. We see that the input and output parameters both have a defined message in the client namespace, which is defined as the XSD schema. We can find its location in WSDL under the <import> tag. We search for the client: process input parameter in the XSD schema:
    <element name="process">
      <complexType>
        <sequence>
          <element name="input" type="string"/>
        </sequence>
      </complexType>
    </element>
  5. As we can see, the input parameter takes the string variable with the name input. Similarly, we explore the output parameter client: processResponse in the XSD schema as follows:
    <element name="processResponse">
      <complexType>
        <sequence>
          <element name="result" type="string"/>
        </sequence>
      </complexType>
    </element>
  6. The BPEL process will return the string variable named result.

How it works…

In general, there are two approaches to designing the BPEL processes. The first one is the top-down approach, where we first develop the XSD schema and WSDL files, which is also called the contract-first approach . The next one is called the bottom-up approach, where we start from the already-written Java code and generate the XSD schema and WSDL files with tools.

The recommended approach when designing the BPEL processes is to first define the XSD schema, which contains the definition of the input and output parameters. This is also the proper place to put the various complex variables used in the business process.

The schema is later used by WSDL to define the BPEL process interface via the <wsdl: portType> element. Both WSDL and the XSD schema are packed into the deployment package and deployed to the BPEL server.

Note

The definition of the input and output parameters in the XSD schema is not mandatory. We can easily define them in WSDL of the BPEL process. However, we lose some of the readability of the WSDL document. Note that such an approach is bad practice and is not recommended, since it hinders the reusability of the XML data types and elements.

See also

  • To learn about the deployment of a BPEL process, refer to the previous recipe, Deploying a BPEL process
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset