Search in sources :

Example 1 with CamundaExpression

use of org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression in project camunda-bpm-platform by camunda.

the class ItemHandler method getExpressionValue.

protected Expression getExpressionValue(CamundaField field, ExpressionManager expressionManager) {
    CamundaExpression expression = field.getCamundaExpressionChild();
    String value = null;
    if (expression != null) {
        value = expression.getTextContent();
    }
    if (value == null) {
        value = field.getCamundaExpression();
    }
    if (value != null) {
        return expressionManager.createExpression(value);
    }
    return null;
}
Also used : CamundaExpression(org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression) CamundaString(org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)

Example 2 with CamundaExpression

use of org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression in project camunda-bpm-platform by camunda.

the class FieldSpec method addFieldToListenerElement.

public void addFieldToListenerElement(CmmnModelInstance modelInstance, CamundaCaseExecutionListener listenerElement) {
    CamundaField field = SpecUtil.createElement(modelInstance, listenerElement, null, CamundaField.class);
    field.setCamundaName(fieldName);
    if (expression != null) {
        field.setCamundaExpression(expression);
    } else if (childExpression != null) {
        CamundaExpression fieldExpressionChild = SpecUtil.createElement(modelInstance, field, null, CamundaExpression.class);
        fieldExpressionChild.setTextContent(childExpression);
    } else if (stringValue != null) {
        field.setCamundaStringValue(stringValue);
    } else if (childStringValue != null) {
        CamundaString fieldExpressionChild = SpecUtil.createElement(modelInstance, field, null, CamundaString.class);
        fieldExpressionChild.setTextContent(childStringValue);
    }
}
Also used : CamundaField(org.camunda.bpm.model.cmmn.instance.camunda.CamundaField) CamundaExpression(org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression) CamundaString(org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)

Example 3 with CamundaExpression

use of org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression in project camunda-cmmn-model by camunda.

the class CamundaExpressionImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaExpression.class, CAMUNDA_ELEMENT_EXPRESSION).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaExpression>() {

        public CamundaExpression newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaExpressionImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : CamundaExpression(org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

CamundaExpression (org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression)3 CamundaString (org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)2 CamundaField (org.camunda.bpm.model.cmmn.instance.camunda.CamundaField)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1