A Synchronous Process is a process, which would wait until a response is received from an external party before proceeding to the next step. Following are the Synchronous Processes of this /wiki/spaces/EI6xx/pages/49615111.
...
Table of Contents | ||
---|---|---|
|
Defining the types of the request and response
Now, you need to define the type (schema) of the initial request and the final response that the BankLoanProcess BPEL process requires.
- Open WSO2 EI Tooling.
- In the Project Explorer of WSO2 EI Tooling, double click on the
BankLoanProcessArtifacts.wsdl
file to get the Design view. - Click BankLoanProcessRequest in the BankLoanProcess box .
In the General section of the Properties tab, click the Element drop down field and click Browse .
Select Enclosing Project to display the schema types including those that are listed in the
loan.xsd
file, select LoanRequest under Elements as the input of the BPEL process, and click OK.Click BankLoanProcessResponse in the BankLoanProcess box .
In the General section of the Properties tab, click the Element drop down field and click Browse .
Select Enclosing Project to display the schema types including those that are listed in the
loan.xsd
file, select LoanOffer under Elements as the output of the BPEL process, and click OK.You view the defined output as shown below.
Right click on the small connecting box of the diagram, click Generate Binding Content .
Select SOAP in the Protocol field and click Finish.
Press Ctrl+S to save your artifacts.
Configuring the receiveInput element
Follow the steps below to create the synchronous BPEL process.
- In the Project Explorer of WSO2 EI Tooling, double click on the
BankLoanProcess.bpel
file to get the Design view. - Click on the receiveInput element, which is available by default.
Adding the Partner link
Select the default client as the Partner Link in the Details section of the Properties tab.
Tip This creates the first step of the business process flow to receive the loan request from the client.
Adding the Operation
Select process as the Operation in the Details section of the Properties tab.
Double click process in the Quick Pick section to generate the input and output variables for this element.
Configuring the InvokingCustomerInfo element
Right click on the FIX_ME-Add_Business_Logic_Here element, click Insert Before, and then click Invoke.
Tip This creates the element to invoke the CustomerInfo partner service.
- Click on the Invoke element you added.
- Enter InvokingCustomerInfo as the value of the Name field in the Description section of the Properties tab.
Adding the Partner Link
Click on the InvokingCustomerInfo element, click the drop down arrow of Partner Link and select Create Global Partner Link. in the Details section of the Properties tab.
Tip This adds a partner link to invoke this external service.
Enter CustomerPL as the Partner Link Name and click OK.
- Select From Project as the type of the Partner Link, select CustomerInfo in the Matches field and click OK .
- Click OK in the message, which pops up next to set the prefix of the namespace.
Adding the Operation
- Keep your cursor on the Operation field and double-click on getCustomerSSN.
Double click getCustomerSSN in the Quick Pick section to generate the input and output variables for this element.
Tip This will auto update the input/output of the Invoke step and creates the following variables.
- Press Ctrl+S to save your artifacts.
Configuring the Assign element
You need to have the input data provided by the client from the receiveInput element to use the InvokingCustomerInfo element. Therefore, you need to add an Assign element right before the InvokingCustomerInfo element to apply this input data to the CustomerPLRequest of the InvokingCustomerInfo element .
- Right click on the InvokingCustomerInfo element, click Insert Before, and then click Assign .
Mapping the variables
Click on the Assign element and click New in the Details section of the Properties tab .
- In the From box, expand the input : BankLoanProcessRequestMessage and select CustomerInfo : CustomerInfoType.
- In the To box, expand the CustomerPLRequest : getCustomerSSNRequest and select part: CustomerInfo.
- Press Ctrl+S to save your artifacts.
- Click Yes in the message, which pops up to initialize the variables.
Follow the steps below to match the other variables.
Tip This creates variable to variable options to map each part of the
CustomerInfo
input (CustomerInfo:CustomerInfoType
) to the corresponding part ofCustomerPLRequest
(part:CustomerInfo
).- Click New and select BankLoanProcessRequestMessage → CustomerInfo : CustomerInfoType → Name : string in the From box and select CustomerPLRequest : getCustomerSSNRequest → part: CustomerInfo → Name : string in the To box.
- Press Ctrl+S to save the artifacts.
- Click New and select BankLoanProcessRequestMessage → CustomerInfo : CustomerInfoType → Email : string in the From box and select CustomerPLRequest : getCustomerSSNRequest → part: CustomerInfo → Email : string in the To box.
- Press Ctrl+S to save the artifacts.
- Click New and select BankLoanProcessRequestMessage → CustomerInfo : CustomerInfoType → CustomerID : CustomerIDType in the From box and select CustomerPLRequest : getCustomerSSNRequest → part: CustomerInfo → CustomerID : CustomerIDType in the To box.
- Press Ctrl+S to save the artifacts.
- Click New and select BankLoanProcessRequestMessage → CustomerInfo : CustomerInfoType → CreditRating : int in the From box and select CustomerPLRequest : getCustomerSSNRequest → part: CustomerInfo → CreditRating : int in the To box.
- Click New and select BankLoanProcessRequestMessage → CustomerInfo : CustomerInfoType → Name : string in the From box and select CustomerPLRequest : getCustomerSSNRequest → part: CustomerInfo → Name : string in the To box.
- Press Ctrl+S to save the artifacts.
Configuring the InvokeCreditRating element
Right click on the FIX_ME-Add_Business_Logic_Here element, click Insert Before, and then click Invoke.
- Click on the Invoke element you added.
- Enter InvokeCreditRating as the value of the Name field in the Description section of the Properties tab.
Adding the Partner Link
Click on the InvokeCreditRating element, click the drop down arrow of Partner Link and select Create Global Partner Link. in the Details section of the Properties tab.
Tip This creates a new Partner Link for the BPEL process to connect to the
CreditRatingService
.Enter CreditPL as the Partner Link Name and click OK.
Select From Project as the type of the Partner Link, select CreditRating in the Matches field and click OK.
Click OK in the message, which pops up next to set the prefix of the namesapce.
Adding the Operation
- Keep your cursor on the Operation field and double-click on getCreditRating.
Double click getCreditRating in the Quick Pick section to generate the input and output variables for this element.
Tip This will auto update the input/output of the Invoke step and creates the following variables.
- PressCtrl+S to save your artifacts.
Configuring the Assign1 element
You need to map the required data received from the CustomerInfo
service to the InvokeCreditRatingRequest
similar to the mapping you did before. Follow the steps below to do this.
- Right click on the InvokeCreditRating element, click Insert Before and click Assign, to add the Assign1 element.
- Right click on the FIX_ME-Add_Business_Logic_Here element and click Delete to remove it as it is a dummy element.
Mapping the variables
Click on the Assign1 element and click New in the Details section of the Properties tab.
- In the From box, expand the CustomerPLResponse : getCustomerSSNResponse and select part : CustomerSSN.
- In the To box, expand the CreditPLRequest : getCreditRatingRequest and select part : CustomerSSN.
- Press Ctrl+S to save your artifacts.
- Click Yes in the message, which pops up to initialize the variables.
Click on the Assign1 element and click New in the Details section of the Properties tab .
- In the From box, expand the CustomerPLResponse : getCustomerSSNResponse → part : CustomerSSN and select SSN : string.
- In the To box, expand the CreditPLRequest : getCreditRatingRequest → part : CustomerSSN and select SSN : string.
- Press Ctrl+S to save your artifacts.
Now, your BPEL artifacts will be as shown below.
...