use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class UpdateParameterNameCommandTest method setup.
@Before
public void setup() {
this.parameter = new InformationItem();
this.parameter.getName().setValue(OLD_PARAMETER_NAME);
this.command = new UpdateParameterNameCommand(parameter, NEW_PARAMETER_NAME, canvasOperation);
doReturn(ruleManager).when(handler).getRuleManager();
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class AddContextEntryCommand method newGraphCommand.
@Override
protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) {
return new AbstractGraphCommand() {
@Override
protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) {
return GraphCommandResultBuilder.SUCCESS;
}
@Override
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) {
context.getContextEntry().add(uiRowIndex, contextEntry);
final InformationItem informationItem = contextEntry.getVariable();
informationItem.getName().setValue(name);
contextEntry.setParent(context);
contextEntry.getVariable().setParent(contextEntry);
return GraphCommandResultBuilder.SUCCESS;
}
@Override
public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) {
context.getContextEntry().remove(contextEntry);
return GraphCommandResultBuilder.SUCCESS;
}
};
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class BaseSupplementaryFunctionEditorDefinition method createVariable.
protected InformationItem createVariable(final String name) {
final InformationItem variable = new InformationItem();
variable.setName(new Name(name));
variable.setTypeRef(new QName(DEFAULT_VARIABLE_TYPE));
return variable;
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class AddParameterBindingCommand method newGraphCommand.
@Override
protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) {
return new AbstractGraphCommand() {
@Override
protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) {
return GraphCommandResultBuilder.SUCCESS;
}
@Override
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) {
invocation.getBinding().add(uiRowIndex, binding);
final InformationItem informationItem = binding.getParameter();
informationItem.getName().setValue(name);
binding.setParent(invocation);
binding.getParameter().setParent(binding);
return GraphCommandResultBuilder.SUCCESS;
}
@Override
public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) {
invocation.getBinding().remove(binding);
return GraphCommandResultBuilder.SUCCESS;
}
};
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class DMNMarshallerStandaloneTest method checkDecisionWithContextWithoutDefaultResult.
private void checkDecisionWithContextWithoutDefaultResult(Graph<?, Node<?, ?>> g) {
Node<?, ?> decisionNode = g.getNode("_30810b88-8416-4c02-8ed1-8c19b7606243");
assertNodeContentDefinitionIs(decisionNode, Decision.class);
Context context = (Context) ((Decision) ((View<?>) decisionNode.getContent()).getDefinition()).getExpression();
InformationItem defaultResultVariable = context.getContextEntry().get(1).getVariable();
assertNull("Default result variable", defaultResultVariable);
Expression defaultResultExpression = context.getContextEntry().get(1).getExpression();
assertNull("Default result expression", defaultResultExpression);
}
Aggregations