Search in sources :

Example 6 with CamundaField

use of org.camunda.bpm.model.cmmn.instance.camunda.CamundaField 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 7 with CamundaField

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

the class CamundaFieldImpl method registerType.

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

        public CamundaField newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaFieldImpl(instanceContext);
        }
    });
    camundaNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_NAME).namespace(CAMUNDA_NS).build();
    camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION).namespace(CAMUNDA_NS).build();
    camundaStringValueAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_STRING_VALUE).namespace(CAMUNDA_NS).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    camundaExpressionChild = sequenceBuilder.element(CamundaExpression.class).build();
    camundaStringChild = sequenceBuilder.element(CamundaString.class).build();
    typeBuilder.build();
}
Also used : CamundaField(org.camunda.bpm.model.cmmn.instance.camunda.CamundaField) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

CamundaField (org.camunda.bpm.model.cmmn.instance.camunda.CamundaField)7 Expression (org.camunda.bpm.engine.delegate.Expression)4 FieldDeclaration (org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration)4 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)3 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)3 CamundaExpression (org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression)3 CamundaScript (org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript)3 CamundaString (org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)3 CaseVariableListener (org.camunda.bpm.engine.delegate.CaseVariableListener)2 ClassDelegateCaseVariableListener (org.camunda.bpm.engine.impl.variable.listener.ClassDelegateCaseVariableListener)2 DelegateExpressionCaseVariableListener (org.camunda.bpm.engine.impl.variable.listener.DelegateExpressionCaseVariableListener)2 ExpressionCaseVariableListener (org.camunda.bpm.engine.impl.variable.listener.ExpressionCaseVariableListener)2 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)2 ArrayList (java.util.ArrayList)1 CaseExecutionListener (org.camunda.bpm.engine.delegate.CaseExecutionListener)1 TaskListener (org.camunda.bpm.engine.delegate.TaskListener)1 VariableListener (org.camunda.bpm.engine.delegate.VariableListener)1 ClassDelegateCaseExecutionListener (org.camunda.bpm.engine.impl.cmmn.listener.ClassDelegateCaseExecutionListener)1 DelegateExpressionCaseExecutionListener (org.camunda.bpm.engine.impl.cmmn.listener.DelegateExpressionCaseExecutionListener)1 ExpressionCaseExecutionListener (org.camunda.bpm.engine.impl.cmmn.listener.ExpressionCaseExecutionListener)1