step = join;
}
else if (sElement.equals("Assignment"))
{
Flow workflow = activity.getFlow();
Assignment assignment = new Assignment(sStepName);
assignment.setActivity(activity);
assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
m_metadata.getGlobalEnvironment()));
assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
true, workflow.getPosMap(), assignment.getFactory(),
m_metadata.getGlobalEnvironment()));
boolean bTarget = loadTarget(element, assignment, Boolean.TRUE, null, false);
activity.addStep(assignment);
if (isWorkflowHandler(element))
{
AutoCompletion unassignment = new AutoCompletion(assignment);
loadWorkflowHandler(element, unassignment, workflow);
step = unassignment;
}
else
{
step = new ManualCompletion(assignment);
}
nextElement = XMLUtil.findFirstElement(element.getNextSibling());
if (nextElement != null)
{
if (nextElement.getNodeName().equals("UIAction"))
{
loadTarget(element, assignment, Boolean.TRUE, null, bTarget);
}
else
{
nextElement = null;
}
}
assignment.setNext(step);
}
else if (sElement.equals("Semaphore"))
{
step = loadSemaphore(element, sStepName, activity, m_machine, new ActivityLoader()
{
public void loadActivity(Element element, Activity activity)
{
XMLMetadataLoader.this.loadActivity(element.getFirstChild(), activity);
}
});
}
else if (sElement.equals("Goto"))
{
step = new Goto();
step.setActivity(activity);
}
else if (sElement.equals("Queue"))
{
final Flow workflow = activity.getFlow();
Assignment assignment = new Assignment(sStepName);
assignment.setActivity(activity);
assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
m_metadata.getGlobalEnvironment()));
assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
true, workflow.getPosMap(), assignment.getFactory(),
m_metadata.getGlobalEnvironment()));
activity.addStep(assignment);
step = loadQueue(element, assignment);
}