Link to home
Start Free TrialLog in
Avatar of manich
manich

asked on

Wss3

when i create workflow,and using deleteTask method: I got error occur with my workflow in wss3 site,
it said error occur in workflow:
the code that I use :

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 System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;


namespace deleted
{
    public sealed partial class Workflow1 : SequentialWorkflowActivity
    {
        public Workflow1()
        {
            InitializeComponent();
        }

        public Guid workflowId = default(System.Guid);
        public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

        private void deleteTask1_MethodInvoking(object sender, EventArgs e)
           
        {
           

            if (workflowProperties.Item.Title.ToString() == "Dara")
            {
                workflowProperties.Item.Delete();

            }
            else
            {
                string title="Invent";

               

                title=workflowProperties.Item.Title.ToString();



            }

        }

        private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
        {

        }
    }


       
   
}
 
Avatar of GeorgeGergues
GeorgeGergues

Are  you able to trace through it ?

Also are you able to build the project ok.
I am not sure you can declare a variable inside the else statement

 string title="Invent";

you may want to put that up by the method header

 private void deleteTask1_MethodInvoking(object sender, EventArgs e)        

        {
          string title="Invent";
Avatar of manich

ASKER

Can you give me the hold thing with condition in method deletetask() , cause when do condition on it , it 's not work.
ASKER CERTIFIED SOLUTION
Avatar of GeorgeGergues
GeorgeGergues

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manich

ASKER

want more expression in Deletetask,and so on via C# code