w.setName("Pig_".concat(nodeCount.get(NodeType.PIG) != null ? nodeCount.get(NodeType.PIG)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Java")) {
JavaActionWidget w = new JavaActionWidget(OozieWorkflowGenerator.this);
w.setName("Java_".concat(nodeCount.get(NodeType.JAVA) != null ? nodeCount.get(NodeType.JAVA)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("FS")) {
FSActionWidget w = new FSActionWidget(OozieWorkflowGenerator.this);
w.setName("FS_".concat(nodeCount.get(NodeType.FS) != null ? nodeCount.get(NodeType.FS).toString()
: "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("SSH")) {
SSHActionWidget w = new SSHActionWidget(OozieWorkflowGenerator.this);
w.setName("SSH_".concat(nodeCount.get(NodeType.SSH) != null ? nodeCount.get(NodeType.SSH)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Email")) {
EmailActionWidget w = new EmailActionWidget(OozieWorkflowGenerator.this);
w.setName("Email_".concat(nodeCount.get(NodeType.EMAIL) != null ? nodeCount.get(NodeType.EMAIL)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Shell")) {
ShellActionWidget w = new ShellActionWidget(OozieWorkflowGenerator.this);
w.setName("Shell_".concat(nodeCount.get(NodeType.SHELL) != null ? nodeCount.get(NodeType.SHELL)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Subworkflow")) {
SubWFActionWidget w = new SubWFActionWidget(OozieWorkflowGenerator.this);
w.setName("SubWF_".concat(nodeCount.get(NodeType.SUBWF) != null ? nodeCount.get(NodeType.SUBWF)
.toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Start")) {
if (start == null) {
StartNodeWidget w = new StartNodeWidget(OozieWorkflowGenerator.this);
start = w;
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
}
else if (name.equals("End")) {
if (end == null) {
EndNodeWidget w = new EndNodeWidget(OozieWorkflowGenerator.this);
w.setName("End");
end = w;
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
}
else if (name.equals("Kill")) {
if (kill == null) {
KillNodeWidget w = new KillNodeWidget(OozieWorkflowGenerator.this);
w.setName("Kill");
kill = w;
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
}
else if (name.equals("Fork/Join")) {
ForkNodeWidget fork = new ForkNodeWidget(OozieWorkflowGenerator.this);
fork.setName("Fork_".concat(nodeCount.get(NodeType.FORK) != null ? nodeCount.get(NodeType.FORK)
.toString() : "0"));
addWidget(fork, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
JoinNodeWidget join = new JoinNodeWidget(OozieWorkflowGenerator.this);
join.setName("Join_".concat(nodeCount.get(NodeType.JOIN) != null ? nodeCount.get(NodeType.JOIN)
.toString() : "0"));
addWidget(join, 90 + Random.nextInt(30), 30 + Random.nextInt(30));
}
else if (name.equals("Decision")) {
DecisionNodeWidget w = new DecisionNodeWidget(OozieWorkflowGenerator.this);
w.setName("Decision_".concat(nodeCount.get(NodeType.DECISION) != null ? nodeCount.get(
NodeType.DECISION).toString() : "0"));
addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
}
}
});