Package com.microworkflow.process

Source Code of com.microworkflow.process.Iterative

/*
*   
*  Copyright (c) 2003 Dragos Manolescu (dam@micro-workflow.com)
*
*  See the LICENSE file for licensing information.
*/
package com.microworkflow.process;

import com.microworkflow.execution.Continuation;
import com.microworkflow.execution.IterativeContinuation;
import com.microworkflow.execution.Performer;

/**
* @author dam
*
* This activity node obtains the components of a domain object (e.g., a premium) and
* then executes its body on each component (e.g., premium charges or credits).
*/
public class Iterative extends Activity {
  protected String targetKey;
  protected String iterationTargetKey;
  protected Performer performer;
  protected Activity body;
 
  public Iterative(String targetKey,Performer performer,String iterationTargetKey,Activity body) {
    this.targetKey=targetKey;
    this.iterationTargetKey=iterationTargetKey;
    this.performer=performer;
    this.body=body;
  }

  public Continuation continuationWith(Continuation continuation) {
    IterativeContinuation k=continuation.makeIterativeContinuation(this);
    k.setTargetKey(targetKey);
    k.setPerformer(performer);
    k.setIterationTargetKey(iterationTargetKey);
    k.resetState();
    return k;
  }

  public void computeStateFor(Continuation k) {
    ((IterativeContinuation)k).setBody(body.continuationWith(k));   
  }

}
TOP

Related Classes of com.microworkflow.process.Iterative

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.