Package org.huihoo.workflow.impl.xpdl

Source Code of org.huihoo.workflow.impl.xpdl.WorkflowApplicationImpl

//----------------------------BEGIN LICENSE----------------------------
/*
* Willow : the Open Source WorkFlow Project
* Distributable under GNU LGPL license by gun.org
*
* Copyright (C) 2004-2010 huihoo.org
* Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com>
*
* ====================================================================
* Project Homepage : http://www.huihoo.org/willow
* Source Forge     : http://sourceforge.net/projects/huihoo
* Mailing list     : willow@lists.sourceforge.net
*/
//----------------------------END  LICENSE-----------------------------
package org.huihoo.workflow.impl.xpdl;
import java.util.ArrayList;
import java.util.List;

import org.huihoo.workflow.ComplexComponentObject;
import org.huihoo.workflow.xpdl.ExtendedAttribute;
import org.huihoo.workflow.xpdl.WorkflowApplication;
import org.huihoo.workflow.xpdl.XPDLGlobals;
import org.huihoo.workflow.xpdl.parameter.FormalParameter;
/**
* @author zosatapo
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class WorkflowApplicationImpl extends ComplexComponentObject implements WorkflowApplication
  private List parameters = new ArrayList();
  private String qualifiedClassName;
  public WorkflowApplicationImpl()
  {
    super();
  }
  public WorkflowApplicationImpl(String uuid_, String name_)
  {
    super(uuid_, name_);
  }
  public WorkflowApplicationImpl(String uuid_, String name_, String description_)
  {
    super(uuid_, name_,description_);
  }
 
  public List getFormalParameters()
  {
    return (this.parameters);
  }
 
  public FormalParameter findFormalParameter(int index)
  {
    int sizeParams=parameters.size();
    FormalParameter result=null;
   
    for(int i=0;i<sizeParams;++i)
    {
      result=(FormalParameter)parameters.get(i);
     
      if(result.getIndex()==index)
      {
        return result;
      }
     
    }
    return result;
  }
 
  public FormalParameter findFormalParameter(String id)
  {
    int sizeParams=parameters.size();
    FormalParameter result=null;
   
    for(int i=0;i<sizeParams;++i)
    {
      result=(FormalParameter)parameters.get(i);
     
      if(result.getUUID().equals(id))
      {
        return result;
      }
     
    }
    return result;
  }
  public FormalParameter removeFormalParameter(FormalParameter fp)
  {
    if(parameters.remove(fp))
    {
      return fp;
    }
   
    return null;
  }
  
  public void addFormalParameter(FormalParameter formalParameter)
  {
    this.parameters.add(formalParameter);
  }

  public String getQualifiedClassName()
  {
    ExtendedAttribute attribute =
      (ExtendedAttribute) getExtendedAttributes().get(
        XPDLGlobals.APPLICATION_QUALIFIED_CLASS_NAME);
    if (attribute != null)
    {
      return attribute.getValue();
    }
    return qualifiedClassName;
  }
 
  public void  setQualifiedClassName(String className)
  {
    qualifiedClassName=className;
  }
  public String getInfo()
  {
    if(getName()!=null)
    {
      return "activity_name=" + getName();
    }
    else
    {
      return "activity_id=" + uuid;
    }
  }
 
  public String getTagName()
  {
    return "Application";
  }
}
TOP

Related Classes of org.huihoo.workflow.impl.xpdl.WorkflowApplicationImpl

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.