IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SharePoint .NET Discussion :

workflow + visual studio


Sujet :

SharePoint .NET

  1. #1
    Membre régulier
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2009
    Messages
    183
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Avril 2009
    Messages : 183
    Points : 79
    Points
    79
    Par défaut workflow + visual studio
    Salut tout le monde,

    je suis entrain d'essayer de deployer un workflow de validatin demande de conge.

    voici mon workflow sequentiel

    Nom : WS.jpg
Affichages : 128
Taille : 105,1 Ko


    voici mon code c #

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
     
     
    using System;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Collections;
    using System.Drawing;
    using System.Linq;
    using System.Workflow.ComponentModel.Compiler;
    using System.Workflow.ComponentModel.Serialization;
    using System.Workflow.ComponentModel;
    using System.Workflow.ComponentModel.Design;
    using System.Workflow.Runtime;
    using System.Workflow.Activities;
    using System.Workflow.Activities.Rules;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Workflow;
    using Microsoft.SharePoint.WorkflowActions;
     
    namespace SharePointWF.WF
    {
        public sealed partial class WF : SequentialWorkflowActivity
        {
            public WF()
            {
                InitializeComponent();
            }
            public String sendEmail1_Body1;
            public String sendEmail1_To1 ;
            public String sendEmail1_Subject1 ;
            SPWeb CurrentWeb = SPContext.Current.Web;
     
            public Guid workflowId = default(System.Guid);
            public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
            bool approvalStatusStillPending = true;
            // SPWeb CurrentWeb = SPContext.Current.Web;
            private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
            {
     
                ChekApprovalStatus();
            }
     
     
            private void ChekApprovalStatus()
            {
                //try
                // {
                string approvalStatus = workflowProperties.Item["Approval Status"].ToString();
                //approved 
                if (approvalStatus == "0")
                {
                    approvalStatusStillPending = false;
                }
                //rejected 
                else if (approvalStatus == "1")
                {
                    approvalStatusStillPending = false;
                }
                else
                {
                    approvalStatusStillPending = true;
                }
            }
     
            private void Approvalstatus(object sender, ConditionalEventArgs e)
            { e.Result = approvalStatusStillPending; }
     
            private void onWorkflowItemChanged1_Invoked_1(object sender, ExternalDataEventArgs e)
            {
                ChekApprovalStatus();
            }
     
            private void sendEmail1_MethodInvoking(object sender, EventArgs e)
            {
     
                 this.sendEmail1_Body1 = "hello";
             this.sendEmail1_To1 = "msbahri@tps.com.tn";
             this.sendEmail1_Subject1 = "test";
     
     
     
            }
     
        }
        }
    en faite j'ai ajoute ce code a la methode sendEmail1_MethodInvoking
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    string user = Currentweb.currentuser.loginname.tostring
    le probleme que lorsque je deploie ma solution je recois ce message

    Nom : error.jpg
Affichages : 125
Taille : 52,3 Ko



    j'ai rien compris en plus et meme si j'enleve ma nouvelle ligne ajoutee l'erreur persiste. Pourquoi????

    j'aime bien comprendre la raison

    Merci

  2. #2
    Expert confirmé
    Avatar de ludojojo
    Homme Profil pro
    Développeur SharePoint
    Inscrit en
    Avril 2008
    Messages
    2 967
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France

    Informations professionnelles :
    Activité : Développeur SharePoint
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 967
    Points : 5 347
    Points
    5 347
    Billets dans le blog
    5
    Par défaut
    Ton erreur ne semble pas avoir de rapport avec la ligne que tu as ajoutée.
    Cela semble être un problème avec l'instanciation de ton workflow. Est ce que tu as sur ton environnement le workflow en cours d'exécution sur un élément ?

    Essaye de tout supprimer avant de de-déployer. Tu peux aussi activer la feature manuellement afin de récupérer le message d'erreur de SharePoint, voir de débugger ton workflow.
    Aide les autres...
    Et les autres t'aideront....
    Mon site DVP
    N'oubliez pas de consulter les FAQ SharePoint et les cours et tutoriels SharePoint

    N'oubliez pas de voter pour les messages dont la réponse est pertinente

Discussions similaires

  1. [SP-2010] Form infopath dans un workflow Visual studio
    Par Tiberium76 dans le forum SharePoint
    Réponses: 2
    Dernier message: 01/02/2013, 10h35
  2. Erreur Workflow Visual Studio 2010
    Par Kevin0363 dans le forum Développement Sharepoint
    Réponses: 1
    Dernier message: 12/06/2012, 18h41
  3. Custom Actions et Workflow Visual Studio
    Par cleml12 dans le forum Développement Sharepoint
    Réponses: 1
    Dernier message: 10/10/2011, 17h40
  4. Workflow Visual Studio 2008 + MétaDonnées Word
    Par glucas59 dans le forum SharePoint
    Réponses: 2
    Dernier message: 01/12/2008, 08h50
  5. Workflow sous Visual Studio 2005
    Par Tizba dans le forum SharePoint
    Réponses: 4
    Dernier message: 08/04/2008, 14h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo