use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class InvocationEditorDefinition method getModelClass.
@Override
public Optional<Invocation> getModelClass() {
final Invocation invocation = new Invocation();
invocation.setExpression(new LiteralExpression());
final InformationItem parameter = new InformationItem();
parameter.setName(new Name("p0"));
final Binding binding = new Binding();
binding.setParameter(parameter);
invocation.getBinding().add(binding);
return Optional.of(invocation);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class InvocationGrid method addParameterBinding.
void addParameterBinding(final int index) {
expression.ifPresent(invocation -> {
final Binding binding = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name("p" + invocation.getBinding().size()));
binding.setParameter(parameter);
sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddParameterBindingCommand(invocation, binding, model, new DMNGridRow(), index, uiModelMapper, this::synchroniseView));
});
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class AddContextEntryCommandTest method testGraphCommandExecuteMultipleEntriesPresent.
@Test
public void testGraphCommandExecuteMultipleEntriesPresent() {
final ContextEntry firstEntry = new ContextEntry() {
{
setVariable(new InformationItem() {
{
setName(new Name("old one"));
}
});
}
};
context.getContextEntry().add(0, firstEntry);
makeCommand();
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(3, context.getContextEntry().size());
assertEquals(firstEntry, context.getContextEntry().get(0));
assertEquals(contextEntry, context.getContextEntry().get(1));
assertEquals(defaultResultContextEntry, context.getContextEntry().get(2));
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class AddContextEntryCommandTest method testGraphCommandUndoMultipleEntriesPresent.
@Test
public void testGraphCommandUndoMultipleEntriesPresent() {
final ContextEntry firstEntry = new ContextEntry() {
{
setVariable(new InformationItem() {
{
setName(new Name("old one"));
}
});
}
};
context.getContextEntry().add(0, firstEntry);
makeCommand();
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add column and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertEquals(2, context.getContextEntry().size());
assertEquals(firstEntry, context.getContextEntry().get(0));
assertEquals(defaultResultContextEntry, context.getContextEntry().get(1));
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class AddParameterCommandTest method setup.
@Before
public void setup() {
this.function = new FunctionDefinition();
this.parameter = new InformationItem();
this.command = new AddParameterCommand(function, parameter, canvasOperation);
doReturn(ruleManager).when(handler).getRuleManager();
}
Aggregations