use of org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase in project kie-wb-common by kiegroup.
the class SetChildrenCommand method execute.
@Override
protected void execute(final GraphCommandExecutionContext context, final Node<?, Edge> parent, final Node<?, Edge> candidate) {
super.execute(context, parent, candidate);
if (parent.getContent() instanceof View) {
final DMNModelInstrumentedBase parentDMNModel = (DMNModelInstrumentedBase) ((View) parent.getContent()).getDefinition();
if (candidate.getContent() instanceof View) {
final DMNModelInstrumentedBase childDMNModel = (DMNModelInstrumentedBase) ((View) candidate.getContent()).getDefinition();
childDMNModel.setParent(parentDMNModel);
DefaultValueUtilities.updateNewNodeName(getGraph(context), childDMNModel);
}
}
}
use of org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase in project kie-wb-common by kiegroup.
the class DecisionTableEditorDefinitionEnricher method getOutputClauseName.
private Optional<String> getOutputClauseName(final HasVariable hasVariable) {
final IsInformationItem variable = hasVariable.getVariable();
if (variable instanceof InformationItem) {
return Optional.ofNullable((variable).getName().getValue());
}
final DMNModelInstrumentedBase base = hasVariable.asDMNModelInstrumentedBase().getParent();
final DMNModelInstrumentedBase parent = base.getParent();
if (parent instanceof HasName) {
return Optional.ofNullable(((HasName) parent).getName().getValue());
}
if (parent instanceof HasVariable) {
return getOutputClauseName((HasVariable) parent);
}
return Optional.empty();
}
use of org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase in project kie-wb-common by kiegroup.
the class DRDContextMenuService method connectRootWithChild.
private void connectRootWithChild(final Node dmnDiagramRoot, final Node child) {
final String uuid = UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
connectEdge(edge, dmnDiagramRoot, child);
final Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions();
final DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition();
childDRG.setParent(definitions);
}
use of org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase in project kie-wb-common by kiegroup.
the class DMNMarshallerStandalone method connectRootWithChild.
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void connectRootWithChild(final Node dmnDiagramRoot, final Node child) {
final String uuid = org.kie.workbench.common.stunner.core.util.UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
connectEdge(edge, dmnDiagramRoot, child);
final Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions();
final DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition();
childDRG.setParent(definitions);
}
use of org.kie.workbench.common.dmn.api.definition.model.DMNModelInstrumentedBase in project kie-wb-common by kiegroup.
the class DMNUnmarshaller method connectRootWithChild.
@SuppressWarnings({ "rawtypes", "unchecked" })
private void connectRootWithChild(final Node dmnDiagramRoot, final Node child) {
final String uuid = UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
connectEdge(edge, dmnDiagramRoot, child);
final Definitions definitions = ((DMNDiagram) ((View) dmnDiagramRoot.getContent()).getDefinition()).getDefinitions();
final DMNModelInstrumentedBase childDRG = (DMNModelInstrumentedBase) ((View) child.getContent()).getDefinition();
childDRG.setParent(definitions);
}
Aggregations