use of org.whole.lang.workflows.model.Assign in project whole by wholeplatform.
the class ChooseModelsDialog method open.
@Override
public int open() {
int status = super.open();
if (status == Dialog.OK) {
WorkflowsEntityFactory wef = WorkflowsEntityFactory.instance;
Tuple tuple = QueriesEntityFactory.instance.createTuple(0);
for (Object element : getResult()) try {
IEntity model = getPersistenceKit().readModel(new IFilePersistenceProvider((IFile) element));
tuple.wAdd(createStageUpFragment(QueriesEntityDescriptorEnum.Expression, model));
} catch (Exception e) {
}
Variable variable = wef.createVariable("selectedModels");
Expression fragment = createSameStageFragment(Expression, tuple);
Assign assign = wef.createAssign(variable, fragment);
assignments.wAdd(assign);
}
return status;
}
use of org.whole.lang.workflows.model.Assign in project whole by wholeplatform.
the class WorkflowsInterpreterVisitor method define.
public void define(IBindingScope bm, Assignments assignments) {
IEntity selfEntity = bm.wGet("self");
for (int i = 0; i < assignments.wSize(); i++) {
Assign assign = assignments.get(i);
define(bm, assign);
if (!assign.getName().getValue().equals("self"))
resetSelfEntity(selfEntity);
}
}
use of org.whole.lang.workflows.model.Assign in project whole by wholeplatform.
the class ChangeValueDialogFactory method createDialog.
public Dialog createDialog(Shell shell, String title, String message, Assignments assignments, IBindingManager bindings) {
Assign assign = (Assign) assignments.wGet(0);
Expression expression = assign.getExpression();
IEntity entity = BehaviorUtils.evaluate(expression, 0, bindings);
assign.wSet(expression, entity);
IEclipseContext params = EclipseContextFactory.create();
params.set("dialogTitle", title);
params.set("dialogMessage", message);
params.set("dialogEntity", entity);
IEclipseContext context = (IEclipseContext) bindings.wGetValue("eclipse#eclipseContext");
IImportAsModelDialogFactory factory = ContextInjectionFactory.make(DisabledImportAsModelDialogFactory.class, context);
params.set(IImportAsModelDialogFactory.class, factory);
return ContextInjectionFactory.make(ChangeValueDialog.class, context, params);
}
use of org.whole.lang.workflows.model.Assign in project whole by wholeplatform.
the class AssignPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
Assign entity = getModelEntity();
List<IEntity> children = new ArrayList<IEntity>(2);
children.add(entity.getName());
children.add(entity.getExpression());
return children;
}
Aggregations