public override void verifyListener <T1>(DelegateListener <T1> listener) where T1 : [email protected] { assertTrue(listener is ClassDelegateCaseExecutionListener); ClassDelegateCaseExecutionListener classDelegateListener = (ClassDelegateCaseExecutionListener)listener; assertEquals(CLASS_NAME, classDelegateListener.ClassName); IList <FieldDeclaration> fieldDeclarations = classDelegateListener.FieldDeclarations; assertEquals(fieldSpecs.Count, fieldDeclarations.Count); for (int i = 0; i < fieldDeclarations.Count; i++) { FieldDeclaration declaration = fieldDeclarations[i]; FieldSpec matchingFieldSpec = fieldSpecs[i]; matchingFieldSpec.verify(declaration); } }
protected internal virtual CaseExecutionListener initializeCaseExecutionListener(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaCaseExecutionListener listener) { ICollection <CamundaField> fields = listener.CamundaFields; IList <FieldDeclaration> fieldDeclarations = initializeFieldDeclarations(element, activity, context, fields); ExpressionManager expressionManager = context.ExpressionManager; CaseExecutionListener caseExecutionListener = null; string className = listener.CamundaClass; string expression = listener.CamundaExpression; string delegateExpression = listener.CamundaDelegateExpression; CamundaScript scriptElement = listener.CamundaScript; if (!string.ReferenceEquals(className, null)) { caseExecutionListener = new ClassDelegateCaseExecutionListener(className, fieldDeclarations); } else if (!string.ReferenceEquals(expression, null)) { Expression expressionExp = expressionManager.createExpression(expression); caseExecutionListener = new ExpressionCaseExecutionListener(expressionExp); } else if (!string.ReferenceEquals(delegateExpression, null)) { Expression delegateExp = expressionManager.createExpression(delegateExpression); caseExecutionListener = new DelegateExpressionCaseExecutionListener(delegateExp, fieldDeclarations); } else if (scriptElement != null) { ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement); if (executableScript != null) { caseExecutionListener = new ScriptCaseExecutionListener(executableScript); } } return(caseExecutionListener); }