Search in sources :

Example 1 with ActionCall

use of org.whole.lang.actions.model.ActionCall in project whole by wholeplatform.

the class SemanticsInterpreterVisitor method visit.

@Override
public void visit(StructuredVariable entity) {
    ActionsEntityFactory aef = ActionsEntityFactory.instance;
    QueriesEntityFactory qef = QueriesEntityFactory.instance;
    ActionCall actionCall = aef.createActionCall(aef.createLabel("whole:org.whole.lang.semantics:SemanticsActions:1.0.0#toVariableFlatName"), qef.createVariableRefStep("variable").wGetAdapter(ActionsEntityDescriptorEnum.SelectedEntities));
    getBindings().wDef("variable", entity);
    IEntity varNameEntity = BehaviorUtils.evaluate(actionCall, 0, getOperation());
    if (isSelectedFeature(SemanticsUtils.USE_IDENTIFIER_SEMANTICS))
        setResult(varNameEntity);
    else {
        IEntity varValue = BindingUtils.wGet(getBindings(), varNameEntity.wStringValue());
        if (varValue == null)
            throw new MissingVariableException(entity.toString()).withSourceEntity(entity).withBindings(getBindings());
        setResult(varValue);
    }
}
Also used : IEntity(org.whole.lang.model.IEntity) QueriesEntityFactory(org.whole.lang.queries.factories.QueriesEntityFactory) ActionsEntityFactory(org.whole.lang.actions.factories.ActionsEntityFactory) ActionCall(org.whole.lang.actions.model.ActionCall) MissingVariableException(org.whole.lang.visitors.MissingVariableException)

Example 2 with ActionCall

use of org.whole.lang.actions.model.ActionCall in project whole by wholeplatform.

the class ActionCallPart method getModelSpecificChildren.

protected List<IEntity> getModelSpecificChildren() {
    ActionCall entity = getModelEntity();
    List<IEntity> list = new ArrayList<IEntity>(2);
    list.add(entity.getName());
    list.add(entity.getSelectedEntities());
    return list;
}
Also used : IEntity(org.whole.lang.model.IEntity) ArrayList(java.util.ArrayList) ActionCall(org.whole.lang.actions.model.ActionCall)

Aggregations

ActionCall (org.whole.lang.actions.model.ActionCall)2 IEntity (org.whole.lang.model.IEntity)2 ArrayList (java.util.ArrayList)1 ActionsEntityFactory (org.whole.lang.actions.factories.ActionsEntityFactory)1 QueriesEntityFactory (org.whole.lang.queries.factories.QueriesEntityFactory)1 MissingVariableException (org.whole.lang.visitors.MissingVariableException)1