use of com.liferay.ide.kaleo.core.model.WorkflowDefinition in project liferay-ide by liferay.
the class NewNodeNameValidationService method compute.
@Override
public Status compute() {
Status retval = Status.createOkStatus();
WorkflowNode newNode = context(WorkflowNode.class);
WorkflowDefinition workflowDefinition = newNode.adapt(WorkflowDefinition.class);
if (workflowDefinition != null) {
for (WorkflowNode node : workflowDefinition.getDiagramNodes()) {
Value<String> nodeName = node.getName();
String name = nodeName.content();
if ((name != null) && name.equals(newNode.getName().content())) {
retval = Status.createErrorStatus("Name already in use.");
break;
}
}
}
return retval;
}
Aggregations