//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Ignore("Test ignored. CAM-9441: Bug fix needed") @Test public void testOutputParameterScriptChildAssignment() public virtual void testOutputParameterScriptChildAssignment() { try { CamundaOutputParameter outputParamElement = modelInstance.newInstance(typeof(CamundaOutputParameter)); outputParamElement.CamundaName = "aVariable"; CamundaScript scriptElement = modelInstance.newInstance(typeof(CamundaScript)); scriptElement.CamundaScriptFormat = "juel"; scriptElement.TextContent = "${'a script'}"; outputParamElement.addChildElement(scriptElement); } catch (Exception e) { fail("CamundaScript should be accepted as a child element of CamundaOutputParameter. Error: " + e.Message); } }
protected internal virtual TaskListener initializeTaskListener(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaTaskListener listener) { ICollection <CamundaField> fields = listener.CamundaFields; IList <FieldDeclaration> fieldDeclarations = initializeFieldDeclarations(element, activity, context, fields); ExpressionManager expressionManager = context.ExpressionManager; TaskListener taskListener = null; string className = listener.CamundaClass; string expression = listener.CamundaExpression; string delegateExpression = listener.CamundaDelegateExpression; CamundaScript scriptElement = listener.CamundaScript; if (!string.ReferenceEquals(className, null)) { taskListener = new ClassDelegateTaskListener(className, fieldDeclarations); } else if (!string.ReferenceEquals(expression, null)) { Expression expressionExp = expressionManager.createExpression(expression); taskListener = new ExpressionTaskListener(expressionExp); } else if (!string.ReferenceEquals(delegateExpression, null)) { Expression delegateExp = expressionManager.createExpression(delegateExpression); taskListener = new DelegateExpressionTaskListener(delegateExp, fieldDeclarations); } else if (scriptElement != null) { ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement); if (executableScript != null) { taskListener = new ScriptTaskListener(executableScript); } } return(taskListener); }
protected internal virtual ExecutableScript initializeScript(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaScript script) { string language = script.CamundaScriptFormat; string resource = script.CamundaResource; string source = script.TextContent; if (string.ReferenceEquals(language, null)) { language = ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE; } try { return(ScriptUtil.getScript(language, source, resource, context.ExpressionManager)); } catch (ProcessEngineException) { // ignore return(null); } }