Search in sources :

Example 36 with InformationItemPrimary

use of org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary in project kie-wb-common by kiegroup.

the class DMNDeepCloneProcessTest method buildInformationItemPrimary.

private InformationItemPrimary buildInformationItemPrimary(final BuiltInType builtInType) {
    final InformationItemPrimary informationItemPrimary = new InformationItemPrimary();
    informationItemPrimary.setTypeRef(new QName(builtInType));
    return informationItemPrimary;
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) QName(org.kie.workbench.common.dmn.api.property.dmn.QName)

Example 37 with InformationItemPrimary

use of org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary in project kie-wb-common by kiegroup.

the class InputDataConverter method nodeFromDMN.

@Override
public Node<View<InputData>, ?> nodeFromDMN(final org.kie.dmn.model.api.InputData dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) {
    @SuppressWarnings("unchecked") final Node<View<InputData>, ?> node = (Node<View<InputData>, ?>) factoryManager.newElement(dmn.getId(), getDefinitionId(InputData.class)).asNode();
    final Id id = new Id(dmn.getId());
    final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
    final Name name = new Name(dmn.getName());
    final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), dmn);
    final InputData inputData = new InputData(id, description, name, informationItem, new StylingSet(), new GeneralRectangleDimensionsSet());
    node.getContent().setDefinition(inputData);
    if (informationItem != null) {
        informationItem.setParent(inputData);
    }
    DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, inputData);
    return node;
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) Description(org.kie.workbench.common.dmn.api.property.dmn.Description) Node(org.kie.workbench.common.stunner.core.graph.Node) StylingSet(org.kie.workbench.common.dmn.api.property.styling.StylingSet) GeneralRectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet) Id(org.kie.workbench.common.dmn.api.property.dmn.Id) BindableAdapterUtils.getDefinitionId(org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId) InputData(org.kie.workbench.common.dmn.api.definition.model.InputData) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.dmn.api.property.dmn.Name)

Example 38 with InformationItemPrimary

use of org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary in project kie-wb-common by kiegroup.

the class DecisionServiceParametersListWidget method addDecisionNodeToGroup.

void addDecisionNodeToGroup(final ParameterGroup group, final Node<View<?>, ?> node) {
    final Decision decision = (Decision) ((Definition) node.getContent()).getDefinition();
    final InformationItemPrimary variable = decision.getVariable();
    final String name = decision.getName().getValue();
    final String type = variable.getTypeRef().getLocalPart();
    group.addParameter(name, type);
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision)

Example 39 with InformationItemPrimary

use of org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary in project kie-wb-common by kiegroup.

the class DecisionServiceParametersListWidget method loadInputsParameters.

void loadInputsParameters(final List<InputData> inputs) {
    for (final InputData input : inputs) {
        final InformationItemPrimary variable = input.getVariable();
        final String name = input.getName().getValue();
        final String type = variable.getTypeRef().getLocalPart();
        groupInputs.addParameter(name, type);
    }
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) InputData(org.kie.workbench.common.dmn.api.definition.model.InputData)

Aggregations

InformationItemPrimary (org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary)39 Test (org.junit.Test)21 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)18 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)17 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)14 View (org.kie.workbench.common.stunner.core.graph.content.view.View)13 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)12 Node (org.kie.workbench.common.stunner.core.graph.Node)10 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)9 StylingSet (org.kie.workbench.common.dmn.api.property.styling.StylingSet)8 BindableAdapterUtils.getDefinitionId (org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId)8 InputData (org.kie.workbench.common.dmn.api.definition.model.InputData)7 GeneralRectangleDimensionsSet (org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet)6 BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel)5 DecisionTable (org.kie.workbench.common.dmn.api.definition.model.DecisionTable)5 OutputClause (org.kie.workbench.common.dmn.api.definition.model.OutputClause)5 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)5 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)4 DecisionService (org.kie.workbench.common.dmn.api.definition.model.DecisionService)4 FunctionDefinition (org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition)4