protected internal virtual IActivityBehavior CreateMuleActivityBehavior(TaskWithFieldExtensions task, IList <FieldExtension> fieldExtensions)
 {
     try
     {
         Type theClass = Type.GetType("Sys.Workflow.Mule.MuleSendActivitiBehavior");
         IList <FieldDeclaration> fieldDeclarations = CreateFieldDeclarations(fieldExtensions);
         return((IActivityBehavior)ClassDelegate.DefaultInstantiateDelegate(theClass, fieldDeclarations));
     }
     catch (Exception e)
     {
         throw new ActivitiException("Could not find Sys.Workflow.Mule.MuleSendActivitiBehavior: ", e);
     }
 }
        protected internal virtual IActivityBehavior CreateCamelActivityBehavior(TaskWithFieldExtensions task, IList <FieldExtension> fieldExtensions)
        {
            try
            {
                Type           theClass          = null;
                FieldExtension behaviorExtension = null;
                foreach (FieldExtension fieldExtension in fieldExtensions)
                {
                    if ("camelBehaviorClass".Equals(fieldExtension.FieldName) && !string.IsNullOrWhiteSpace(fieldExtension.StringValue))
                    {
                        theClass          = Type.GetType(fieldExtension.StringValue);
                        behaviorExtension = fieldExtension;
                        break;
                    }
                }

                if (behaviorExtension != null)
                {
                    fieldExtensions.Remove(behaviorExtension);
                }

                if (theClass == null)
                {
                    // Default Camel behavior class
                    theClass = Type.GetType("Sys.Workflow.Camel.Impl.CamelBehaviorDefaultImpl");
                }

                IList <FieldDeclaration> fieldDeclarations = CreateFieldDeclarations(fieldExtensions);
                AddExceptionMapAsFieldDeclaration(fieldDeclarations, task.MapExceptions);
                return((IActivityBehavior)ClassDelegate.DefaultInstantiateDelegate(theClass, fieldDeclarations));
            }
            catch (Exception e)
            {
                throw new ActivitiException("Could not find Sys.Workflow.Camel.CamelBehavior: ", e);
            }
        }
Esempio n. 3
0
        protected internal virtual void ValidateFieldDeclarationsForShell(Process process, TaskWithFieldExtensions task, IList <FieldExtension> fieldExtensions, IList <ValidationError> errors)
        {
            bool shellCommandDefined = false;

            foreach (FieldExtension fieldExtension in fieldExtensions)
            {
                string fieldName  = fieldExtension.FieldName;
                string fieldValue = fieldExtension.StringValue;

                if (fieldName.Equals("command"))
                {
                    shellCommandDefined = true;
                }

                if ((fieldName.Equals("wait") || fieldName.Equals("redirectError") || fieldName.Equals("cleanEnv")) && !fieldValue.ToLower().Equals("true") && !fieldValue.ToLower().Equals("false"))
                {
                    AddError(errors, ProblemsConstants.SHELL_TASK_INVALID_PARAM, process, task, ProcessValidatorResource.SHELL_TASK_INVALID_PARAM);
                }
            }

            if (!shellCommandDefined)
            {
                AddError(errors, ProblemsConstants.SHELL_TASK_NO_COMMAND, process, task, ProcessValidatorResource.SHELL_TASK_NO_COMMAND);
            }
        }
Esempio n. 4
0
        protected internal virtual void ValidateFieldDeclarationsForDmn(Process process, TaskWithFieldExtensions task, IList <FieldExtension> fieldExtensions, IList <ValidationError> errors)
        {
            bool keyDefined = false;

            foreach (FieldExtension fieldExtension in fieldExtensions)
            {
                string fieldName  = fieldExtension.FieldName;
                string fieldValue = fieldExtension.StringValue;

                if (fieldName.Equals("decisionTableReferenceKey") && !string.IsNullOrWhiteSpace(fieldValue))
                {
                    keyDefined = true;
                }
            }

            if (!keyDefined)
            {
                AddError(errors, ProblemsConstants.DMN_TASK_NO_KEY, process, task, ProcessValidatorResource.DMN_TASK_NO_KEY);
            }
        }
Esempio n. 5
0
        protected internal virtual void ValidateFieldDeclarationsForEmail(Process process, TaskWithFieldExtensions task, IList <FieldExtension> fieldExtensions, IList <ValidationError> errors)
        {
            bool toDefined         = false;
            bool textOrHtmlDefined = false;

            foreach (FieldExtension fieldExtension in fieldExtensions)
            {
                if (fieldExtension.FieldName.Equals("to"))
                {
                    toDefined = true;
                }
                if (fieldExtension.FieldName.Equals("html"))
                {
                    textOrHtmlDefined = true;
                }
                if (fieldExtension.FieldName.Equals("htmlVar"))
                {
                    textOrHtmlDefined = true;
                }
                if (fieldExtension.FieldName.Equals("text"))
                {
                    textOrHtmlDefined = true;
                }
                if (fieldExtension.FieldName.Equals("textVar"))
                {
                    textOrHtmlDefined = true;
                }
            }

            if (!toDefined)
            {
                AddError(errors, ProblemsConstants.MAIL_TASK_NO_RECIPIENT, process, task, ProcessValidatorResource.MAIL_TASK_NO_RECIPIENT);
            }
            if (!textOrHtmlDefined)
            {
                AddError(errors, ProblemsConstants.MAIL_TASK_NO_CONTENT, process, task, ProcessValidatorResource.MAIL_TASK_NO_CONTENT);
            }
        }