Search in sources :

Example 16 with ItemDefinition

use of org.eclipse.bpmn2.ItemDefinition in project kie-wb-common by kiegroup.

the class ItemDefinitionPropertyConverter method dmnFromWB.

public static org.kie.dmn.model.v1_1.ItemDefinition dmnFromWB(final ItemDefinition wb) {
    if (wb == null) {
        return null;
    }
    org.kie.dmn.model.v1_1.ItemDefinition result = new org.kie.dmn.model.v1_1.ItemDefinition();
    result.setId(wb.getId().getValue());
    result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
    result.setName(wb.getName().getValue());
    QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
    result.setTypeLanguage(wb.getTypeLanguage());
    result.setIsCollection(wb.isIsCollection());
    result.setAllowedValues(UnaryTestsPropertyConverter.dmnFromWB(wb.getAllowedValues()));
    for (ItemDefinition child : wb.getItemComponent()) {
        org.kie.dmn.model.v1_1.ItemDefinition convertedChild = ItemDefinitionPropertyConverter.dmnFromWB(child);
        result.getItemComponent().add(convertedChild);
    }
    return result;
}
Also used : ItemDefinition(org.kie.workbench.common.dmn.api.definition.v1_1.ItemDefinition)

Example 17 with ItemDefinition

use of org.eclipse.bpmn2.ItemDefinition in project kie-wb-common by kiegroup.

the class CustomInput method readInputFrom.

private DataInput readInputFrom(String targetName, ItemDefinition typeDef) {
    DataInput dataInput = bpmn2.createDataInput();
    dataInput.setName(targetName);
    // the id is an encoding of the node id + the name of the input
    dataInput.setId(Ids.dataInput(element.getId(), targetName));
    dataInput.setItemSubjectRef(typeDef);
    CustomAttribute.dtype.of(dataInput).set(typeDef.getStructureRef());
    return dataInput;
}
Also used : DataInput(org.eclipse.bpmn2.DataInput)

Example 18 with ItemDefinition

use of org.eclipse.bpmn2.ItemDefinition in project kie-wb-common by kiegroup.

the class InputAssignmentWriter method readInputFrom.

private DataInput readInputFrom(String targetName, ItemDefinition typeDef) {
    DataInput dataInput = bpmn2.createDataInput();
    // the id is an encoding of the node id + the name of the input
    dataInput.setId(Ids.dataInput(parentId, decl.getIdentifier()));
    dataInput.setName(targetName);
    dataInput.setItemSubjectRef(typeDef);
    CustomAttribute.dtype.of(dataInput).set(typeDef.getStructureRef());
    return dataInput;
}
Also used : DataInput(org.eclipse.bpmn2.DataInput)

Example 19 with ItemDefinition

use of org.eclipse.bpmn2.ItemDefinition in project kie-wb-common by kiegroup.

the class InputAssignmentWriter method typedefInput.

private ItemDefinition typedefInput(VariableDeclaration decl) {
    ItemDefinition typeDef = bpmn2.createItemDefinition();
    typeDef.setId(Ids.dataInputItem(parentId, decl.getIdentifier()));
    typeDef.setStructureRef(decl.getType());
    return typeDef;
}
Also used : ItemDefinition(org.eclipse.bpmn2.ItemDefinition)

Example 20 with ItemDefinition

use of org.eclipse.bpmn2.ItemDefinition in project kie-wb-common by kiegroup.

the class OutputAssignmentWriter method writeOutputTo.

private DataOutput writeOutputTo(String sourceName, ItemDefinition typeDef) {
    DataOutput dataOutput = bpmn2.createDataOutput();
    dataOutput.setId(Ids.dataOutput(parentId, decl.getIdentifier()));
    dataOutput.setName(sourceName);
    dataOutput.setItemSubjectRef(typeDef);
    CustomAttribute.dtype.of(dataOutput).set(typeDef.getStructureRef());
    return dataOutput;
}
Also used : DataOutput(org.eclipse.bpmn2.DataOutput)

Aggregations

ItemDefinition (org.kie.dmn.model.v1_1.ItemDefinition)22 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)21 ArrayList (java.util.ArrayList)17 RootElement (org.eclipse.bpmn2.RootElement)17 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)13 Process (org.eclipse.bpmn2.Process)13 SubProcess (org.eclipse.bpmn2.SubProcess)13 Entry (java.util.Map.Entry)11 FlowElement (org.eclipse.bpmn2.FlowElement)11 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)11 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)11 Message (org.eclipse.bpmn2.Message)10 FlowElementsContainer (org.eclipse.bpmn2.FlowElementsContainer)9 Test (org.junit.Test)9 List (java.util.List)8 CallActivity (org.eclipse.bpmn2.CallActivity)7 DataInput (org.eclipse.bpmn2.DataInput)7 QName (javax.xml.namespace.QName)6 Activity (org.eclipse.bpmn2.Activity)6 DataOutput (org.eclipse.bpmn2.DataOutput)6