Step 2 - Creating the Asynchronous Process
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Step 2 - Creating the Asynchronous Process

If the loan approval process involves another process, in which the response takes too long to respond, you can use an Asynchronous Process to implement it. This allows you to continue the rest of the process flow without waiting for the response.

Let's get started! Follow the instructions in the below sections to complete the BPEL Workflow you created in Step1 with the As ynchronous Process as shown below.

If you did not follow Step 1 - Creating the Synchronous Processes yet, you can import the pre-packaged project of it and continue by following the steps in this Tutorial. Follow the steps below to import it to WSO2 Integration Studio.

  1. Open the WSO2 Integration Studio, click File, and click Import

  2. Expand the WSO2 category and select Existing WSO2 Projects into workspace, click Next and upload the pre-packaged project

Adding the Sequence element

  1. Open the WSO2 EI Integration Studio.

  2. Right click on the replyOutput element, click Insert Before and click Sequence.


 

Configuring the InvokeLoanService element

  1. Right click on the Sequence element, click Add and click Invoke.


  2. Click on the Invoke element you added inside the Sequence element, and enter  InvokeLoanService as the Name in the Description section of the Properties tab.


Adding the Partner Link

  1. Click on the InvokeLoanService  element, click the drop-down arrow of  Partner Link  and select  Create Global Partner Link.  in the  Details  section of the  Properties  tab.


  2. Enter LoanPL as the  Partner Link Name  and click  OK .


  3. Select  From Project  as the type of the Partner Link, select  LoanServicePT  in the  Matches  field and click  OK .


  4. Click OK in the message, which pops up next to set the prefix of the namespace.


Adding the Partner Role

  1. Select the LoanServiceRole partner role and click OK .

Adding the Operation

  1. Once the partner link is created, double click on the getLoanOffer operation from the Quick Pick view. This automatically updates the input request.

Configuring the ReceiveLoanOffer element

  1. Right click on the Sequence element, click Add and click Receive.

  2. Click on the Receive element you added inside the Sequence element, and enter ReceiveLoanOffer as the Name in the Description section of the Properties tab.

     

Adding the Partner Role

You need to use the OnLoanOffer operation of the LoanServiceCallBackPortType partner role for the  ReceiveLoanOffer element. Therefore, follow the steps below to use the LoanPL partner link you created before for this  ReceiveLoanOffer element as well.

  1. In the Outline tab of WSO2 Integration Studio, click LoanPL under Partner Links.


  2. Select the following values in the Details section of the Properties tab.

    • My Role: LoanServiceClientRole

    • Partner Role:  LoanServiceRole

    • My Operations: onLoanOffer

    • Partner Operations: getLoanOffer

Adding the Partner Link

  1. Click on the ReceiveLoanOffer element, click the drop-down arrow of  Partner Link and select  LoanPL in the  Details section of the Properties  tab.


Adding the Operation

  1. Keep your cursor on the  Operation  field and double-click on onLoanOffer.



    This creates the LoanPLRequest1  variable.

  2. Double click on the  LoanPLRequest1  variable and rename it to  LoanPLResponse.

Configuring the Assign2 element

Right click on the Sequence element, click Insert Before and click Assign, to add the Assign2 element.

Mapping the variables

You need to map the required data received from the BankLoanProcessRequest message to the LoanPLRequest similar to the mapping you did before. Follow the steps below to do this.

  1. Click on the Assign2 element and click New in the Details section of the Properties tab.

  2. In the From box, expand the input :  BankLoanProcessRequestMessage and select payload : LoanRequest
     


  3. In the   To   box, expand the  LoanPLRequest :     getLoanOfferRequest and select part : LoanRequest.  


     

  4. Press Ctrl+S to save your artifacts.

  5. Click Yes in the message, which pops up to initialize the variables.   

     

  6. Follow the steps below to match the other variables.

    1. Click New and select input: BankLoanProcessRequestMessage → payload : LoanRequest → CustomerInfo : CustomerInfo Type in the From  box and select LoanPLRequest :     getLoanOfferRequest → part :   LoanRequest → CustomerInfo : CustomerInfo Type  in the To  box.

       

    2. Press Ctrl+S to save the artifacts.

    3. Click New and select input: BankLoanProcessRequestMessage → payload : LoanRequest → CustomerInfo : CustomerInfo Type → Name : string in the From  box and select LoanPLRequest :     getLoanOfferRequest → part :   LoanRequest → CustomerInfo : CustomerInfo Type → Name : string   in the To  box.


       

    4. Press Ctrl+S to save the artifacts.

    5. Click New and select input: BankLoanProcessRequestMessage → payload : LoanRequest → CustomerInfo : CustomerInfo Type → Email : string in the From  box and select LoanPLRequest :     getLoanOfferRequest → part :   LoanRequest → CustomerInfo : CustomerInfo Type → Email : string   in the To  box.
       


    6. Press Ctrl+S to save the artifacts.

    7. Click New and select input: BankLoanProcessRequestMessage → payload : LoanRequest → CustomerInfo : CustomerInfo Type → CustomerID : CustomerIDType in the From  box and select LoanPLRequest :     getLoanOfferRequest → part :   LoanRequest → CustomerInfo : CustomerInfo Type → CustomerID : CustomerIDType   in the To  box.
       


    8. Press Ctrl+S to save the artifacts.

    9. Click New and select input: BankLoanProcessRequestMessage → payload : LoanRequest → CustomerInfo : CustomerInfo Type → CreditRating : int in the From  box and select LoanPLRequest :     getLoanOfferRequest → part :   LoanRequest → CustomerInfo : CustomerInfo Type → CreditRating : int   in the To  box.


    10. Press Ctrl+S to save the artifacts.

Configuring the Assign3 element

Follow the steps below to assign the values of the LoanPLResponse to the final output variable of the BPEL process.

  1. Right click on the Sequence element, click Add and click Assign.  

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.