Package org.uengine.kernel

Source Code of org.uengine.kernel.ApprovalLineActivity

package org.uengine.kernel;

import java.util.Map;

import org.uengine.util.ActivityForLoop;

public class ApprovalLineActivity extends ComplexActivity {
  public final static String KEY_APPR_LINE_STATUS = "KEY_APPR_LINE_STATUS";
 
  public ApprovalLineActivity(){
    setName("");
    ApprovalActivity draftActivity = new ApprovalActivity();
    draftActivity.setName(GlobalContext.getLocalizedMessage("activitytypes.org.uengine.kernel.approvalactivity.draft.message", "Draft"));
    addChildActivity(draftActivity);
  }

  protected void executeActivity(ProcessInstance instance) throws Exception {
    super.executeActivity(instance);
   
/*    if(getCurrentStep(instance) > 1){
      fireComplete(instance);
    }
*/  }
 
  public void setApprovalLineStatus(ProcessInstance instance, String status) throws Exception{
    instance.setProperty(getTracingTag(), KEY_APPR_LINE_STATUS, status);
  }
 
  public String getApprovalLineStatus(ProcessInstance instance) throws Exception{
    return (String)instance.getProperty(getTracingTag(), KEY_APPR_LINE_STATUS);
  }
 
  ApprovalActivity draftActivity;
  public ApprovalActivity getDraftActivity(){
    if(draftActivity!=null)
      return draftActivity;
   
    ActivityForLoop findingLoop = new ActivityForLoop(){
      public void logic(Activity activity){
        if(activity instanceof ApprovalActivity){
          stop(activity);
        }
      }
    };
   
    findingLoop.run(this);   
    this.draftActivity = (ApprovalActivity)findingLoop.getReturnValue();
   
    return draftActivity;
  }
}
TOP

Related Classes of org.uengine.kernel.ApprovalLineActivity

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.