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)
        {

        }
    }


       
   
}
 
manichAsked:
Who is Participating?
 
GeorgeGerguesCommented:
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)
           
        {
              string title="";
           

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

            }
            else
            {
                title="Invent";

               

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



            }

        }

        private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
        {

        }
    }


       
   
}
0
 
GeorgeGerguesCommented:
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";
0
 
manichAuthor Commented:
Can you give me the hold thing with condition in method deletetask() , cause when do condition on it , it 's not work.
0
 
manichAuthor Commented:
want more expression in Deletetask,and so on via C# code
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.