IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building BPEL processes > Defining BPEL process logic > Adding an interface or a reference to a business state machine
Modeling dynamic partner assignment with endpoint references
You can use the BPEL process editor to configure partner endpoints yourself.
You have the following two options:
- You can change the existing partner endpoint using an assign activity.
- You can save the partner endpoint to a variable.
BPEL partner links for outbound service interactions have corresponding SCA references, which are statically wired to other SCA components or Imports.
BPEL partner links may be the target of a dynamic assignment of an endpoint reference - in this case the corresponding SCA reference can be left unwired.
If the SCA reference is pre-wired to an SCA Import and the BPEL partner link is dynamically assigned an endpoint reference then:
- all binding and quality of service specifications are taken from the SCA Import
- the service endpoint address of the endpoint reference dynamically overrides any endpoint specified in the pre-wired SCA Import.
Procedure
- To assign an endpoint to a partner from within a process, proceed as follows:
- Drop an assign activity onto the canvas.
- In the properties area, click the Details tab.
- In the Assign From field, choose Endpoint Reference from the drop down list.
- Configure the fields to point to the existing endpoint reference.
- In the Assign To: field, click Partner Reference, and select the partner that you want to assign the endpoint to.
- To save an endpoint into a variable, you will first have to import a new data type for your variable, and then use an assign activity. To do this, proceed as follows:
- Create a new library called EndpointReference by clicking File > New > Library. Alternatively, you can choose an existing library and import the data types into there.
- While still in the Dependencies view, expand Predefined Resources, and enable the WS-Addressing Schema Files check box and then save and close the dependencies. This will create new business objects in your library.
- Return to the BPEL process editor, and confirm that the module that hosts the BPEL process has a dependency to the EndpointReference library created earlier. To do so, open the Dependencies entry under your module, and make sure the Library is listed.
- In the tray of the BPEL process editor, create a new variable. The endpoint information must be stored in a data object of type ServiceRefType.
- In the Description area, click Browse to set the type of your newly created variable to be ServiceRefType. Verify that the fields of that new variable are properly populated with the information of the endpoint that you'd like to call.
- Drop an assign activity onto the canvas, and click the Details tab in the properties area.
- In the From field, select the variable of type ServiceRefType from the drop down list.
- In the To: field, choose Partner Reference and select a partner.
Example
To see an example of a dynamic service binding that you can build and run yourself, go to
http://publib.boulder.ibm.com/bpcsamp/index.html, and click Process modeling techniques > Dynamic service binding.
You will need a connection to the internet to view this example.
What to do next
For more details on dynamic invocation of endpoint references see the related links.
Adding an interface or a reference to a business state machine
Related information:
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic/com.ibm.websphere.wesb620.doc/concepts/cwesb_dynamicinvocation.html
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r1mx/topic/com.ibm.websphere.bpc.612.doc/doc/bpc/cinvocation_dynamicbinding.html