Package org.huihoo.workflow.rules.util

Source Code of org.huihoo.workflow.rules.util.ConditionUtils

//----------------------------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.rules.util;

import java.io.File;

import org.huihoo.workflow.rules.config.Options;
import org.huihoo.workflow.xpdl.WorkflowCondition;
import org.huihoo.workflow.xpdl.WorkflowTransition;
import org.huihoo.workflow.xpdl.condition.ScriptCondition;
import org.huihoo.workflow.xpdl.condition.XCDATACondition;

/**
* @author reic
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class ConditionUtils
{
  public static final String getScriptFile(Options options,WorkflowTransition workflowTransition)
  {
    WorkflowCondition condition=workflowTransition.getCondition();
    if(condition!=null && condition instanceof ScriptCondition)
    {
      return options.getScriptDir()  + File.separator+ condition.getContent();
    }
    return null;
  }
 
  public static final String getScriptConent(Options options,WorkflowTransition workflowTransition)
  {
    WorkflowCondition condition=workflowTransition.getCondition();
    if(condition!=null && condition instanceof XCDATACondition)
    {
      return condition.getContent();
    }
    return null;
  }
}
TOP

Related Classes of org.huihoo.workflow.rules.util.ConditionUtils

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.