| | | Forum Newbie
       
Group: Skelta Workflow/BPM Net Last Login: Friday, March 30, 2007 Posts: 1, Visits: 7 |
| | Hi, I am trying to programatically determine the outcome of a custom action. I have set the return values up in the Actions.xml and the workflow is choosing the subsequent action depending on the outcome. However, i would like to be able to determine the outcome in code. Does anyone have any ideas? Cheers Toby |
| | | | Forum Guru
       
Group: Forum Members Last Login: Thursday, December 13, 2007 Posts: 10, Visits: 64 |
| | Hi Toby, Using the IWorkFlowInformation Interface, we can get the value. Below is the code snippet. public void OnActionStatusUpdate(int ExecutionId, int ExecutionDetailsID, string ActionName, string Status)
{
if (ActionName == "Approval1" && Status == "Z")
{
Workflow.NET.Engine.Context ObjContext; Workflow.NET.Engine.RunTime ObjRuntime; Workflow.NET.Interfaces.IDataHandler ObjHandler; Workflow.NET.Config ObjConfig; ObjConfig = new Workflow.NET.Config("simulation"); ObjHandler = Workflow.NET.Storage.DataHandlerFactory.GetDataHandler(ObjConfig.DataSourceConnectionString, ObjConfig.DataSourceType); ObjRuntime = Workflow.NET.Engine.RunTime.GetRuntime(System.Net.Dns.GetHostName(), "simulation", false); ObjContext = Workflow.NET.Engine.Context.GetContext(ExecutionId, ObjRuntime, ObjHandler); SqlConnection Objconnection = new SqlConnection(ObjHandler.ConnectionString); Objconnection.Open(); SqlCommand cmd = new SqlCommand("select * from SWExecutionDetails where id= " + ExecutionDetailsID, Objconnection); SqlDataAdapter adp = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); adp.Fill(ds); DataTable table = ds.Tables[0]; DataRow dr = table.Rows[0]; object dc = dr[7]; Objconnection.Close(); ObjContext.Variables["temp"].Value = dc.ToString(); ObjContext.SaveVariables(); ObjContext.Close(); Objlog.Close();
} Regards, Team Skelta
Moderator |
| |
|
|