Пример #1
0
		private void CopyInterpreterToAttributes(InteractiveInterpreter interpreter,
												IActionContext context)
		{
			IDictionaryEnumerator configEnum;
			configEnum=context.GetConfiguration().GetEnumerator();
			while(configEnum.MoveNext())
			{
				DictionaryEntry property;
				property = (DictionaryEntry)configEnum.Current;
				if (!property.Key.Equals("script"))
				{
					object attributeValue = context.GetAttribute((String)property.Key);
					object interpreterValue = interpreter.GetValue((String)property.Key);
					// Change the attribute only if the value changed and is marked for copying
					if (!property.Key.Equals("script") && attributeValue != null 
						&& ! attributeValue.Equals(interpreterValue)
						&& property.Value.ToString().IndexOf("Out")!=-1 )
					{
						if (log.IsDebugEnabled)
						{
							log.Debug("copy from <-interpreter key:"+property.Key+" oldvalue:"+attributeValue+ " newvalue:"+interpreterValue);
						}
						context.SetAttribute((String)property.Key,interpreterValue);
					}
				}
			}
		}
Пример #2
0
        private void CopyInterpreterToAttributes(InteractiveInterpreter interpreter,
                                                 IActionContext context)
        {
            IDictionaryEnumerator configEnum;

            configEnum = context.GetConfiguration().GetEnumerator();
            while (configEnum.MoveNext())
            {
                DictionaryEntry property;
                property = (DictionaryEntry)configEnum.Current;
                if (!property.Key.Equals("script"))
                {
                    object attributeValue   = context.GetAttribute((String)property.Key);
                    object interpreterValue = interpreter.GetValue((String)property.Key);
                    // Change the attribute only if the value changed and is marked for copying
                    if (!property.Key.Equals("script") && attributeValue != null &&
                        !attributeValue.Equals(interpreterValue) &&
                        property.Value.ToString().IndexOf("Out") != -1)
                    {
                        if (log.IsDebugEnabled)
                        {
                            log.Debug("copy from <-interpreter key:" + property.Key + " oldvalue:" + attributeValue + " newvalue:" + interpreterValue);
                        }
                        context.SetAttribute((String)property.Key, interpreterValue);
                    }
                }
            }
        }
Пример #3
0
		public void Run(IActionContext actionContext)
		{
			InteractiveInterpreter interpreter = new InteractiveInterpreter();

			IDictionary configuration = actionContext.GetConfiguration();
			String script = (String) configuration["script"];
			if (script == null)
			{
				throw new ArgumentException("Can’t find boo script in configuration! Please check processdefiniton.xml if action defines <parameter name = \"script\">");
			}

			CopyAttributesToInterpreter(interpreter,actionContext);
			interpreter.Eval(script);
			CopyInterpreterToAttributes(interpreter,actionContext);
		}
Пример #4
0
        public void Run(IActionContext actionContext)
        {
            InteractiveInterpreter interpreter = new InteractiveInterpreter();

            IDictionary configuration = actionContext.GetConfiguration();
            String      script        = (String)configuration["script"];

            if (script == null)
            {
                throw new ArgumentException("Can’t find boo script in configuration! Please check processdefiniton.xml if action defines <parameter name = \"script\">");
            }

            CopyAttributesToInterpreter(interpreter, actionContext);
            interpreter.Eval(script);
            CopyInterpreterToAttributes(interpreter, actionContext);
        }
Пример #5
0
		private void CopyAttributesToInterpreter(InteractiveInterpreter interpreter,
												IActionContext context)
		{
			IDictionaryEnumerator configEnum;
			configEnum=context.GetConfiguration().GetEnumerator();
			while(configEnum.MoveNext())
			{
				DictionaryEntry property;
				property = (DictionaryEntry)configEnum.Current;
				if (!property.Key.Equals("script") && property.Value.ToString().IndexOf("In")!=-1)
				{
					object attributeValue;
					attributeValue = context.GetAttribute((String)property.Key);
					if (log.IsDebugEnabled)
					{
						log.Debug("copy to ->interpreter key:"+property.Key+" value:"+attributeValue);
					}
					interpreter.SetValue((String)property.Key,attributeValue);
				}
			}
		}
Пример #6
0
        private void CopyAttributesToInterpreter(InteractiveInterpreter interpreter,
                                                 IActionContext context)
        {
            IDictionaryEnumerator configEnum;

            configEnum = context.GetConfiguration().GetEnumerator();
            while (configEnum.MoveNext())
            {
                DictionaryEntry property;
                property = (DictionaryEntry)configEnum.Current;
                if (!property.Key.Equals("script") && property.Value.ToString().IndexOf("In") != -1)
                {
                    object attributeValue;
                    attributeValue = context.GetAttribute((String)property.Key);
                    if (log.IsDebugEnabled)
                    {
                        log.Debug("copy to ->interpreter key:" + property.Key + " value:" + attributeValue);
                    }
                    interpreter.SetValue((String)property.Key, attributeValue);
                }
            }
        }
Пример #7
0
		public void Run(IActionContext actionContext)
		{
			IDictionary configuration = actionContext.GetConfiguration();
			String subject = (String) configuration["subject"];
			String message = (String) configuration["message"];
			String from = (String) configuration["from"];
			String to = (String) configuration["to"];

			// resolving the texts
			subject = _attributeExpressionResolver.ResolveAttributeExpression(subject, actionContext);
			message = _attributeExpressionResolver.ResolveAttributeExpression(message, actionContext);
			IUser user = (IUser) _actorExpressionResolver.ResolveArgument(to, actionContext);
			to = user.Email;
			if ((Object) from == null)
			{
				from = actionContext.GetProcessDefinition().Name;
				from = from.ToLower();
				from = from.Replace(' ', '.');
				from += "@netbpm.org";
			}

			SendMail(from, to, subject, message, actionContext);
		}
Пример #8
0
        public void Run(IActionContext actionContext)
        {
            IDictionary configuration = actionContext.GetConfiguration();
            String      subject       = (String)configuration["subject"];
            String      message       = (String)configuration["message"];
            String      from          = (String)configuration["from"];
            String      to            = (String)configuration["to"];

            // resolving the texts
            subject = _attributeExpressionResolver.ResolveAttributeExpression(subject, actionContext);
            message = _attributeExpressionResolver.ResolveAttributeExpression(message, actionContext);
            IUser user = (IUser)_actorExpressionResolver.ResolveArgument(to, actionContext);

            to = user.Email;
            if ((Object)from == null)
            {
                from  = actionContext.GetProcessDefinition().Name;
                from  = from.ToLower();
                from  = from.Replace(' ', '.');
                from += "@netbpm.org";
            }

            SendMail(from, to, subject, message, actionContext);
        }