Click here to Skip to main content
15,905,232 members

Comments by Chitla Janardhan Reddy (Top 2 by date)

Chitla Janardhan Reddy 14-Jun-12 23:44pm View    
Hi Agustee,
Thanks for replying i have another question.
When I am going to resume the workflow it is throwing exception that workflow resume operation will perform only on started workflows. can you help me how to restart a suspended workflow. Here is my code sippet:

WorkflowRuntime workflowRuntime = new WorkflowRuntime();
WorkFlowDemo.states.state state = new WorkFlowDemo.states.state();
Guid state_ID = Guid.NewGuid();
Dictionary<string,> Params = new Dictionary<string,>();
ExternalDataExchangeService ExDateExchService = new ExternalDataExchangeService();
WorkflowInstance instance = null;
StateMachineWorkflowInstance ins = null;

protected void SendData_Click(object sender, EventArgs e)
{
workflowRuntime.AddService(ExDateExchService);
ExDateExchService.AddService(state);
instance =
workflowRuntime.CreateWorkflow(typeof(Workflow1), Params, state_ID);
Session["workflow"] = state_ID;
instance.Start();
ins = new StateMachineWorkflowInstance(workflowRuntime, state_ID);
workflowlist.Add(state_ID);

state.SubmitContent(state_ID);

if (ins.CurrentStateName == "Submitted")
{
SendData.Visible = false;
Approve.Visible = true;
Reject.Visible = true;
Incomplete.Visible = true;
Cancel.Visible = true;
}
instance.Suspend("waiting for user input");
}


{
instance = workflowRuntime.GetWorkflow(state_ID);/******Here I am getting error. I am not able to get the workflow and restart it*********/
instance.Resume();
ins = new StateMachineWorkflowInstance(workflowRuntime, state_ID);
// ins.WorkflowInstance.Load();
state.Approved(state_ID);

if (ins.CurrentStateName == "Complete")
{
Data.Visible = true;
Data.InnerText = "Approved";
ContentTextBox.Visible = false;
SendData.Visible = false;
Approve.Visible = false;
Reject.Visible = false;
Incomplete.Visible = false;
Cancel.Visible = false;
if (workflowRuntime != null)
{
workflowRuntime.StopRuntime();
workflowRuntime.Dispose();
}
}
}
Chitla Janardhan Reddy 10-Jun-12 23:45pm View    
Actually I am having 2 logins one user is enter the content and another user is approve the content. Now I entered data as user i want to send that data to approver using work flow. This is what I am looking for