Search in sources :

Example 1 with FixedValue

use of org.activiti.engine.impl.el.FixedValue in project Activiti by Activiti.

the class AbstractBehaviorFactory method createFieldDeclarations.

public List<FieldDeclaration> createFieldDeclarations(List<FieldExtension> fieldList) {
    List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();
    for (FieldExtension fieldExtension : fieldList) {
        FieldDeclaration fieldDeclaration = null;
        if (StringUtils.isNotEmpty(fieldExtension.getExpression())) {
            fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(), expressionManager.createExpression(fieldExtension.getExpression()));
        } else {
            fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(), new FixedValue(fieldExtension.getStringValue()));
        }
        fieldDeclarations.add(fieldDeclaration);
    }
    return fieldDeclarations;
}
Also used : FieldExtension(org.activiti.bpmn.model.FieldExtension) ArrayList(java.util.ArrayList) FixedValue(org.activiti.engine.impl.el.FixedValue) FieldDeclaration(org.activiti.engine.impl.bpmn.parser.FieldDeclaration)

Example 2 with FixedValue

use of org.activiti.engine.impl.el.FixedValue in project Activiti by Activiti.

the class BpmnMessagePayloadMappingProviderFactory method createFieldDeclarations.

public List<FieldDeclaration> createFieldDeclarations(List<FieldExtension> fieldList, ExpressionManager expressionManager) {
    List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();
    for (FieldExtension fieldExtension : fieldList) {
        FieldDeclaration fieldDeclaration = null;
        if (StringUtils.isNotEmpty(fieldExtension.getExpression())) {
            fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(), expressionManager.createExpression(fieldExtension.getExpression()));
        } else {
            fieldDeclaration = new FieldDeclaration(fieldExtension.getFieldName(), Expression.class.getName(), new FixedValue(fieldExtension.getStringValue()));
        }
        fieldDeclarations.add(fieldDeclaration);
    }
    return fieldDeclarations;
}
Also used : FieldExtension(org.activiti.bpmn.model.FieldExtension) ArrayList(java.util.ArrayList) FixedValue(org.activiti.engine.impl.el.FixedValue) FieldDeclaration(org.activiti.engine.impl.bpmn.parser.FieldDeclaration)

Example 3 with FixedValue

use of org.activiti.engine.impl.el.FixedValue in project Activiti by Activiti.

the class TestActivityBehaviorFactory method createNoOpServiceTask.

private ClassDelegate createNoOpServiceTask(ServiceTask serviceTask) {
    List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();
    fieldDeclarations.add(new FieldDeclaration("name", Expression.class.getName(), new FixedValue(serviceTask.getImplementation())));
    return new ClassDelegate(NoOpServiceTask.class, fieldDeclarations);
}
Also used : ArrayList(java.util.ArrayList) FixedValue(org.activiti.engine.impl.el.FixedValue) ClassDelegate(org.activiti.engine.impl.bpmn.helper.ClassDelegate) FieldDeclaration(org.activiti.engine.impl.bpmn.parser.FieldDeclaration)

Aggregations

ArrayList (java.util.ArrayList)3 FieldDeclaration (org.activiti.engine.impl.bpmn.parser.FieldDeclaration)3 FixedValue (org.activiti.engine.impl.el.FixedValue)3 FieldExtension (org.activiti.bpmn.model.FieldExtension)2 ClassDelegate (org.activiti.engine.impl.bpmn.helper.ClassDelegate)1