/*
* 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.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.factory.XPDLParserFactory;
import org.huihoo.workflow.xpdl.WorkflowPackage;
import org.huihoo.workflow.xpdl.serializer.XPDLSerializer;
import org.huihoo.workflow.impl.xpdl.parser.XPDLParserFactoryImpl;
import org.huihoo.workflow.impl.xpdl.serializer.DefaultXPDLSerializer;
/**
* @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
{
File xpdl=new File("G:\\huihoo-willow-1.1\\samples\\repository\\examples\\WEB-INF\\xpdl\\willow-xor-join.xpdl");
System.err.println(xpdl.exists()+ " "+xpdl.getAbsolutePath());
FileInputStream fis =new FileInputStream(xpdl);
XPDLParserFactory xpdlParserFactory=new XPDLParserFactoryImpl();
WorkflowPackage workflowPackage=xpdlParserFactory.newXPDLParser().parse(fis);
XPDLSerializer serializer=new DefaultXPDLSerializer();
FileWriter writer=new FileWriter(new File("G:\\huihoo-willow-1.1\\xpdl.xml"));
serializer.serialize(workflowPackage,writer);
writer.close();
}
}