public Class generateNodeFor() {
return WorkItemNode.class;
}
public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) {
WorkItemNode workItemNode = (WorkItemNode) node;
String type = workItemNode.getWork().getName();
if ("Manual Task".equals(type)) {
writeNode("manualTask", workItemNode, xmlDump, metaDataType);
xmlDump.append(">" + EOL);
writeScripts(workItemNode, xmlDump);
endNode("manualTask", xmlDump);
return;
}
if ("Service Task".equals(type)) {
writeNode("serviceTask", workItemNode, xmlDump, metaDataType);
xmlDump.append("operationRef=\"" +
XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_ServiceOperation\" implementation=\"Other\" >" + EOL);
writeScripts(workItemNode, xmlDump);
xmlDump.append(
" <ioSpecification>" + EOL +
" <dataInput id=\"" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param\" name=\"Parameter\" />" + EOL +
" <dataOutput id=\"" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result\" name=\"Result\" />" + EOL +
" <inputSet>" + EOL +
" <dataInputRefs>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param</dataInputRefs>" + EOL +
" </inputSet>" + EOL +
" <outputSet>" + EOL +
" <dataOutputRefs>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result</dataOutputRefs>" + EOL +
" </outputSet>" + EOL +
" </ioSpecification>" + EOL);
String inMapping = workItemNode.getInMapping("Parameter");
if (inMapping != null) {
xmlDump.append(
" <dataInputAssociation>" + EOL +
" <sourceRef>" + XmlDumper.replaceIllegalChars(inMapping) + "</sourceRef>" + EOL +
" <targetRef>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param</targetRef>" + EOL +
" </dataInputAssociation>" + EOL);
}
String outMapping = workItemNode.getOutMapping("Result");
if (outMapping != null) {
xmlDump.append(
" <dataOutputAssociation>" + EOL +
" <sourceRef>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result</sourceRef>" + EOL +
" <targetRef>" + XmlDumper.replaceIllegalChars(outMapping) + "</targetRef>" + EOL +
" </dataOutputAssociation>" + EOL);
}
endNode("serviceTask", xmlDump);
return;
}
if ("Send Task".equals(type)) {
writeNode("sendTask", workItemNode, xmlDump, metaDataType);
xmlDump.append("messageRef=\"" +
XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_Message\" implementation=\"Other\" >" + EOL);
writeScripts(workItemNode, xmlDump);
xmlDump.append(
" <ioSpecification>" + EOL +
" <dataInput id=\"" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param\" name=\"Message\" />" + EOL +
" <inputSet>" + EOL +
" <dataInputRefs>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param</dataInputRefs>" + EOL +
" </inputSet>" + EOL +
" <outputSet/>" + EOL +
" </ioSpecification>" + EOL);
String inMapping = workItemNode.getInMapping("Message");
if (inMapping != null) {
xmlDump.append(
" <dataInputAssociation>" + EOL +
" <sourceRef>" + XmlDumper.replaceIllegalChars(inMapping) + "</sourceRef>" + EOL +
" <targetRef>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_param</targetRef>" + EOL +
" </dataInputAssociation>" + EOL);
}
endNode("sendTask", xmlDump);
return;
}
if ("Receive Task".equals(type)) {
writeNode("receiveTask", workItemNode, xmlDump, metaDataType);
String messageId = (String) workItemNode.getWork().getParameter("MessageId");
xmlDump.append("messageRef=\"" +
messageId + "\" implementation=\"Other\" >" + EOL);
writeScripts(workItemNode, xmlDump);
xmlDump.append(
" <ioSpecification>" + EOL +
" <dataOutput id=\"" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result\" name=\"Message\" />" + EOL +
" <inputSet/>" + EOL +
" <outputSet>" + EOL +
" <dataOutputRefs>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result</dataOutputRefs>" + EOL +
" </outputSet>" + EOL +
" </ioSpecification>" + EOL);
String outMapping = workItemNode.getOutMapping("Message");
if (outMapping != null) {
xmlDump.append(
" <dataOutputAssociation>" + EOL +
" <sourceRef>" + XmlBPMNProcessDumper.getUniqueNodeId(workItemNode) + "_result</sourceRef>" + EOL +
" <targetRef>" + XmlDumper.replaceIllegalChars(outMapping) + "</targetRef>" + EOL +