use of com.twinsoft.convertigo.beans.core.StepWithExpressions.AsynchronousStepThread in project convertigo by convertigo.
the class Sequence method appendStepNode.
public void appendStepNode(Step step) throws EngineException {
if (Thread.currentThread() instanceof AsynchronousStepThread) {
AsynchronousStepThread thread = (AsynchronousStepThread) Thread.currentThread();
thread.wakeTurn(step);
}
synchronized (this) {
Node stepNode = step.getStepNode();
if (stepNode != null) {
workerElementMap.put(step.executeTimeID, stepNode);
if (step.isXmlOrOutput()) {
Element stepParentElement = findParentStepElement(step);
if (stepParentElement != null) {
boolean isOutput = step.isOutput();
if (!isOutput && stepNode.getNodeType() == Node.ELEMENT_NODE) {
boolean recurse = !(step instanceof StepWithExpressions);
// output true/false quick fix for split step
if (step.getName().equalsIgnoreCase("Split"))
recurse = true;
// set output mode userdata (used by the TreeWalker OutputFilter)
setOutputUserData((Element) stepNode, "false", recurse);
}
if (step instanceof XMLCopyStep) {
if (isOutput) {
NamedNodeMap map = stepNode.getAttributes();
for (int i = 0; i < map.getLength(); i++) {
Node copied = map.item(i).cloneNode(true);
// set again user data because clone does not preserve it
setOutputUserData(copied, String.valueOf(isOutput), true);
append(stepParentElement, copied);
}
}
NodeList children = stepNode.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node copied = children.item(i).cloneNode(true);
// set again user data because clone does not preserve it
setOutputUserData(copied, String.valueOf(isOutput), true);
append(stepParentElement, copied);
}
} else {
append(stepParentElement, stepNode);
}
}
}
}
}
}
Aggregations