use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class AddParameterCommandTest method testGraphCommandUndoWithParameters.
@Test
public void testGraphCommandUndoWithParameters() {
final InformationItem otherParameter = new InformationItem();
function.getFormalParameter().add(otherParameter);
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add parameter and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertFormalParameters(1, otherParameter);
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RemoveParameterCommandTest method setup.
@Before
public void setup() {
this.function = new FunctionDefinition();
this.parameter = new InformationItem();
this.function.getFormalParameter().add(parameter);
this.command = new RemoveParameterCommand(function, parameter, 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 SetParametersCommandTest method testGraphCommandExecuteWithParameters.
@Test
public void testGraphCommandExecuteWithParameters() {
final InformationItem otherParameter = new InformationItem();
function.getFormalParameter().add(otherParameter);
setupCommand();
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertFormalParameters(parameter1, parameter2);
assertEquals(function, parameter1.getParent());
assertEquals(function, parameter2.getParent());
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class SetParametersCommandTest method setup.
@Before
public void setup() {
this.function = new FunctionDefinition();
this.parameter1 = new InformationItem();
this.parameter2 = new InformationItem();
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 RelationGrid method addColumn.
void addColumn(final int index) {
getExpression().get().ifPresent(relation -> {
final InformationItem informationItem = new InformationItem();
informationItem.setName(new Name());
final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM)));
if (!CommandUtils.isError(result)) {
selectHeaderCell(0, index, false, false);
CellContextUtilities.editSelectedCell(this);
}
});
}
Aggregations