Beispiel #1
0
        private void m_lnkTest_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //Cherche le workflow de test
            CWorkflow wkf = new CWorkflow(TypeWorkflow.ContexteDonnee);

            if (!wkf.ReadIfExists(new CFiltreData(
                                      CTypeWorkflow.c_champId + "=@1",
                                      TypeWorkflow.Id)))
            {
                wkf.CreateNew();
                wkf.TypeWorkflow = TypeWorkflow;
                foreach (CTypeEtapeWorkflow typeEtape in TypeWorkflow.Etapes)
                {
                    CEtapeWorkflow etape = new CEtapeWorkflow(wkf.ContexteDonnee);
                    etape.CreateNewInCurrentContexte();
                    etape.Workflow  = wkf;
                    etape.TypeEtape = typeEtape;
                }
                CResultAErreur result = wkf.CommitEdit();
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
            }
            foreach (CEtapeWorkflow etape in wkf.Etapes)
            {
                if (etape.TypeEtape.Bloc is CBlocWorkflowFormulaire)
                {
                    CGestionnaireWorkflowsEnCours.Instance.AfficheEtape(etape);
                }
            }
        }