use of org.whole.lang.workflows.ui.dialogs.ITaskDialogFactory in project whole by wholeplatform.
the class WorkflowsIDEInterpreterVisitor method visit.
@Override
public void visit(Task entity) {
entity.getLabel().accept(this);
String title = PrettyPrinterOperation.toPrettyPrintString(getResult());
entity.getDescription().accept(this);
String description = PrettyPrinterOperation.toPrettyPrintString(getResult());
Assignments assignments = EntityUtils.clone(entity.getAssignments());
Variable factoryVariable = entity.getFactory();
ITaskDialogFactory factory;
if (EntityUtils.isNotResolver(factoryVariable)) {
factoryVariable.accept(this);
factory = (ITaskDialogFactory) getResultValue();
} else if (EntityUtils.isNotResolver(assignments)) {
factory = AssignmentsDialogFactory.instance();
} else
factory = ConfirmationDialogFactory.instance();
if (EntityUtils.isNotResolver(assignments)) {
stagedVisit(assignments, 1);
assignments = (Assignments) getResult();
}
if (!TaskDialogHelper.showTaskDialog(factory, title, description, assignments, getBindings()))
throw new OperationCanceledException(new VisitException("task not completed: " + description));
assignments.accept(this);
}
Aggregations