Search in sources :

Example 31 with Property

use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.

the class OutputAssignmentReaderTest method testFromAssociationWithPropertyId.

@Test
public void testFromAssociationWithPropertyId() {
    Property property = mockProperty(TARGET_ID, null);
    DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, property);
    OutputAssignmentReader outputReader = OutputAssignmentReader.fromAssociation(outputAssociation);
    assertNotNull(outputReader);
    assertResult(SOURCE_NAME, TARGET_ID, AssociationDeclaration.Type.SourceTarget, outputReader.getAssociationDeclaration());
}
Also used : DataOutputAssociation(org.eclipse.bpmn2.DataOutputAssociation) Property(org.eclipse.bpmn2.Property) Test(org.junit.Test)

Example 32 with Property

use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.

the class SubProcessPropertyWriter method setProcessVariables.

public void setProcessVariables(BaseProcessVariables processVariables) {
    String value = processVariables.getValue();
    DeclarationList declarationList = DeclarationList.fromString(value);
    List<Property> properties = process.getProperties();
    declarationList.getDeclarations().forEach(decl -> {
        VariableScope.Variable variable = variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType());
        if (!decl.getTags().isEmpty()) {
            CustomElement.customTags.of(variable.getTypedIdentifier()).set(decl.getTags());
        }
        properties.add(variable.getTypedIdentifier());
        this.itemDefinitions.add(variable.getTypeDeclaration());
    });
}
Also used : DeclarationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList) Property(org.eclipse.bpmn2.Property)

Example 33 with Property

use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.

the class MultipleInstanceActivityPropertyWriter method setCollectionOutput.

public void setCollectionOutput(String collectionOutput) {
    if (isEmpty(collectionOutput)) {
        return;
    }
    setUpLoopCharacteristics();
    String suffix = "OUT_COLLECTION";
    String id = Ids.dataOutput(activity.getId(), suffix);
    DataOutput dataOutputElement = createDataOutput(id, suffix);
    addSafe(ioSpec.getDataOutputs(), dataOutputElement);
    Optional<Property> property = findPropertyById(collectionOutput);
    Optional<DataObject> dataObject = findDataObjectById(collectionOutput);
    if (property.isPresent()) {
        processDataOutput(dataOutputElement, property.get());
    } else if (dataObject.isPresent()) {
        processDataOutput(dataOutputElement, dataObject.get());
    }
}
Also used : DataOutput(org.eclipse.bpmn2.DataOutput) DataObject(org.eclipse.bpmn2.DataObject) Property(org.eclipse.bpmn2.Property)

Example 34 with Property

use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.

the class ProcessPropertyWriter method setCaseFileVariables.

public void setCaseFileVariables(CaseFileVariables caseFileVariables) {
    String value = caseFileVariables.getValue();
    DeclarationList declarationList = DeclarationList.fromString(value);
    List<Property> properties = process.getProperties();
    declarationList.getDeclarations().forEach(decl -> {
        VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType());
        properties.add(variable.getTypedIdentifier());
        this.itemDefinitions.add(variable.getTypeDeclaration());
    });
}
Also used : DeclarationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList) Property(org.eclipse.bpmn2.Property)

Example 35 with Property

use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.

the class MultipleInstanceActivityPropertyWriterTest method mockProperty.

private Property mockProperty(String name, String itemSubjectRef) {
    Property property = mock(Property.class);
    when(property.getId()).thenReturn(name);
    when(property.getName()).thenReturn(name);
    ItemDefinition itemDefinition = mock(ItemDefinition.class);
    when(itemDefinition.getId()).thenReturn(itemSubjectRef);
    when(property.getItemSubjectRef()).thenReturn(itemDefinition);
    return property;
}
Also used : ItemDefinition(org.eclipse.bpmn2.ItemDefinition) Property(org.eclipse.bpmn2.Property)

Aggregations

Property (org.eclipse.bpmn2.Property)21 Property (io.atlasmap.v2.Property)7 AtlasMapping (io.atlasmap.v2.AtlasMapping)6 ArrayList (java.util.ArrayList)6 Process (org.eclipse.bpmn2.Process)6 Test (org.junit.Test)6 DataObject (org.eclipse.bpmn2.DataObject)5 DataOutputAssociation (org.eclipse.bpmn2.DataOutputAssociation)5 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)5 RootElement (org.eclipse.bpmn2.RootElement)5 Properties (io.atlasmap.v2.Properties)4 DataInput (org.eclipse.bpmn2.DataInput)4 DeclarationList (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList)4 PropertyField (io.atlasmap.v2.PropertyField)3 List (java.util.List)3 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)3 DataOutput (org.eclipse.bpmn2.DataOutput)3 FlowElement (org.eclipse.bpmn2.FlowElement)3 SubProcess (org.eclipse.bpmn2.SubProcess)3 AtlasConversionException (io.atlasmap.api.AtlasConversionException)2