return adapter;
}
public static void main(String[] args) throws Exception{
Activity act;
ComplexActivity cAct1, cAct2;
Role role1 = new Role("Role1");
Role role2 = new Role("Role2");
Role role3 = new Role("Role3");
ProcessDefinition def = new ProcessDefinition();{
act = new HumanActivity();
act.setName("report trouble");
((HumanActivity) act).setRole(role1);
def.addChildActivity(act);
act = new HumanActivity();
act.setName("set the right person");
((HumanActivity) act).setRole(role2);
def.addChildActivity(act);
cAct1 = new SwitchActivity();
cAct1.setName("switch1");
def.addChildActivity(cAct1);{
cAct2 = new SequenceActivity();
cAct1.addChildActivity(cAct2);{
act = new HumanActivity();
act.setName("Draft with resolution");
((HumanActivity) act).setRole(role3);
cAct2.addChildActivity(act);
act = new SQLActivity();
act.setName("Database");
cAct2.addChildActivity(act);
}
cAct2 = new LoopActivity();
cAct1.addChildActivity(cAct2);{
act = new HumanActivity();
act.setName("Suggestion");
((HumanActivity) act).setRole(role3);
cAct2.addChildActivity(act);
act = new HumanActivity();
act.setName("examine");
((HumanActivity) act).setRole(role2);
cAct2.addChildActivity(act);
}
}
}