View Javadoc

1   /*
2    * $Id: PrepareLoanQuoteRequest.java 11394 2008-03-17 15:18:29Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.example.loanbroker.bpm.actions;
12  
13  import org.mule.example.loanbroker.messages.CreditProfile;
14  import org.mule.example.loanbroker.messages.CustomerQuoteRequest;
15  import org.mule.example.loanbroker.messages.LoanBrokerQuoteRequest;
16  import org.mule.transport.bpm.jbpm.actions.LoggingActionHandler;
17  
18  import org.jbpm.graph.exe.ExecutionContext;
19  
20  /**
21   * Prepares a loan request for the banks based on the original customer request and the customer's 
22   * credit profile.
23   */
24  public class PrepareLoanQuoteRequest extends LoggingActionHandler
25  {
26      @Override
27      public void execute(ExecutionContext executionContext) throws Exception
28      {
29          super.execute(executionContext);
30          LoanBrokerQuoteRequest loanRequest = new LoanBrokerQuoteRequest();
31          loanRequest.setCustomerRequest((CustomerQuoteRequest) executionContext.getVariable("customerRequest"));
32          loanRequest.setCreditProfile((CreditProfile) executionContext.getVariable("creditProfile"));
33          executionContext.setVariable("loanRequest", loanRequest);
34      }
35  }