* (non-Javadoc)
*
* @see tw.com.iisi.cap.flow.Operation#execute()
*/
public void execute(OpStepContext ctx, IRequest params, IHandler handler) {
OperationStep step = getStartStep();
long startOperation = System.currentTimeMillis();
try {
while (step != null) {
OpStepContext result = ctx;
try {
long startStep = System.currentTimeMillis();
result = step.execute(result, params, handler);
logger.debug("{} cost : {} ms", step.getName(),
(System.currentTimeMillis() - startStep));
} catch (CapException e) {
result = step.handleException(result, e);
throw e;
}
if (result != null) {
if (OperationStep.NEXT.equals(result.getGoToStep())) {
step = getNextStep(step.getName());
} else if (OperationStep.RETURN.equals(result.getGoToStep())
|| OperationStep.ERROR.equals(result.getGoToStep())) {
step = null;
} else {
step = getStep(result.getGoToStep());