final String PrepareGoodsActivity_ID = "Goods_Deliver_Process.PrepareGoodsActivity";
final String PaymentActivity_ID = "Goods_Deliver_Process.PaymentActivity";
InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/example_workflow.xml");
JAXP_FPDL_Parser instance = new JAXP_FPDL_Parser();
WorkflowProcess workflowProcess1 = instance.parse(in);
String tmpDir = System.getProperty("java.io.tmpdir");
File f = new File(tmpDir+"example_workflow_tmp.xml");
FileOutputStream out = new FileOutputStream(f);
JAXP_FPDL_Serializer ser = new JAXP_FPDL_Serializer();
ser.serialize(workflowProcess1, out);
out.flush();
out.close();
FileInputStream fIn= new FileInputStream(f);
WorkflowProcess result = instance.parse(fIn);
f.delete();
assertNotNull(result);
assertNotNull(result.getStartNode());
assertEquals(1, result.getTasks().size());
assertEquals(4, result.getActivities().size());
assertEquals(2, result.getSynchronizers().size());
assertEquals(1, result.getEndNodes().size());
assertEquals(8, result.getTransitions().size());
Activity paymentActivity = (Activity) result.findWFElementById(PaymentActivity_ID);
assertNotNull(paymentActivity);
assertEquals(1, paymentActivity.getTasks().size());
assertEquals(1, paymentActivity.getInlineTasks().size());
Activity prepareGoodsActivity = (Activity) result.findWFElementById(PrepareGoodsActivity_ID);
assertNotNull(prepareGoodsActivity);
assertEquals(1, prepareGoodsActivity.getTasks().size());
assertEquals(1, prepareGoodsActivity.getTaskRefs().size());
}