Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

SharePoint 2010 State Machine Workflows with Custom Task Forms (InfoPath) using VS 2010 - Part 1 of 3

, 3 Dec 2012
A tutorial on SharePoint 2010 Custom State Machine Workflows with Custom Task forms in InfoPath 2010. An example based tutorial, where I simulate the Recruitment Process of an organization.
RecruitmentProcess-noexe.zip
RecruitmentProcess
RecruitmentProcess.suo
RecruitmentProcess
bin
Release
RecruitmentProcess.wsp
Features
Feature1
Feature1.feature
key.snk
obj
Release
Package
Package.package
pkg
Debug
RecruitmentProcess
RecruitmentProcess_Feature1
Forms
InitialClearancePublish.xsn
TechnicalClearancePublish.xsn
RecruitmentWorkflow
Release
RecruitmentProcess
RecruitmentProcess_Feature1
Forms
InitialClearancePublish.xsn
TechnicalClearancePublish.xsn
RecruitmentWorkflow
pkgobj
Release
TokenReplaceFolder
RecruitmentProcess_Feature1
Forms
RecruitmentWorkflow
Properties
RecruitmentProcess.csproj.user
RecruitmentWorkflow
Forms
InitialClearancePublish.xsn
SharePointProjectItem.spdata
TechnicalClearancePublish.xsn
RecruitmentWorkflow.layout
SharePointProjectItem.spdata
Workflow.png
recruitmentprocess.zip
RecruitmentProcess.suo
Microsoft.Sharepoint.Sandbox.dll
RecruitmentProcess.dll
RecruitmentProcess.wsp
Feature1.feature
key.snk
RecruitmentProcess.dll
Package.package
RecruitmentProcess.dll
InitialClearancePublish.xsn
TechnicalClearancePublish.xsn
RecruitmentProcess.dll
InitialClearancePublish.xsn
TechnicalClearancePublish.xsn
RecruitmentProcess.csproj.user
InitialClearancePublish.xsn
SharePointProjectItem.spdata
TechnicalClearancePublish.xsn
RecruitmentWorkflow.layout
SharePointProjectItem.spdata
Workflow.png
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Reflection;
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;

namespace RecruitmentProcess
{
    public sealed partial class RecruitmentWorkflow
    {
        #region Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCode]
        private void InitializeComponent()
        {
            this.CanModifyActivities = true;
            System.Workflow.Activities.CodeCondition codecondition1 = new System.Workflow.Activities.CodeCondition();
            System.Workflow.Activities.CodeCondition codecondition2 = new System.Workflow.Activities.CodeCondition();
            System.Workflow.Activities.CodeCondition codecondition3 = new System.Workflow.Activities.CodeCondition();
            System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind2 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken1 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind3 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind4 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind5 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind6 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind7 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken2 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind8 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken3 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind9 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind10 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind11 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind12 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken4 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind13 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind14 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind15 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind16 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind17 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken5 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind18 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind19 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken6 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind20 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind21 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind22 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.ComponentModel.ActivityBind activitybind23 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken7 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind24 = new System.Workflow.ComponentModel.ActivityBind();
            System.Workflow.Runtime.CorrelationToken correlationtoken8 = new System.Workflow.Runtime.CorrelationToken();
            System.Workflow.ComponentModel.ActivityBind activitybind25 = new System.Workflow.ComponentModel.ActivityBind();
            this.setStateActivityTechRejected = new System.Workflow.Activities.SetStateActivity();
            this.setStateActivityTechApproved = new System.Workflow.Activities.SetStateActivity();
            this.setStateActivityHRRejected = new System.Workflow.Activities.SetStateActivity();
            this.setStateActivityHRAccepted = new System.Workflow.Activities.SetStateActivity();
            this.setStateActivityInitRejected = new System.Workflow.Activities.SetStateActivity();
            this.setStateActivityTechClearance = new System.Workflow.Activities.SetStateActivity();
            this.ifElseBranchActivityTechRejected = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseBranchActivityHRClearance = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseBranchActivityHRRejected = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseBranchActivityApproved = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseBranchActivityInitialClearance2 = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseBranchActivityInitialClearance1 = new System.Workflow.Activities.IfElseBranchActivity();
            this.ifElseActivityTechnicalClearance = new System.Workflow.Activities.IfElseActivity();
            this.onTaskChangedTechnicalClearance = new Microsoft.SharePoint.WorkflowActions.OnTaskChanged();
            this.createTaskTechnicalClearance = new Microsoft.SharePoint.WorkflowActions.CreateTask();
            this.ifElseActivityHRClearance = new System.Workflow.Activities.IfElseActivity();
            this.onTaskChangedHRClearance = new Microsoft.SharePoint.WorkflowActions.OnTaskChanged();
            this.createTaskHRClearance = new Microsoft.SharePoint.WorkflowActions.CreateTask();
            this.setStateActivityAccepted = new System.Workflow.Activities.SetStateActivity();
            this.onTaskChangedAccepted = new Microsoft.SharePoint.WorkflowActions.OnTaskChanged();
            this.createTaskAccepted = new Microsoft.SharePoint.WorkflowActions.CreateTask();
            this.setStateActivityRejected = new System.Workflow.Activities.SetStateActivity();
            this.onTaskChangedRejected = new Microsoft.SharePoint.WorkflowActions.OnTaskChanged();
            this.createTaskRejected = new Microsoft.SharePoint.WorkflowActions.CreateTask();
            this.createTaskInitialClearance = new Microsoft.SharePoint.WorkflowActions.CreateTask();
            this.ifElseActivityInitialClearance = new System.Workflow.Activities.IfElseActivity();
            this.onTaskChangedInitialClearance = new Microsoft.SharePoint.WorkflowActions.OnTaskChanged();
            this.setStateActivityInitial = new System.Workflow.Activities.SetStateActivity();
            this.onWorkflowActivatedInitial = new Microsoft.SharePoint.WorkflowActions.OnWorkflowActivated();
            this.eventDrivenActivityTechnicalClearance = new System.Workflow.Activities.EventDrivenActivity();
            this.stateInitializationActivityTechnicalClearance = new System.Workflow.Activities.StateInitializationActivity();
            this.eventDrivenActivityHRClearance = new System.Workflow.Activities.EventDrivenActivity();
            this.stateInitializationActivityHRClearance = new System.Workflow.Activities.StateInitializationActivity();
            this.eventDrivenActivityAccepted = new System.Workflow.Activities.EventDrivenActivity();
            this.stateInitializationActivityAccepted = new System.Workflow.Activities.StateInitializationActivity();
            this.eventDrivenActivityRejected = new System.Workflow.Activities.EventDrivenActivity();
            this.stateInitializationActivityRejected = new System.Workflow.Activities.StateInitializationActivity();
            this.stateInitializationInitialClearanceActivity = new System.Workflow.Activities.StateInitializationActivity();
            this.eventDrivenActivityInitialClearance = new System.Workflow.Activities.EventDrivenActivity();
            this.eventDrivenActivityInitial = new System.Workflow.Activities.EventDrivenActivity();
            this.Completed = new System.Workflow.Activities.StateActivity();
            this.TechnicalClearance = new System.Workflow.Activities.StateActivity();
            this.HRClearance = new System.Workflow.Activities.StateActivity();
            this.Accepted = new System.Workflow.Activities.StateActivity();
            this.Rejected = new System.Workflow.Activities.StateActivity();
            this.InitialClearance = new System.Workflow.Activities.StateActivity();
            this.InterviewApplicationReceived = new System.Workflow.Activities.StateActivity();
            // 
            // setStateActivityTechRejected
            // 
            this.setStateActivityTechRejected.Name = "setStateActivityTechRejected";
            this.setStateActivityTechRejected.TargetStateName = "Rejected";
            // 
            // setStateActivityTechApproved
            // 
            this.setStateActivityTechApproved.Name = "setStateActivityTechApproved";
            this.setStateActivityTechApproved.TargetStateName = "HRClearance";
            // 
            // setStateActivityHRRejected
            // 
            this.setStateActivityHRRejected.Name = "setStateActivityHRRejected";
            this.setStateActivityHRRejected.TargetStateName = "Rejected";
            // 
            // setStateActivityHRAccepted
            // 
            this.setStateActivityHRAccepted.Name = "setStateActivityHRAccepted";
            this.setStateActivityHRAccepted.TargetStateName = "Accepted";
            // 
            // setStateActivityInitRejected
            // 
            this.setStateActivityInitRejected.Name = "setStateActivityInitRejected";
            this.setStateActivityInitRejected.TargetStateName = "Rejected";
            // 
            // setStateActivityTechClearance
            // 
            this.setStateActivityTechClearance.Name = "setStateActivityTechClearance";
            this.setStateActivityTechClearance.TargetStateName = "TechnicalClearance";
            // 
            // ifElseBranchActivityTechRejected
            // 
            this.ifElseBranchActivityTechRejected.Activities.Add(this.setStateActivityTechRejected);
            this.ifElseBranchActivityTechRejected.Name = "ifElseBranchActivityTechRejected";
            // 
            // ifElseBranchActivityHRClearance
            // 
            this.ifElseBranchActivityHRClearance.Activities.Add(this.setStateActivityTechApproved);
            codecondition1.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.TechnicalClearanceApprovalProcess);
            this.ifElseBranchActivityHRClearance.Condition = codecondition1;
            this.ifElseBranchActivityHRClearance.Name = "ifElseBranchActivityHRClearance";
            // 
            // ifElseBranchActivityHRRejected
            // 
            this.ifElseBranchActivityHRRejected.Activities.Add(this.setStateActivityHRRejected);
            this.ifElseBranchActivityHRRejected.Name = "ifElseBranchActivityHRRejected";
            // 
            // ifElseBranchActivityApproved
            // 
            this.ifElseBranchActivityApproved.Activities.Add(this.setStateActivityHRAccepted);
            codecondition2.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.HRClearanceApprovalProcess);
            this.ifElseBranchActivityApproved.Condition = codecondition2;
            this.ifElseBranchActivityApproved.Name = "ifElseBranchActivityApproved";
            // 
            // ifElseBranchActivityInitialClearance2
            // 
            this.ifElseBranchActivityInitialClearance2.Activities.Add(this.setStateActivityInitRejected);
            this.ifElseBranchActivityInitialClearance2.Name = "ifElseBranchActivityInitialClearance2";
            // 
            // ifElseBranchActivityInitialClearance1
            // 
            this.ifElseBranchActivityInitialClearance1.Activities.Add(this.setStateActivityTechClearance);
            codecondition3.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.InitialClearanceApprovalProcess);
            this.ifElseBranchActivityInitialClearance1.Condition = codecondition3;
            this.ifElseBranchActivityInitialClearance1.Name = "ifElseBranchActivityInitialClearance1";
            // 
            // ifElseActivityTechnicalClearance
            // 
            this.ifElseActivityTechnicalClearance.Activities.Add(this.ifElseBranchActivityHRClearance);
            this.ifElseActivityTechnicalClearance.Activities.Add(this.ifElseBranchActivityTechRejected);
            this.ifElseActivityTechnicalClearance.Name = "ifElseActivityTechnicalClearance";
            // 
            // onTaskChangedTechnicalClearance
            // 
            activitybind1.Name = "RecruitmentWorkflow";
            activitybind1.Path = "onTaskChangedTechnicalClearanceAfterProperties";
            activitybind2.Name = "RecruitmentWorkflow";
            activitybind2.Path = "onTaskChangedTechnicalClearanceBeforeProperties";
            correlationtoken1.Name = "TechnicalClearanceToken";
            correlationtoken1.OwnerActivityName = "TechnicalClearance";
            this.onTaskChangedTechnicalClearance.CorrelationToken = correlationtoken1;
            this.onTaskChangedTechnicalClearance.Executor = null;
            this.onTaskChangedTechnicalClearance.Name = "onTaskChangedTechnicalClearance";
            activitybind3.Name = "RecruitmentWorkflow";
            activitybind3.Path = "createTaskTechnicalClearanceTaskId";
            this.onTaskChangedTechnicalClearance.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onTaskChangedTechnicalClearance_Invoked);
            this.onTaskChangedTechnicalClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.BeforePropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind2)));
            this.onTaskChangedTechnicalClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind3)));
            this.onTaskChangedTechnicalClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.AfterPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
            // 
            // createTaskTechnicalClearance
            // 
            this.createTaskTechnicalClearance.CorrelationToken = correlationtoken1;
            this.createTaskTechnicalClearance.ListItemId = -1;
            this.createTaskTechnicalClearance.Name = "createTaskTechnicalClearance";
            this.createTaskTechnicalClearance.SpecialPermissions = null;
            activitybind4.Name = "RecruitmentWorkflow";
            activitybind4.Path = "createTaskTechnicalClearanceTaskId";
            activitybind5.Name = "RecruitmentWorkflow";
            activitybind5.Path = "createTaskTechnicalClearanceTaskProperties";
            this.createTaskTechnicalClearance.MethodInvoking += new System.EventHandler(this.createTaskTechnicalClearance_MethodInvoking);
            this.createTaskTechnicalClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind4)));
            this.createTaskTechnicalClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind5)));
            // 
            // ifElseActivityHRClearance
            // 
            this.ifElseActivityHRClearance.Activities.Add(this.ifElseBranchActivityApproved);
            this.ifElseActivityHRClearance.Activities.Add(this.ifElseBranchActivityHRRejected);
            this.ifElseActivityHRClearance.Name = "ifElseActivityHRClearance";
            // 
            // onTaskChangedHRClearance
            // 
            activitybind6.Name = "RecruitmentWorkflow";
            activitybind6.Path = "onTaskChangedHRClearanceAfterProperties";
            activitybind7.Name = "RecruitmentWorkflow";
            activitybind7.Path = "onTaskChangedHRClearanceBeforeProperties";
            correlationtoken2.Name = "HRClearance";
            correlationtoken2.OwnerActivityName = "HRClearance";
            this.onTaskChangedHRClearance.CorrelationToken = correlationtoken2;
            this.onTaskChangedHRClearance.Executor = null;
            this.onTaskChangedHRClearance.Name = "onTaskChangedHRClearance";
            activitybind8.Name = "RecruitmentWorkflow";
            activitybind8.Path = "createTaskHRClearanceTaskId";
            this.onTaskChangedHRClearance.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onTaskChangedHRClearance_Invoked);
            this.onTaskChangedHRClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.BeforePropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind7)));
            this.onTaskChangedHRClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind8)));
            this.onTaskChangedHRClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.AfterPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind6)));
            // 
            // createTaskHRClearance
            // 
            correlationtoken3.Name = "HRClearance";
            correlationtoken3.OwnerActivityName = "HRClearance";
            this.createTaskHRClearance.CorrelationToken = correlationtoken3;
            this.createTaskHRClearance.ListItemId = -1;
            this.createTaskHRClearance.Name = "createTaskHRClearance";
            this.createTaskHRClearance.SpecialPermissions = null;
            activitybind9.Name = "RecruitmentWorkflow";
            activitybind9.Path = "createTaskHRClearanceTaskId";
            activitybind10.Name = "RecruitmentWorkflow";
            activitybind10.Path = "createTaskHRClearanceTaskProperties";
            this.createTaskHRClearance.MethodInvoking += new System.EventHandler(this.createTaskHRClearance_MethodInvoking);
            this.createTaskHRClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind10)));
            this.createTaskHRClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind9)));
            // 
            // setStateActivityAccepted
            // 
            this.setStateActivityAccepted.Name = "setStateActivityAccepted";
            this.setStateActivityAccepted.TargetStateName = "Completed";
            // 
            // onTaskChangedAccepted
            // 
            activitybind11.Name = "RecruitmentWorkflow";
            activitybind11.Path = "onTaskChangedAcceptedAfterProperties";
            activitybind12.Name = "RecruitmentWorkflow";
            activitybind12.Path = "onTaskChangedAcceptedBeforeProperties";
            correlationtoken4.Name = "AcceptedToken";
            correlationtoken4.OwnerActivityName = "Accepted";
            this.onTaskChangedAccepted.CorrelationToken = correlationtoken4;
            this.onTaskChangedAccepted.Executor = null;
            this.onTaskChangedAccepted.Name = "onTaskChangedAccepted";
            activitybind13.Name = "RecruitmentWorkflow";
            activitybind13.Path = "createTaskAcceptedTaskId";
            this.onTaskChangedAccepted.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onTaskChangedAccepted_Invoked);
            this.onTaskChangedAccepted.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.BeforePropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind12)));
            this.onTaskChangedAccepted.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind13)));
            this.onTaskChangedAccepted.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.AfterPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind11)));
            // 
            // createTaskAccepted
            // 
            this.createTaskAccepted.CorrelationToken = correlationtoken4;
            this.createTaskAccepted.ListItemId = -1;
            this.createTaskAccepted.Name = "createTaskAccepted";
            this.createTaskAccepted.SpecialPermissions = null;
            activitybind14.Name = "RecruitmentWorkflow";
            activitybind14.Path = "createTaskAcceptedTaskId";
            activitybind15.Name = "RecruitmentWorkflow";
            activitybind15.Path = "createTaskAcceptedTaskProperties";
            this.createTaskAccepted.MethodInvoking += new System.EventHandler(this.createTaskAccepted_MethodInvoking);
            this.createTaskAccepted.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind14)));
            this.createTaskAccepted.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind15)));
            // 
            // setStateActivityRejected
            // 
            this.setStateActivityRejected.Name = "setStateActivityRejected";
            this.setStateActivityRejected.TargetStateName = "Completed";
            // 
            // onTaskChangedRejected
            // 
            activitybind16.Name = "RecruitmentWorkflow";
            activitybind16.Path = "onTaskChangedRejectedAfterProperties";
            activitybind17.Name = "RecruitmentWorkflow";
            activitybind17.Path = "onTaskChangedRejectedBeforeProperties";
            correlationtoken5.Name = "RejectedToken";
            correlationtoken5.OwnerActivityName = "Rejected";
            this.onTaskChangedRejected.CorrelationToken = correlationtoken5;
            this.onTaskChangedRejected.Executor = null;
            this.onTaskChangedRejected.Name = "onTaskChangedRejected";
            this.onTaskChangedRejected.TaskId = new System.Guid("00000000-0000-0000-0000-000000000000");
            this.onTaskChangedRejected.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onTaskChangedRejected_Invoked);
            this.onTaskChangedRejected.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.AfterPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind16)));
            this.onTaskChangedRejected.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.BeforePropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind17)));
            // 
            // createTaskRejected
            // 
            this.createTaskRejected.CorrelationToken = correlationtoken5;
            this.createTaskRejected.ListItemId = -1;
            this.createTaskRejected.Name = "createTaskRejected";
            this.createTaskRejected.SpecialPermissions = null;
            activitybind18.Name = "RecruitmentWorkflow";
            activitybind18.Path = "createTaskRejectedTaskId";
            activitybind19.Name = "RecruitmentWorkflow";
            activitybind19.Path = "createTaskRejectedTaskProperties";
            this.createTaskRejected.MethodInvoking += new System.EventHandler(this.createTaskRejected_MethodInvoking);
            this.createTaskRejected.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind18)));
            this.createTaskRejected.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind19)));
            // 
            // createTaskInitialClearance
            // 
            correlationtoken6.Name = "InitialClearanceToken";
            correlationtoken6.OwnerActivityName = "InitialClearance";
            this.createTaskInitialClearance.CorrelationToken = correlationtoken6;
            this.createTaskInitialClearance.ListItemId = -1;
            this.createTaskInitialClearance.Name = "createTaskInitialClearance";
            this.createTaskInitialClearance.SpecialPermissions = null;
            activitybind20.Name = "RecruitmentWorkflow";
            activitybind20.Path = "createTaskInitialClearanceTaskId";
            activitybind21.Name = "RecruitmentWorkflow";
            activitybind21.Path = "createTaskInitialClearanceTaskProperties";
            this.createTaskInitialClearance.MethodInvoking += new System.EventHandler(this.createTaskInitialClearance_MethodInvoking);
            this.createTaskInitialClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind20)));
            this.createTaskInitialClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.CreateTask.TaskPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind21)));
            // 
            // ifElseActivityInitialClearance
            // 
            this.ifElseActivityInitialClearance.Activities.Add(this.ifElseBranchActivityInitialClearance1);
            this.ifElseActivityInitialClearance.Activities.Add(this.ifElseBranchActivityInitialClearance2);
            this.ifElseActivityInitialClearance.Name = "ifElseActivityInitialClearance";
            // 
            // onTaskChangedInitialClearance
            // 
            activitybind22.Name = "RecruitmentWorkflow";
            activitybind22.Path = "onTaskChangedInitialClearanceAfterProperties";
            activitybind23.Name = "RecruitmentWorkflow";
            activitybind23.Path = "onTaskChangedInitialClearanceBeforeProperties";
            correlationtoken7.Name = "InitialClearanceToken";
            correlationtoken7.OwnerActivityName = "InitialClearance";
            this.onTaskChangedInitialClearance.CorrelationToken = correlationtoken7;
            this.onTaskChangedInitialClearance.Executor = null;
            this.onTaskChangedInitialClearance.Name = "onTaskChangedInitialClearance";
            activitybind24.Name = "RecruitmentWorkflow";
            activitybind24.Path = "createTaskInitialClearanceTaskId";
            this.onTaskChangedInitialClearance.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onTaskChangedInitialClearance_Invoked);
            this.onTaskChangedInitialClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.AfterPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind22)));
            this.onTaskChangedInitialClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.BeforePropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind23)));
            this.onTaskChangedInitialClearance.SetBinding(Microsoft.SharePoint.WorkflowActions.OnTaskChanged.TaskIdProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind24)));
            // 
            // setStateActivityInitial
            // 
            this.setStateActivityInitial.Name = "setStateActivityInitial";
            this.setStateActivityInitial.TargetStateName = "InitialClearance";
            // 
            // onWorkflowActivatedInitial
            // 
            correlationtoken8.Name = "InitialToken";
            correlationtoken8.OwnerActivityName = "InterviewApplicationReceived";
            this.onWorkflowActivatedInitial.CorrelationToken = correlationtoken8;
            this.onWorkflowActivatedInitial.EventName = "OnWorkflowActivated";
            this.onWorkflowActivatedInitial.Name = "onWorkflowActivatedInitial";
            activitybind25.Name = "RecruitmentWorkflow";
            activitybind25.Path = "workflowProperties";
            this.onWorkflowActivatedInitial.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.onWorkflowActivatedInitial_Invoked);
            this.onWorkflowActivatedInitial.SetBinding(Microsoft.SharePoint.WorkflowActions.OnWorkflowActivated.WorkflowPropertiesProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind25)));
            // 
            // eventDrivenActivityTechnicalClearance
            // 
            this.eventDrivenActivityTechnicalClearance.Activities.Add(this.onTaskChangedTechnicalClearance);
            this.eventDrivenActivityTechnicalClearance.Activities.Add(this.ifElseActivityTechnicalClearance);
            this.eventDrivenActivityTechnicalClearance.Name = "eventDrivenActivityTechnicalClearance";
            // 
            // stateInitializationActivityTechnicalClearance
            // 
            this.stateInitializationActivityTechnicalClearance.Activities.Add(this.createTaskTechnicalClearance);
            this.stateInitializationActivityTechnicalClearance.Name = "stateInitializationActivityTechnicalClearance";
            // 
            // eventDrivenActivityHRClearance
            // 
            this.eventDrivenActivityHRClearance.Activities.Add(this.onTaskChangedHRClearance);
            this.eventDrivenActivityHRClearance.Activities.Add(this.ifElseActivityHRClearance);
            this.eventDrivenActivityHRClearance.Name = "eventDrivenActivityHRClearance";
            // 
            // stateInitializationActivityHRClearance
            // 
            this.stateInitializationActivityHRClearance.Activities.Add(this.createTaskHRClearance);
            this.stateInitializationActivityHRClearance.Name = "stateInitializationActivityHRClearance";
            // 
            // eventDrivenActivityAccepted
            // 
            this.eventDrivenActivityAccepted.Activities.Add(this.onTaskChangedAccepted);
            this.eventDrivenActivityAccepted.Activities.Add(this.setStateActivityAccepted);
            this.eventDrivenActivityAccepted.Name = "eventDrivenActivityAccepted";
            // 
            // stateInitializationActivityAccepted
            // 
            this.stateInitializationActivityAccepted.Activities.Add(this.createTaskAccepted);
            this.stateInitializationActivityAccepted.Name = "stateInitializationActivityAccepted";
            // 
            // eventDrivenActivityRejected
            // 
            this.eventDrivenActivityRejected.Activities.Add(this.onTaskChangedRejected);
            this.eventDrivenActivityRejected.Activities.Add(this.setStateActivityRejected);
            this.eventDrivenActivityRejected.Name = "eventDrivenActivityRejected";
            // 
            // stateInitializationActivityRejected
            // 
            this.stateInitializationActivityRejected.Activities.Add(this.createTaskRejected);
            this.stateInitializationActivityRejected.Name = "stateInitializationActivityRejected";
            // 
            // stateInitializationInitialClearanceActivity
            // 
            this.stateInitializationInitialClearanceActivity.Activities.Add(this.createTaskInitialClearance);
            this.stateInitializationInitialClearanceActivity.Name = "stateInitializationInitialClearanceActivity";
            // 
            // eventDrivenActivityInitialClearance
            // 
            this.eventDrivenActivityInitialClearance.Activities.Add(this.onTaskChangedInitialClearance);
            this.eventDrivenActivityInitialClearance.Activities.Add(this.ifElseActivityInitialClearance);
            this.eventDrivenActivityInitialClearance.Name = "eventDrivenActivityInitialClearance";
            // 
            // eventDrivenActivityInitial
            // 
            this.eventDrivenActivityInitial.Activities.Add(this.onWorkflowActivatedInitial);
            this.eventDrivenActivityInitial.Activities.Add(this.setStateActivityInitial);
            this.eventDrivenActivityInitial.Name = "eventDrivenActivityInitial";
            // 
            // Completed
            // 
            this.Completed.Name = "Completed";
            // 
            // TechnicalClearance
            // 
            this.TechnicalClearance.Activities.Add(this.stateInitializationActivityTechnicalClearance);
            this.TechnicalClearance.Activities.Add(this.eventDrivenActivityTechnicalClearance);
            this.TechnicalClearance.Name = "TechnicalClearance";
            // 
            // HRClearance
            // 
            this.HRClearance.Activities.Add(this.stateInitializationActivityHRClearance);
            this.HRClearance.Activities.Add(this.eventDrivenActivityHRClearance);
            this.HRClearance.Name = "HRClearance";
            // 
            // Accepted
            // 
            this.Accepted.Activities.Add(this.stateInitializationActivityAccepted);
            this.Accepted.Activities.Add(this.eventDrivenActivityAccepted);
            this.Accepted.Name = "Accepted";
            // 
            // Rejected
            // 
            this.Rejected.Activities.Add(this.stateInitializationActivityRejected);
            this.Rejected.Activities.Add(this.eventDrivenActivityRejected);
            this.Rejected.Name = "Rejected";
            // 
            // InitialClearance
            // 
            this.InitialClearance.Activities.Add(this.eventDrivenActivityInitialClearance);
            this.InitialClearance.Activities.Add(this.stateInitializationInitialClearanceActivity);
            this.InitialClearance.Name = "InitialClearance";
            // 
            // InterviewApplicationReceived
            // 
            this.InterviewApplicationReceived.Activities.Add(this.eventDrivenActivityInitial);
            this.InterviewApplicationReceived.Name = "InterviewApplicationReceived";
            // 
            // RecruitmentWorkflow
            // 
            this.Activities.Add(this.InterviewApplicationReceived);
            this.Activities.Add(this.InitialClearance);
            this.Activities.Add(this.Rejected);
            this.Activities.Add(this.Accepted);
            this.Activities.Add(this.HRClearance);
            this.Activities.Add(this.TechnicalClearance);
            this.Activities.Add(this.Completed);
            this.CompletedStateName = "Completed";
            this.DynamicUpdateCondition = null;
            this.InitialStateName = "InterviewApplicationReceived";
            this.Name = "RecruitmentWorkflow";
            this.CanModifyActivities = false;

        }

        #endregion

        private SetStateActivity setStateActivityTechApproved;

        private SetStateActivity setStateActivityHRRejected;

        private SetStateActivity setStateActivityHRAccepted;

        private IfElseBranchActivity ifElseBranchActivityHRRejected;

        private IfElseBranchActivity ifElseBranchActivityApproved;

        private IfElseActivity ifElseActivityHRClearance;

        private Microsoft.SharePoint.WorkflowActions.OnTaskChanged onTaskChangedHRClearance;

        private Microsoft.SharePoint.WorkflowActions.CreateTask createTaskHRClearance;

        private EventDrivenActivity eventDrivenActivityHRClearance;

        private StateInitializationActivity stateInitializationActivityHRClearance;

        private StateActivity HRClearance;

        private SetStateActivity setStateActivityRejected;

        private Microsoft.SharePoint.WorkflowActions.OnTaskChanged onTaskChangedRejected;

        private SetStateActivity setStateActivityAccepted;

        private Microsoft.SharePoint.WorkflowActions.CreateTask createTaskRejected;

        private Microsoft.SharePoint.WorkflowActions.OnTaskChanged onTaskChangedAccepted;

        private Microsoft.SharePoint.WorkflowActions.CreateTask createTaskAccepted;

        private SetStateActivity setStateActivityTechRejected;

        private IfElseBranchActivity ifElseBranchActivityTechRejected;

        private IfElseBranchActivity ifElseBranchActivityHRClearance;

        private IfElseActivity ifElseActivityTechnicalClearance;

        private Microsoft.SharePoint.WorkflowActions.OnTaskChanged onTaskChangedTechnicalClearance;

        private SetStateActivity setStateActivityInitRejected;

        private Microsoft.SharePoint.WorkflowActions.CreateTask createTaskTechnicalClearance;

        private EventDrivenActivity eventDrivenActivityTechnicalClearance;

        private StateInitializationActivity stateInitializationActivityTechnicalClearance;

        private EventDrivenActivity eventDrivenActivityAccepted;

        private StateInitializationActivity stateInitializationActivityAccepted;

        private EventDrivenActivity eventDrivenActivityRejected;

        private StateInitializationActivity stateInitializationActivityRejected;

        private IfElseBranchActivity ifElseBranchActivityInitialClearance2;

        private IfElseBranchActivity ifElseBranchActivityInitialClearance1;

        private IfElseActivity ifElseActivityInitialClearance;

        private SetStateActivity setStateActivityTechClearance;

        private Microsoft.SharePoint.WorkflowActions.OnTaskChanged onTaskChangedInitialClearance;

        private EventDrivenActivity eventDrivenActivityInitial;

        private Microsoft.SharePoint.WorkflowActions.OnWorkflowActivated onWorkflowActivatedInitial;

        private SetStateActivity setStateActivityInitial;

        private Microsoft.SharePoint.WorkflowActions.CreateTask createTaskInitialClearance;

        private StateInitializationActivity stateInitializationInitialClearanceActivity;

        private EventDrivenActivity eventDrivenActivityInitialClearance;

        private StateActivity Completed;

        private StateActivity TechnicalClearance;

        private StateActivity Accepted;

        private StateActivity Rejected;

        private StateActivity InitialClearance;

        private StateActivity InterviewApplicationReceived;































































































    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rupesh Tarwade
Technical Lead
India India
I have been designing and developing systems in .NET since 2006. Started out with .NET 1.1, and progressed to 2.0, 3.0 and 3.5. I have recently dived into SharePoint 2010 development. My areas of expertise are Workflows in .NET and SharePoint.
Follow on   Twitter   Google+   LinkedIn

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 3 Dec 2012
Article Copyright 2011 by Rupesh Tarwade
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid