Search in sources :

Example 11 with Property

use of io.atlasmap.v2.Property in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateProperties.

private void generateProperties(AtlasMapping mapping) {
    Property p = new Property();
    p.setName("foo");
    p.setValue("bar");
    p.setFieldType(FieldType.INTEGER);
    mapping.setProperties(new Properties());
    mapping.getProperties().getProperty().add(p);
}
Also used : Properties(io.atlasmap.v2.Properties) Property(io.atlasmap.v2.Property)

Example 12 with Property

use of io.atlasmap.v2.Property in project atlasmap by atlasmap.

the class JsonMarshallerTest method testComplexRequests.

@Test
public void testComplexRequests() throws Exception {
    runJSONSerializationTest(generatePropertyReferenceMapping(), "atlasmapping-property-request.json");
    runJSONSerializationTest(generateConstantMapping(), "atlasmapping-constant-request.json");
    runJSONSerializationTest(generateMultiSourceMapping(), "atlasmapping-multisource-request.json");
    runJSONSerializationTest(generateCollectionMapping(), "atlasmapping-collection-request.json");
    runJSONSerializationTest(generateCombineMapping(), "atlasmapping-combine-request.json");
    runJSONSerializationTest(generateActionMapping(), "atlasmapping-field-action-request.json");
    AtlasMapping action = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-field-action-request.json"), AtlasMapping.class);
    assertNotNull(action);
    validateAtlasMapping(action);
    AtlasMapping collection = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-collection-request.json"), AtlasMapping.class);
    assertNotNull(collection);
    validateCollectionAtlasMapping(collection);
    AtlasMapping multisource = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-multisource-request.json"), AtlasMapping.class);
    assertNotNull(multisource);
    validateMultisourceAtlasMapping(multisource);
    AtlasMapping propertyMapping = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-property-request.json"), AtlasMapping.class);
    assertNotNull(propertyMapping);
    validatePropertyAtlasMapping(propertyMapping);
    AtlasMapping constantMapping = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-constant-request.json"), AtlasMapping.class);
    assertNotNull(constantMapping);
    validateConstantAtlasMapping(constantMapping);
    AtlasMapping combineAtlasMapping = mapper.readValue(new File("target" + File.separator + "junit" + File.separator + testMethodName + File.separator + "atlasmapping-combine-request.json"), AtlasMapping.class);
    assertNotNull(combineAtlasMapping);
    validateCombineAtlasMapping(combineAtlasMapping);
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 13 with Property

use of io.atlasmap.v2.Property in project atlasmap by atlasmap.

the class AtlasTestData method generateAtlasProperties.

public static List<Property> generateAtlasProperties() {
    List<Property> props = new ArrayList<Property>();
    Property p = new Property();
    p.setName("prop-boolean");
    p.setValue("false");
    p.setFieldType(FieldType.BOOLEAN);
    props.add(p);
    p = new Property();
    p.setName("prop-byte");
    p.setValue("92");
    p.setFieldType(FieldType.BYTE);
    props.add(p);
    p = new Property();
    p.setName("prop-char");
    p.setValue("z");
    p.setFieldType(FieldType.CHAR);
    props.add(p);
    p = new Property();
    p.setName("prop-double");
    p.setValue(Double.toString(Double.MIN_VALUE));
    p.setFieldType(FieldType.DOUBLE);
    props.add(p);
    p = new Property();
    p.setName("prop-float");
    p.setValue(Float.toString(Float.MIN_VALUE));
    p.setFieldType(FieldType.FLOAT);
    props.add(p);
    p = new Property();
    p.setName("prop-int");
    p.setValue(Integer.toString(Integer.MIN_VALUE));
    p.setFieldType(FieldType.INTEGER);
    props.add(p);
    p = new Property();
    p.setName("prop-long");
    p.setValue(Long.toString(Long.MIN_VALUE));
    p.setFieldType(FieldType.LONG);
    props.add(p);
    p = new Property();
    p.setName("prop-short");
    p.setValue(Short.toString(Short.MIN_VALUE));
    p.setFieldType(FieldType.SHORT);
    props.add(p);
    p = new Property();
    p.setName("prop-string");
    p.setValue("helloworld");
    p.setFieldType(FieldType.STRING);
    props.add(p);
    p = new Property();
    p.setName("dupe-string");
    p.setValue("whatup");
    p.setFieldType(FieldType.STRING);
    props.add(p);
    return props;
}
Also used : ArrayList(java.util.ArrayList) Property(io.atlasmap.v2.Property)

Example 14 with Property

use of io.atlasmap.v2.Property in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateProperties.

private void generateProperties(AtlasMapping atlasMapping) {
    Property p = new Property();
    p.setName("foo");
    p.setValue("bar");
    p.setFieldType(FieldType.INTEGER);
    atlasMapping.setProperties(new Properties());
    atlasMapping.getProperties().getProperty().add(p);
}
Also used : Properties(io.atlasmap.v2.Properties) Property(io.atlasmap.v2.Property)

Example 15 with Property

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

the class MultipleInstanceActivityPropertyWriter method setCollectionInput.

public void setCollectionInput(String collectionInput) {
    if (isEmpty(collectionInput)) {
        return;
    }
    setUpLoopCharacteristics();
    String suffix = "IN_COLLECTION";
    String id = Ids.dataInput(activity.getId(), suffix);
    DataInput dataInputElement = createDataInput(id, suffix);
    ioSpec.getDataInputs().add(dataInputElement);
    // check whether this exist
    Optional<Property> property = findPropertyById(collectionInput);
    Optional<DataObject> dataObject = findDataObjectById(collectionInput);
    if (property.isPresent()) {
        processDataInput(dataInputElement, property.get());
    } else if (dataObject.isPresent()) {
        processDataInput(dataInputElement, dataObject.get());
    }
}
Also used : DataInput(org.eclipse.bpmn2.DataInput) DataObject(org.eclipse.bpmn2.DataObject) 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