use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class PackageInstanceFilter method getVariableCriteria.
public Map<String, String> getVariableCriteria(WorkflowProcess processVersion) {
Map<String, String> criteria = new HashMap<String, String>();
for (String varName : variableValues.keySet()) {
String varValue = variableValues.get(varName);
if (varValue != null && varValue.trim().length() > 0) {
VariableVO varVO = processVersion.getVariable(varName);
if (varVO != null && varVO.getVariableType().equals("java.util.Date")) {
String mon = varValue.substring(4, 7).toUpperCase();
String dd = varValue.substring(8, 10);
String yyyy = varValue.substring(24);
String dateVarVal = "to_date('" + mon + " " + dd + " " + yyyy + "', 'MON DD YYYY')";
criteria.put("DATE:" + varName, " = " + dateVarVal);
} else {
criteria.put(varName, " = '" + varValue + "'");
}
}
}
return criteria;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class ProcessInstanceFilter method getVariableCriteria.
public Map<String, String> getVariableCriteria(WorkflowProcess processVersion) {
Map<String, String> criteria = new HashMap<>();
for (Map.Entry<String, String> varName : variableValues.entrySet()) {
String varValue = varName.getValue();
if (varValue != null && varValue.trim().length() > 0) {
VariableVO varVO = processVersion.getVariable(varName.getKey());
if (varVO != null && varVO.getVariableType().equals("java.util.Date")) {
String mon = varValue.substring(4, 7).toUpperCase();
String dd = varValue.substring(8, 10);
String yyyy = varValue.substring(24);
String dateVarVal = null;
if (processVersion.getProject().getMdwMajorVersion() >= 6) {
dateVarVal = mon + " " + dd + " " + yyyy;
criteria.put("DATE:" + varName.getKey(), dateVarVal);
} else {
dateVarVal = "to_date('" + mon + " " + dd + " " + yyyy + "', 'MON DD YYYY')";
criteria.put("DATE:" + varName, " = " + dateVarVal);
}
} else {
if (processVersion.getProject().getMdwMajorVersion() >= 6)
criteria.put(varName.getKey(), varValue);
else
criteria.put(varName.getKey(), " = '" + varValue + "'");
}
}
}
return criteria;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class ExportHelper method printProcessDocx.
private DocxBuilder printProcessDocx(Graph process, DesignerCanvas canvas) throws Exception {
DocxBuilder builder = new DocxBuilder();
// title
String title = "Workflow: \"" + process.getName() + "\"";
builder.addParagraph("Heading1", title);
// process image
int zoomSave = process.zoom;
process.zoom = 100;
byte[] imgBytes = printImage(-1f, canvas, process.getGraphSize(), "png");
process.zoom = zoomSave;
builder.addImage(imgBytes);
printProcessBodyDocx(builder, process);
// embedded subprocesses
for (SubGraph subprocess : process.getSubgraphs(nodeIdType)) {
String id = subprocess.getDisplayId(nodeIdType);
String spTitle = "Embedded Subprocess " + id + ": \"" + subprocess.getName() + "\"";
builder.addParagraph("Heading1", spTitle);
printProcessBodyDocx(builder, subprocess);
}
// process variables
if (options.contains(VARIABLES)) {
List<VariableVO> variables = process.getProcessVO().getVariables();
if (variables != null && !variables.isEmpty()) {
builder.addParagraph("Heading2", "Process Variables");
String[] headers = new String[] { "Name", "Type", "Mode", "Description" };
String[][] values = new String[4][variables.size()];
for (int i = 0; i < variables.size(); i++) {
VariableVO var = variables.get(i);
values[0][i] = var.getName();
values[1][i] = var.getVariableType();
values[2][i] = VariableVO.VariableCategories[var.getVariableCategory()];
values[3][i] = var.getVariableReferredAs();
}
builder.addTable(headers, values, 11, 120);
}
}
return builder;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class ExportHelper method printProcessHtml.
private void printProcessHtml(StringBuilder sb, DesignerCanvas canvas, int chapter, Graph process, String filename) throws Exception {
sb.append("<h1>");
if (chapter > 0)
sb.append(Integer.toString(chapter)).append(". ");
sb.append("Workflow: \"").append(process.getName()).append("\"</h1>\n");
// print image
printGraphHtml(sb, canvas, process, filename, chapter);
// print documentation text
sb.append(BR);
printProcessBodyHtml(sb, process);
for (Node node : process.getNodes(nodeIdType)) {
printActivityHtml(sb, node);
}
for (SubGraph subgraph : process.getSubgraphs(nodeIdType)) {
printProcessBodyHtml(sb, subgraph);
for (Node node : subgraph.getNodes(nodeIdType)) {
printActivityHtml(sb, node);
}
}
if (options.contains(VARIABLES)) {
List<VariableVO> variables = process.getProcessVO().getVariables();
if (variables != null && !variables.isEmpty()) {
sb.append("<h2>Process Variables</h2>\n");
String[] headers = new String[] { "Name", "Type", "Mode", "Description" };
String[][] values = new String[4][variables.size()];
for (int i = 0; i < variables.size(); i++) {
VariableVO var = variables.get(i);
values[0][i] = var.getName();
values[1][i] = var.getVariableType();
values[2][i] = VariableVO.VariableCategories[var.getVariableCategory()];
values[3][i] = var.getVariableReferredAs();
}
printTableHtml(sb, headers, values);
}
}
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class Graph method addVariable.
public VariableVO addVariable(String name, VariableTypeVO vt) {
VariableVO doc = new VariableVO();
doc.setVariableName(name);
doc.setVariableId(null);
doc.setVariableType(vt.getVariableType());
processVO.getVariables().add(doc);
updateTaskVariableMapping(null, name);
return doc;
}
Aggregations