// Initialize the digester
Digester digester = new Digester();
configDigester(digester);
//-----------------------Package
digester.addObjectCreate("Package", "org.huihoo.workflow.impl.xpdl.WorkflowPackageImpl");
digester.addRule("Package", new SetAliasPropertyRule("UUID", "Id"));
digester.addRule("Package", new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new PackageRuleSet("Package/"));
// -----------------------PackageHeader
digester.addRuleSet(new PackageHeaderRuleSet("Package/PackageHeader/"));
// -----------------------DataField
// digester.addRule("Package/DataFields/DataField",new SetAliasPropertyRule("isArray","IsArray"));
digester.addRule("Package/DataFields/DataField", new SetAliasPropertyRule("UUID", "Id"));
digester.addRule("Package/DataFields/DataField", new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new DataFieldRuleSet("Package/DataFields/DataField/"));
// -----------------------WorkflowProcess
digester.addRule("Package/WorkflowProcesses/WorkflowProcess", new SetAliasPropertyRule("UUID", "Id"));
digester.addRule("Package/WorkflowProcesses/WorkflowProcess", new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new ProcessRuleSet("Package/WorkflowProcesses/WorkflowProcess/"));
// -----------------------ProcessHeader
digester.addSetProperties("Package/WorkflowProcesses/WorkflowProcess/ProcessHeader");
digester.addRuleSet(new ProcessHeaderRuleSet("Package/WorkflowProcesses/WorkflowProcess/ProcessHeader/"));
// -----------------------WorkflowActivity
// We need use SetTransitionActivityRule,so we must put these here
digester.addRule(
"Package/WorkflowProcesses/WorkflowProcess/Activities/Activity",
new SetAliasPropertyRule("UUID", "Id"));
digester.addRule(
"Package/WorkflowProcesses/WorkflowProcess/Activities/Activity",
new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new ActivityRuleSet("Package/WorkflowProcesses/WorkflowProcess/Activities/Activity/"));
// -----------------------WorkflowTransition
digester.addRule(
"Package/WorkflowProcesses/WorkflowProcess/Transitions/Transition",
new SetAliasPropertyRule("UUID", "Id"));
digester.addRule(
"Package/WorkflowProcesses/WorkflowProcess/Transitions/Transition",
new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new TransitionRuleSet("Package/WorkflowProcesses/WorkflowProcess/Transitions/Transition/"));
// -----------------------WorkflowApplication
digester.addRule("Package/Applications/Application", new SetAliasPropertyRule("UUID", "Id"));
digester.addRule("Package/Applications/Application", new SetAliasPropertyRule("name", "Name"));
digester.addRuleSet(new ApplicationRuleSet("Package/Applications/Application/"));
return (digester);
}