}
else
{
// This workflow is not the rootDSE workflow. Try to insert it in
// the workflow topology.
WorkflowTopologyNode workflowNode =
new WorkflowTopologyNode(workflow, preWorkflowElements,
postWorkflowElements);
// Register the workflow node with the network group. If the
// workflow ID is already existing then an exception is raised.
registerWorkflowNode(workflowNode);
// Now add the workflow in the workflow topology...
for (WorkflowTopologyNode curNode : registeredWorkflowNodes
.values())
{
// Try to insert the new workflow under an existing workflow...
if (curNode.insertSubordinate(workflowNode))
{
// new workflow has been inserted in the topology
continue;
}
// ... or try to insert the existing workflow below the new
// workflow
if (workflowNode.insertSubordinate(curNode))
{
// new workflow has been inserted in the topology
continue;
}
}