www.skelta.com
Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » Skelta Workflow Net » Skelta Workflow Net » Application Development » Return Values from Custom Actions


Return Values from Custom ActionsExpand / Collapse
Author
Message
Posted Thursday, August 24, 2006
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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

Post #58
Posted Monday, August 28, 2006
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum 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

Post #59
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
-
Active Users: 2 (2 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.

All times are GMT -5:00, Time now is 3:49am

 
Execution: 0.094.10 queries.Compression Enabled.

Copyright © 2002 - 2007 Skelta Software. All rights reserved. Tel: 1 (703) 229-6732 | Email:sales@skelta.com
Skelta - A BPM Workflow Software Company