// Path: core/src/main/java/com/github/ehe/simpleorchestrator/Task.java
// public interface Task<P extends Context> {
//     /**
//      * @param context <code>context</code> interface that this Task is working on
//      * @throws OrchestratorException if there is an issue
//      */
//     void execute(P context) throws OrchestratorException;
// }
// 
// Path: core/src/main/java/com/github/ehe/simpleorchestrator/exception/OrchestratorException.java
// public class OrchestratorException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int errorCode = 0;
// 
//     public OrchestratorException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// 
//     public OrchestratorException(String msg, int errorCode) {
//         super(msg);
//         this.errorCode = errorCode;
//     }
// 
//     public OrchestratorException(String msg, int errorCode, Throwable cause) {
//         super(msg, cause);
//         this.errorCode = errorCode;
//     }
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// }
// 
// Path: samples/src/main/java/com/github/ehe/simpleorchestrator/sample/context/LoanContext.java
// public interface LoanContext extends HistoryContext<String> {
//     LoanApplication getApplication();
//     int getCreditScore();
//     int getRiskScore();
//     void setLoanApproveStatus(boolean isApproved);
// }
// 
// Path: samples/src/main/java/com/github/ehe/simpleorchestrator/sample/entity/LoanApplication.java
// public class LoanApplication {
// 
//     @NotNull
//     @Valid
//     private Person person;
// 
//     @Valid
//     private Address address;
// 
//     private String occupation;
// 
//     private int salary;
// 
//     private int loanAmount;
// 
//     public LoanApplication(Person person, Address address, String occupation, int salary, int loadAmount) {
//         this.person = person;
//         this.address = address;
//         this.occupation = occupation;
//         this.salary = salary;
//         this.loanAmount = loadAmount;
//     }
// 
//     public LoanApplication() {
//     }
// 
//     public Person getPerson() {
//         return person;
//     }
// 
//     public void setPerson(Person person) {
//         this.person = person;
//     }
// 
//     public Address getAddress() {
//         return address;
//     }
// 
//     public void setAddress(Address address) {
//         this.address = address;
//     }
// 
//     public String getOccupation() {
//         return occupation;
//     }
// 
//     public void setOccupation(String occupation) {
//         this.occupation = occupation;
//     }
// 
//     public int getSalary() {
//         return salary;
//     }
// 
//     public void setSalary(int salary) {
//         this.salary = salary;
//     }
// 
//     public int getLoanAmount() {
//         return loanAmount;
//     }
// 
//     public void setLoanAmount(int loanAmount) {
//         this.loanAmount = loanAmount;
//     }
// 
// }


import com.github.ehe.simpleorchestrator.Task;
import com.github.ehe.simpleorchestrator.exception.OrchestratorException;
import com.github.ehe.simpleorchestrator.sample.context.LoanContext;
import com.github.ehe.simpleorchestrator.sample.entity.LoanApplication;
import org.springframework.stereotype.Component;
/*
 *
 *  * Copyright (c) 2017. Eric He (eriche39@gmail.com)
 *  *
 *  * This software is licensed under
 *  *
 *  * MIT license
 *  *
 *
 */

package com.github.ehe.simpleorchestrator.sample.task;


@Component
public class LoanTask implements Task<LoanContext> {
    @Override
// Path: core/src/main/java/com/github/ehe/simpleorchestrator/Task.java
// public interface Task<P extends Context> {
//     /**
//      * @param context <code>context</code> interface that this Task is working on
//      * @throws OrchestratorException if there is an issue
//      */
//     void execute(P context) throws OrchestratorException;
// }
// 
// Path: core/src/main/java/com/github/ehe/simpleorchestrator/exception/OrchestratorException.java
// public class OrchestratorException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int errorCode = 0;
// 
//     public OrchestratorException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// 
//     public OrchestratorException(String msg, int errorCode) {
//         super(msg);
//         this.errorCode = errorCode;
//     }
// 
//     public OrchestratorException(String msg, int errorCode, Throwable cause) {
//         super(msg, cause);
//         this.errorCode = errorCode;
//     }
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// }
// 
// Path: samples/src/main/java/com/github/ehe/simpleorchestrator/sample/context/LoanContext.java
// public interface LoanContext extends HistoryContext<String> {
//     LoanApplication getApplication();
//     int getCreditScore();
//     int getRiskScore();
//     void setLoanApproveStatus(boolean isApproved);
// }
// 
// Path: samples/src/main/java/com/github/ehe/simpleorchestrator/sample/entity/LoanApplication.java
// public class LoanApplication {
// 
//     @NotNull
//     @Valid
//     private Person person;
// 
//     @Valid
//     private Address address;
// 
//     private String occupation;
// 
//     private int salary;
// 
//     private int loanAmount;
// 
//     public LoanApplication(Person person, Address address, String occupation, int salary, int loadAmount) {
//         this.person = person;
//         this.address = address;
//         this.occupation = occupation;
//         this.salary = salary;
//         this.loanAmount = loadAmount;
//     }
// 
//     public LoanApplication() {
//     }
// 
//     public Person getPerson() {
//         return person;
//     }
// 
//     public void setPerson(Person person) {
//         this.person = person;
//     }
// 
//     public Address getAddress() {
//         return address;
//     }
// 
//     public void setAddress(Address address) {
//         this.address = address;
//     }
// 
//     public String getOccupation() {
//         return occupation;
//     }
// 
//     public void setOccupation(String occupation) {
//         this.occupation = occupation;
//     }
// 
//     public int getSalary() {
//         return salary;
//     }
// 
//     public void setSalary(int salary) {
//         this.salary = salary;
//     }
// 
//     public int getLoanAmount() {
//         return loanAmount;
//     }
// 
//     public void setLoanAmount(int loanAmount) {
//         this.loanAmount = loanAmount;
//     }
// 
// }


// Path: samples/src/main/java/com/github/ehe/simpleorchestrator/sample/task/LoanTask.java
import com.github.ehe.simpleorchestrator.Task;
import com.github.ehe.simpleorchestrator.exception.OrchestratorException;
import com.github.ehe.simpleorchestrator.sample.context.LoanContext;
import com.github.ehe.simpleorchestrator.sample.entity.LoanApplication;
import org.springframework.stereotype.Component;

/*
 *
 *  * Copyright (c) 2017. Eric He (eriche39@gmail.com)
 *  *
 *  * This software is licensed under
 *  *
 *  * MIT license
 *  *
 *
 */

package com.github.ehe.simpleorchestrator.sample.task;


@Component
public class LoanTask implements Task<LoanContext> {
    @Override
    public void execute(LoanContext context) throws OrchestratorException {