protected ConditionalEventDefinition parseConditionalEventDefinition ( Element element , ActivityImpl conditionalActivity ) { ConditionalEventDefinition conditionalEventDefinition = null ; Element conditionExprElement = element . element ( CONDITION ) ; if ( conditionExprElement != null ) { Condition condition = parseConditionExpression ( conditionExprElement ) ; conditionalEventDefinition = new ConditionalEventDefinition ( condition , conditionalActivity ) ; String expression = conditionExprElement . getText ( ) . trim ( ) ; conditionalEventDefinition . setConditionAsString ( expression ) ; conditionalActivity . getProcessDefinition ( ) . getProperties ( ) . set ( BpmnProperties . HAS_CONDITIONAL_EVENTS , true ) ; final String variableName = element . attributeNS ( CAMUNDA_BPMN_EXTENSIONS_NS , "variableName" ) ; conditionalEventDefinition . setVariableName ( variableName ) ; final String variableEvents = element . attributeNS ( CAMUNDA_BPMN_EXTENSIONS_NS , "variableEvents" ) ; final List < String > variableEventsList = parseCommaSeparatedList ( variableEvents ) ; conditionalEventDefinition . setVariableEvents ( new HashSet < String > ( variableEventsList ) ) ; for ( String variableEvent : variableEventsList ) { if ( ! VARIABLE_EVENTS . contains ( variableEvent ) ) { addWarning ( "Variable event: " + variableEvent + " is not valid. Possible variable change events are: " + Arrays . toString ( VARIABLE_EVENTS . toArray ( ) ) , element ) ; } } } else { addError ( "Conditional event must contain an expression for evaluation." , element ) ; } return conditionalEventDefinition ; }
Parses the given element and returns an ConditionalEventDefinition object .