Search in sources :

Example 1 with Property

use of org.eclipse.bpmn2.Property in project atlasmap by atlasmap.

the class DefaultAtlasFieldActionService method detectFieldActionParameters.

protected Properties detectFieldActionParameters(String actionClassName) throws ClassNotFoundException {
    Class<?> actionClazz = Class.forName(actionClassName);
    Properties props = null;
    for (Method method : actionClazz.getMethods()) {
        // Find setters to avoid the get / is confusion
        if (method.getParameterCount() == 1 && method.getName().startsWith("set")) {
            // We have a parameter
            if (props == null) {
                props = new Properties();
            }
            Property prop = null;
            for (Parameter param : method.getParameters()) {
                prop = new Property();
                prop.setName(camelize(method.getName().substring("set".length())));
                prop.setFieldType(getConversionService().fieldTypeFromClass(param.getType()));
                props.getProperty().add(prop);
            }
        }
    }
    return props;
}
Also used : Parameter(java.lang.reflect.Parameter) Method(java.lang.reflect.Method) Properties(io.atlasmap.v2.Properties) Property(io.atlasmap.v2.Property)

Example 2 with Property

use of org.eclipse.bpmn2.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 3 with Property

use of org.eclipse.bpmn2.Property in project atlasmap by atlasmap.

the class DefaultAtlasFieldActionsServiceTest method testListActionDetails.

@Test
public void testListActionDetails() {
    assertNotNull(fieldActionsService);
    List<ActionDetail> actionDetails = fieldActionsService.listActionDetails();
    for (ActionDetail d : actionDetails) {
        if (d.getParameters() != null) {
            System.out.println("Action: " + d.getName());
            for (Property prop : d.getParameters().getProperty()) {
                System.out.println("\t param: " + prop.getName());
                System.out.println("\t type: " + prop.getFieldType().value());
            }
        }
    }
}
Also used : ActionDetail(io.atlasmap.v2.ActionDetail) Property(io.atlasmap.v2.Property) Test(org.junit.Test)

Example 4 with Property

use of org.eclipse.bpmn2.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 5 with Property

use of org.eclipse.bpmn2.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)

Aggregations

Property (org.eclipse.bpmn2.Property)9 Property (io.atlasmap.v2.Property)7 ArrayList (java.util.ArrayList)7 Process (org.eclipse.bpmn2.Process)7 RootElement (org.eclipse.bpmn2.RootElement)6 Properties (io.atlasmap.v2.Properties)5 DataInputAssociation (org.eclipse.bpmn2.DataInputAssociation)5 DataOutputAssociation (org.eclipse.bpmn2.DataOutputAssociation)5 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)5 List (java.util.List)4 DataInput (org.eclipse.bpmn2.DataInput)4 DataOutput (org.eclipse.bpmn2.DataOutput)4 FormalExpression (org.eclipse.bpmn2.FormalExpression)4 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)3 Definitions (org.eclipse.bpmn2.Definitions)3 FlowElement (org.eclipse.bpmn2.FlowElement)3 SubProcess (org.eclipse.bpmn2.SubProcess)3 Test (org.junit.Test)3 FloatingParameterType (bpsim.FloatingParameterType)2 Parameter (bpsim.Parameter)2