public CResultAErreurType <CAffectationsEtapeWorkflow> CalculeAffectations(CWorkflow workflow)
        {
            CResultAErreurType <CAffectationsEtapeWorkflow> resultAff = new CResultAErreurType <CAffectationsEtapeWorkflow>();

            resultAff.Result = true;

            CAffectationsEtapeWorkflow    affectations = new CAffectationsEtapeWorkflow();
            CContexteEvaluationExpression ctx          = new CContexteEvaluationExpression(workflow);

            foreach (CFormuleNommee formule in Formules)
            {
                CResultAErreur result = formule.Formule.Eval(ctx);
                if (result)
                {
                    if (result.Data is IAffectableAEtape)
                    {
                        affectations.AddAffectable(result.Data as IAffectableAEtape);
                    }
                    else if (result.Data is IEnumerable)
                    {
                        foreach (object obj in (IEnumerable)result.Data)
                        {
                            IAffectableAEtape a = obj as IAffectableAEtape;
                            if (a != null)
                            {
                                affectations.AddAffectable(a);
                            }
                        }
                    }
                }
            }
            resultAff.DataType = affectations;
            return(resultAff);
        }
예제 #2
0
        public void RemoveAssignment(IAffectableAEtape affectable)
        {
            if (affectable == null)
            {
                return;
            }
            CAffectationsEtapeWorkflow aff = Affectations;

            aff.RemoveAffectable(affectable);
            Affectations = aff;
        }
예제 #3
0
        public static CAffectationsEtapeWorkflow FromCode(string strCode)
        {
            CAffectationsEtapeWorkflow aff = new CAffectationsEtapeWorkflow();

            string[] strCodes = strCode.Split(c_strSepGen);
            foreach (string strCle in strCodes)
            {
                if (strCle.Trim() != "")
                {
                    aff.m_listeStringAffectations.Add(strCle);
                }
            }
            return(aff);
        }