* @return
* @throws FPDLSerializerException
*/
public Document workflowProcessToDom(WorkflowProcess workflowProcess)
throws FPDLSerializerException {
DocumentFactory df = new DocumentFactory();
// serialize the Package
Element workflowProcessElement = df.createElement(new QName(
WORKFLOW_PROCESS, FPDL_NS));
workflowProcessElement.addNamespace(FPDL_NS_PREFIX, FPDL_URI);
// workflowProcessElement.addNamespace(XSD_NS_PREFIX, XSD_URI);
// workflowProcessElement.addNamespace(XSI_NS_PREFIX, XSI_URI);
workflowProcessElement.addAttribute(ID, workflowProcess.getId());
workflowProcessElement.addAttribute(NAME, workflowProcess.getName());
workflowProcessElement.addAttribute(DISPLAY_NAME, workflowProcess.getDisplayName());
workflowProcessElement.addAttribute(RESOURCE_FILE, workflowProcess.getResourceFile());
workflowProcessElement.addAttribute(RESOURCE_MANAGER, workflowProcess.getResourceManager());
Util4Serializer.addElement(workflowProcessElement, DESCRIPTION,
workflowProcess.getDescription());
if (workflowProcess.getTaskInstanceCreator() != null && !workflowProcess.getTaskInstanceCreator().trim().equals("")) {
workflowProcessElement.addAttribute(TASK_INSTANCE_CREATOR, workflowProcess.getTaskInstanceCreator());
}
if (workflowProcess.getFormTaskInstanceRunner()!=null && !workflowProcess.getFormTaskInstanceRunner().trim().equals("")){
workflowProcessElement.addAttribute(FORM_TASK_INSTANCE_RUNNER, workflowProcess.getFormTaskInstanceRunner());
}
if (workflowProcess.getToolTaskInstanceRunner()!=null && !workflowProcess.getToolTaskInstanceRunner().trim().equals("")){
workflowProcessElement.addAttribute(TOOL_TASK_INSTANCE_RUNNER, workflowProcess.getToolTaskInstanceRunner());
}
if (workflowProcess.getSubflowTaskInstanceRunner()!=null && !workflowProcess.getSubflowTaskInstanceRunner().trim().equals("")){
workflowProcessElement.addAttribute(SUBFLOW_TASK_INSTANCE_RUNNER, workflowProcess.getSubflowTaskInstanceRunner());
}
if (workflowProcess.getFormTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getFormTaskInstanceCompletionEvaluator().trim().equals("")){
workflowProcessElement.addAttribute(FORM_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getFormTaskInstanceCompletionEvaluator());
}
if (workflowProcess.getToolTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getToolTaskInstanceCompletionEvaluator().trim().equals("")){
workflowProcessElement.addAttribute(TOOL_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getToolTaskInstanceCompletionEvaluator());
}
if (workflowProcess.getSubflowTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getSubflowTaskInstanceCompletionEvaluator().trim().equals("")){
workflowProcessElement.addAttribute(SUBFLOW_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getSubflowTaskInstanceCompletionEvaluator());
}
writeDataFields(workflowProcess.getDataFields(), workflowProcessElement);
writeStartNode(workflowProcess.getStartNode(), workflowProcessElement);
writeTasks(workflowProcess.getTasks(), workflowProcessElement);
writeActivities(workflowProcess.getActivities(), workflowProcessElement);
writeSynchronizers(workflowProcess.getSynchronizers(),
workflowProcessElement);
writeEndNodes(workflowProcess.getEndNodes(), workflowProcessElement);
writeTransitions(workflowProcess.getTransitions(),
workflowProcessElement);
writeLoops(workflowProcess.getLoops(), workflowProcessElement);
writeEventListeners(workflowProcess.getEventListeners(), workflowProcessElement);
writeExtendedAttributes(workflowProcess.getExtendedAttributes(),
workflowProcessElement);
Document document = df.createDocument(workflowProcessElement);
document.addDocType(FPDL_NS_PREFIX + ":" + WORKFLOW_PROCESS, PUBLIC_ID, SYSTEM_ID);
return document;
}