@Test public void testExecuteWithBusinessKnowledgeModelNode() { when(candidateContent.getDefinition()).thenReturn(businessKnowledgeModel); assertThat(command.execute(graphCommandExecutionContext).getType()).isEqualTo(CommandResult.Type.INFO); final FunctionDefinition encapsulatedLogic = businessKnowledgeModel.getEncapsulatedLogic(); final Expression expression = encapsulatedLogic.getExpression(); assertThat(expression).isInstanceOf(LiteralExpression.class); assertThat(expression.getParent()).isEqualTo(encapsulatedLogic); assertThat(KindUtilities.getKind(encapsulatedLogic)).isEqualTo(FunctionDefinition.Kind.FEEL); }
@Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = super.execute(context); if (!CommandUtils.isError(results)) { final Node<?, Edge> candidate = getCandidate(); if (candidate.getContent() instanceof View) { final DMNModelInstrumentedBase dmnModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition(); if (dmnModel instanceof BusinessKnowledgeModel) { setupEncapsulatedLogicIfNodeIsNew((BusinessKnowledgeModel) dmnModel); } } } return results; }
RegisterNodeCommand extends org.kie.workbench.common.stunner.core.graph.command.impl.RegisterNodeCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = super.execute(context); if (!CommandUtils.isError(results)) { final Node<?, Edge> candidate = getCandidate(); if (candidate.getContent() instanceof View) { final DMNModelInstrumentedBase dmnModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition(); if (dmnModel instanceof BusinessKnowledgeModel) { setupEncapsulatedLogicIfNodeIsNew((BusinessKnowledgeModel) dmnModel); } } } return results; } }
RegisterNodeCommand extends org.kie.workbench.common.stunner.core.graph.command.impl.RegisterNodeCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = super.execute(context); if (!CommandUtils.isError(results)) { final Node<?, Edge> candidate = getCandidate(); if (candidate.getContent() instanceof View) { final DMNModelInstrumentedBase dmnModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition(); if (dmnModel instanceof BusinessKnowledgeModel) { setupEncapsulatedLogicIfNodeIsNew((BusinessKnowledgeModel) dmnModel); } } } return results; } RegisterNodeCommand(final Node candidate); }
RegisterNodeCommand extends org.kie.workbench.common.stunner.core.graph.command.impl.RegisterNodeCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = super.execute(context); if (!CommandUtils.isError(results)) { final Node<?, Edge> candidate = getCandidate(); if (candidate.getContent() instanceof View) { final DMNModelInstrumentedBase dmnModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition(); if (dmnModel instanceof BusinessKnowledgeModel) { setupEncapsulatedLogicIfNodeIsNew((BusinessKnowledgeModel) dmnModel); } } } return results; } RegisterNodeCommand(final Node candidate); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); }
RegisterNodeCommand extends org.kie.workbench.common.stunner.core.graph.command.impl.RegisterNodeCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = super.execute(context); if (!CommandUtils.isError(results)) { final Node<?, Edge> candidate = getCandidate(); if (candidate.getContent() instanceof View) { final DMNModelInstrumentedBase dmnModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition(); if (dmnModel instanceof BusinessKnowledgeModel) { setupEncapsulatedLogicIfNodeIsNew((BusinessKnowledgeModel) dmnModel); } } } return results; } RegisterNodeCommand(final Node candidate); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context);  }