/*
 * Created on 2004-5-4
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.test;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import workflow.WorkflowException;
import workflow.store.factory.XPDLParserFactory;
import workflow.wfmc.xpdl.WorkflowActivity;
import workflow.wfmc.xpdl.WorkflowPackage;
import workflow.wfmc.xpdl.WorkflowProcess;

import com.zosatapo.workflow.store.factory.XPDLParserFactoryImpl;

/**
 * @author zosatapo
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class XPDLTest
{
  public static void main(String args[]) 
  throws WorkflowException, IOException
  {
    FileInputStream fis =
      new FileInputStream("G:\\project\\workflow\\samples\\willow-or-join.xpdl");
    //FileInputStream fis=new FileInputStream("D:\\project\\workflow\\samples\\sample workflow process.xpdl");
    XPDLParserFactory xpdlParserFactory=new XPDLParserFactoryImpl();
    WorkflowPackage workflowPackage=xpdlParserFactory.newXPDLParser().parse(fis);
    fis.close();
    WorkflowProcess workflowProcess=workflowPackage.getMainProcess();
    WorkflowActivity workflowActivity=workflowProcess.findWorkflowActivity("activity-2");
    List total_trans=workflowActivity.getOutTransitions();
    List true_trans=new ArrayList();
    List false_trans=new ArrayList();
    
		true_trans.add(total_trans.get(0));	
		false_trans.add(total_trans.get(1));
		
		//JoinActivityFinder.sinalOrJoinActivity(workflowActivity,true_trans,false_trans);
  }
}
