public void HandleResponse(WorldObject invoker, int optionSelected, WorldObject associateOverride = null) { var invocation = new ScriptInvocation(); invocation.Invoker = invoker; if (Sequence.Associate != null) { invocation.Associate = Sequence.Associate; } else { invocation.Associate = associateOverride; } // If the individual options don't have callbacks, use the dialog callback instead. if (Handler != null && Options[optionSelected - 1].CallbackFunction == null) { invocation.Function = Handler; } else if (Options[optionSelected - 1].CallbackFunction != null) { invocation.Function = Options[optionSelected - 1].CallbackFunction; } invocation.Execute(optionSelected); }
public void ShowTo(User invoker, VisibleObject target = null, bool runCheck = true) { // Either we must have an associate already known to us, one must be passed, or we must have a script defined if (Associate == null && target == null && Script == null) { Logger.ErrorFormat("DialogSequence {0} has no known associate or script...?", Name); // Need better error handling here return; } if (PreDisplayCallback != null && runCheck) { var invocation = new ScriptInvocation(); invocation.Function = PreDisplayCallback; invocation.Invoker = invoker; invocation.Associate = target == null ? Associate : target; if (Script != null) invocation.Script = Script; if (invocation.Execute()) Dialogs.First().ShowTo(invoker, target); } else { Dialogs.First().ShowTo(invoker, target); } }
public void ShowTo(User invoker, VisibleObject target = null, bool runCheck = true) { // Either we must have an associate already known to us, one must be passed, or we must have a script defined if (Associate == null && target == null && Script == null) { Logger.ErrorFormat("DialogSequence {0} has no known associate or script...?", Name); // Need better error handling here return; } if (PreDisplayCallback != null && runCheck) { var invocation = new ScriptInvocation(); invocation.Function = PreDisplayCallback; invocation.Invoker = invoker; invocation.Associate = target == null ? Associate : target; if (Script != null) { invocation.Script = Script; } if (invocation.Execute()) { Dialogs.First().ShowTo(invoker, target); } } else { Dialogs.First().ShowTo(invoker, target); } }
public virtual void Notify(IDelegateCaseVariableInstance variableInstance) { var variableInstanceImpl = (DelegateCaseVariableInstanceImpl)variableInstance; var invocation = new ScriptInvocation(script, variableInstanceImpl.ScopeExecution); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public Void call() throws Exception public override Void call() { ScriptInvocation invocation = new ScriptInvocation(outerInstance.script, execution); Context.ProcessEngineConfiguration.DelegateInterceptor.handleInvocation(invocation); object result = invocation.InvocationResult; if (result != null && !string.ReferenceEquals(outerInstance.resultVariable, null)) { execution.setVariable(outerInstance.resultVariable, result); } outerInstance.leave(execution); return(null); }
public void RunCallback(User target, VisibleObject associateOverride = null) { if (CallbackFunction != null) { VisibleObject associate = associateOverride == null ? Sequence.Associate as VisibleObject : associateOverride; var invocation = new ScriptInvocation(); invocation.Invoker = target; invocation.Associate = associate; invocation.Function = CallbackFunction; associate.Script.ExecuteFunction(invocation); } }
protected override void PerformExecution(IActivityExecution execution) { ExecuteWithErrorPropagation(execution, () => { var invocation = new ScriptInvocation(script, execution); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); var result = invocation.InvocationResult; if (result != null && !ReferenceEquals(ResultVariable, null)) { execution.SetVariable(ResultVariable, result); } Leave(execution); }); }
public virtual void notify(DelegateTask delegateTask) { ScriptInvocation invocation = new ScriptInvocation(script, delegateTask); try { Context.ProcessEngineConfiguration.DelegateInterceptor.handleInvocation(invocation); } catch (Exception e) { throw e; } catch (Exception e) { throw new ProcessEngineException(e); } }
public virtual object getValue(VariableScope variableScope) { ScriptInvocation invocation = new ScriptInvocation(script, variableScope); try { Context.ProcessEngineConfiguration.DelegateInterceptor.handleInvocation(invocation); } catch (Exception e) { throw e; } catch (Exception e) { throw new ProcessEngineException(e); } return(invocation.InvocationResult); }
public void HandleResponse(WorldObject invoker, String response, WorldObject associateOverride = null) { Logger.DebugFormat("Response {0} from player {1}", response, invoker.Name); if (Handler != null) { // Either we must have an associate already known to us, one must be passed, or we must have a script defined if (Sequence.Associate == null && associateOverride == null && Sequence.Script == null) { Logger.ErrorFormat("InputDialog has no known associate or script...?"); // Need better error handling here return; } var invocation = new ScriptInvocation(); invocation.Function = Handler; invocation.Associate = associateOverride == null ? Sequence.Associate : associateOverride; invocation.Invoker = invoker; invocation.Execute(response); } }
public Object GetValue(IVariableScope variableScope) { ScriptInvocation invocation = new ScriptInvocation(script, variableScope); try { Context .ProcessEngineConfiguration .DelegateInterceptor .HandleInvocation(invocation); } catch (RuntimeException e) { throw e; } catch (System.Exception e) { throw new ProcessEngineException(e); } return(invocation.InvocationResult); }
protected internal virtual object executeScript(string scriptSrc, VariableScope scope) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; ScriptFactory scriptFactory = processEngineConfiguration.ScriptFactory; ExecutableScript script = scriptFactory.createScriptFromSource(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, scriptSrc); ScriptInvocation invocation = new ScriptInvocation(script, scope); try { processEngineConfiguration.DelegateInterceptor.handleInvocation(invocation); } catch (Exception e) { throw e; } catch (Exception e) { throw new ProcessEngineException(e); } return(invocation.InvocationResult); }
public virtual bool evaluate(VariableScope scope, DelegateExecution execution) { ScriptInvocation invocation = new ScriptInvocation(script, scope, execution); try { Context.ProcessEngineConfiguration.DelegateInterceptor.handleInvocation(invocation); } catch (Exception e) { throw e; } catch (Exception e) { throw new ProcessEngineException(e); } object result = invocation.InvocationResult; ensureNotNull("condition script returns null", "result", result); ensureInstanceOf("condition script returns non-Boolean", "result", result, typeof(Boolean)); return((bool?)result.Value); }
public virtual void Notify(IBaseDelegateExecution execution) { var invocation = new ScriptInvocation(script, execution); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); }
public virtual void Notify(IDelegateTask delegateTask) { var invocation = new ScriptInvocation(script, delegateTask); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); }
public void HandleResponse(WorldObject invoker, int optionSelected, WorldObject associateOverride = null) { var invocation = new ScriptInvocation(); invocation.Invoker = invoker; if (Sequence.Associate != null) invocation.Associate = Sequence.Associate; else invocation.Associate = associateOverride; // If the individual options don't have callbacks, use the dialog callback instead. if (Handler != null && Options[optionSelected - 1].CallbackFunction == null) { invocation.Function = Handler; } else if (Options[optionSelected - 1].CallbackFunction != null) { invocation.Function = Options[optionSelected - 1].CallbackFunction; } invocation.Execute(optionSelected); }