本文整理汇总了C#中Slickflow.Engine.Common.WfAppRunner类的典型用法代码示例。如果您正苦于以下问题:C# WfAppRunner类的具体用法?C# WfAppRunner怎么用?C# WfAppRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WfAppRunner类属于Slickflow.Engine.Common命名空间,在下文中一共展示了WfAppRunner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SignForwardProcess
/// <summary>
/// 加签
/// </summary>
/// <param name="runner"></param>
/// <returns></returns>
public WfExecutedResult SignForwardProcess(WfAppRunner runner)
{
IDbConnection conn = SessionFactory.CreateConnection();
IDbTransaction trans = null;
try
{
trans = conn.BeginTransaction();
var result = SignForwardProcess(conn, runner, trans);
if (result.Status == WfExecutedStatus.Success)
trans.Commit();
else
trans.Rollback();
return result;
}
catch
{
trans.Rollback();
throw;
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
}
开发者ID:uname-yang,项目名称:WorkFlow-Engine-OData-WebApi-with-OdataClient,代码行数:33,代码来源:WorkflowServiceExt2.cs
示例2: CreateTransitionInstanceObject
internal TransitionInstanceEntity CreateTransitionInstanceObject(ProcessInstanceEntity processInstance,
String transitionGUID,
ActivityInstanceEntity fromActivityInstance,
ActivityInstanceEntity toActivityInstance,
TransitionTypeEnum transitionType,
TransitionFlyingTypeEnum flyingType,
WfAppRunner runner,
byte conditionParseResult)
{
var entity = new TransitionInstanceEntity();
entity.AppName = processInstance.AppName;
entity.AppInstanceID = processInstance.AppInstanceID;
entity.ProcessGUID = processInstance.ProcessGUID;
entity.ProcessInstanceID = processInstance.ID;
entity.TransitionGUID = transitionGUID;
entity.TransitionType = (byte)transitionType;
entity.FlyingType = (byte)flyingType;
//构造活动节点数据
entity.FromActivityGUID = fromActivityInstance.ActivityGUID;
entity.FromActivityInstanceID = fromActivityInstance.ID;
entity.FromActivityType = fromActivityInstance.ActivityType;
entity.FromActivityName = fromActivityInstance.ActivityName;
entity.ToActivityGUID = toActivityInstance.ActivityGUID;
entity.ToActivityInstanceID = toActivityInstance.ID;
entity.ToActivityType = toActivityInstance.ActivityType;
entity.ToActivityName = toActivityInstance.ActivityName;
entity.ConditionParseResult = conditionParseResult;
entity.CreatedByUserID = runner.UserID;
entity.CreatedByUserName = runner.UserName;
entity.CreatedDateTime = System.DateTime.Now;
return entity;
}
示例3: btnMade_Click
/// <summary>
/// 生产节点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnMade_Click(object sender, EventArgs e)
{
WfAppRunner appRunner = new WfAppRunner();
appRunner.ProcessGUID = process_guid;
appRunner.AppInstanceID = application_instance_id;
appRunner.AppName = application_name;
appRunner.UserID = per_dict["limu"];
appRunner.UserName = "limu";
var wfService = new WorkflowService();
var nextSteps = wfService.GetNextActivityTree(appRunner);
if (nextSteps != null)
{
//构造下一步办理人的信息
appRunner.NextActivityPerformers = CreateNextActivityPerformers(nextSteps);
var r2 = wfService.RunProcessApp(appRunner);
var msg2 = string.Format("执行【生产】:{0}, {1}\r\n", r2.Status, r2.Message);
WriteText(msg2);
if (r2.Status == WfExecutedStatus.Success)
{
WriteText(string.Format("任务已经发送到下一节点:{0}\r\n\r\n", nextSteps[0].ActivityName));
}
}
else
{
WriteText("您当前没有办理任务!\r\n");
}
}
示例4: DiscardProcess
public ResponseResult DiscardProcess(WfAppRunner discarder)
{
IWorkflowService service = new WorkflowService();
var result = service.DiscardProcess(discarder);
return ResponseResult.Success();
}
示例5: ReverseProcess
public ResponseResult ReverseProcess(WfAppRunner runner)
{
IWorkflowService wfService = new WorkflowService();
IDbConnection conn = new SqlConnection(DBConfig.ConnectionString);
conn.Open();
IDbTransaction trans = null;
try
{
trans = conn.BeginTransaction();
var result = wfService.ReverseProcess(conn, runner, trans);
trans.Commit();
if (result.Status == WfExecutedStatus.Success)
return ResponseResult.Success();
else
return ResponseResult.Error(result.Message);
}
catch (WorkflowException w)
{
trans.Rollback();
return ResponseResult.Error(w.Message);
}
finally
{
trans.Dispose();
if (conn.State == ConnectionState.Open)
conn.Close();
}
}
示例6: WfAppRunner
private void btn仓库签字_Click(object sender, EventArgs e)
{
WfAppRunner appRunner = new WfAppRunner();
appRunner.ProcessGUID = process_guid;
appRunner.AppInstanceID = application_instance_id;
//第一步任务承担者,登录后要找到自己的任务
appRunner.AppName = "officeIn";
appRunner.UserID = "1";
appRunner.UserName = "user1";
IWorkflowService wfService = new WorkflowService();
//外部变量条件
Dictionary<string, string> dictCondition = new Dictionary<string, string>();
dictCondition.Add("surplus", cBoxSurplus.Text);
appRunner.Conditions = dictCondition;
//动态获取下一跳转后的节点
NodeView nv = wfService.GetNextActivity(appRunner, dictCondition);
//指定对象执行者
PerformerList list = new PerformerList();
list.Add(new Performer("3", "user3"));
Dictionary<String, PerformerList> dictPerformer = new Dictionary<String, PerformerList>();
dictPerformer.Add(nv.ActivityGUID, list);
appRunner.NextActivityPerformers = dictPerformer;
var result = wfService.RunProcessApp(appRunner);
var msg = string.Format("流程运行结果:{0}\r\n{1}\r\n", result.Status, result.Message);
tBoxResult.Text += msg;
}
示例7: WfAppRunner
private void btn综合部签字_Click(object sender, EventArgs e)
{
WfAppRunner appRunner = new WfAppRunner();
appRunner.ProcessGUID = process_guid;
appRunner.AppInstanceID = application_instance_id;
//第一步任务承担者,登录后要找到自己的任务
appRunner.AppName = "officeIn";
appRunner.UserID = "3";
appRunner.UserName = "user3";
IWorkflowService wfService = new WorkflowService();
TaskQueryEntity en = new TaskQueryEntity
{
UserID = "3"
};
IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en);
appRunner.TaskID = taskViewList[0].TaskID;
PerformerList list = new PerformerList();
list.Add(new Performer("5", "user5"));
NodeView nv = wfService.GetNextActivity(appRunner);
Dictionary<String, PerformerList> dictPerformer = new Dictionary<String, PerformerList>();
dictPerformer.Add(nv.ActivityGUID, list);
appRunner.NextActivityPerformers = dictPerformer;
var result = wfService.RunProcessApp(appRunner);
var msg = string.Format("流程运行结果:{0}\r\n{1}\r\n", result.Status, result.Message);
tBoxResult.Text += msg;
}
示例8: ActivityResource
internal ActivityResource(WfAppRunner runner,
IDictionary<string, PerformerList> nextActivityPerformers,
IDictionary<string, string> conditionKeyValuePair = null)
{
AppRunner = runner;
NextActivityPerformers = nextActivityPerformers;
ConditionKeyValuePair = conditionKeyValuePair;
}
示例9: StartProcess
/// <summary>
/// 启动流程
/// </summary>
public WfExecutedResult StartProcess(WfAppRunner runner)
{
//启动流程
var wfService = new WorkflowService();
var result = wfService.StartProcess(runner);
return result;
}
示例10: CheckProcessInstanceRunning
/// <summary>
/// 检查流程是否已经运行
/// </summary>
/// <param name="runner">流程查询属性</param>
/// <returns></returns>
public Boolean CheckProcessInstanceRunning(WfAppRunner runner)
{
var isRunning = false;
var wfService = new WorkflowService();
var instance = wfService.GetRunningProcessInstance(runner);
if (instance != null)
{
isRunning = true;
}
return isRunning;
}
示例11: Complete
/// <summary>
/// 设置任务完成
/// </summary>
/// <param name="taskID">任务ID</param>
/// <param name="runner"></param>
/// <param name="wfLinqDataContext"></param>
internal void Complete(long taskID,
WfAppRunner runner,
IDbSession session)
{
TaskEntity task = Repository.GetById<TaskEntity>(taskID);
task.TaskState = (byte)TaskStateEnum.Completed;
task.EndedDateTime = DateTime.Now;
task.EndedByUserID = runner.UserID;
task.EndedByUserName = runner.UserName;
Update(task, session);
}
示例12: SetTaskRead2000
public void SetTaskRead2000()
{
WfAppRunner taskRunner = new WfAppRunner();
taskRunner.TaskID = 18014;
taskRunner.UserID = 10;
taskRunner.UserName = "Long";
IWorkflowService serviceA;
for (var i = 0; i < 2000; i++)
{
serviceA = new WorkflowService();
serviceA.SetTaskRead(taskRunner);
}
}
示例13: Complete
/// <summary>
/// 活动实例完成
/// </summary>
/// <param name="activityInstanceID"></param>
/// <param name="runner"></param>
/// <param name="session"></param>
internal void Complete(int activityInstanceID,
WfAppRunner runner,
IDbSession session)
{
var activityInstance = GetById(session.Connection, activityInstanceID, session.Transaction);
activityInstance.ActivityState = (short)ActivityStateEnum.Completed;
activityInstance.LastUpdatedByUserID = runner.UserID;
activityInstance.LastUpdatedByUserName = runner.UserName;
activityInstance.LastUpdatedDateTime = System.DateTime.Now;
activityInstance.EndedByUserID = runner.UserID;
activityInstance.EndedByUserName = runner.UserName;
activityInstance.EndedDateTime = System.DateTime.Now;
Update(activityInstance, session);
}
示例14: btnPrintOrder_Click
/// <summary>
/// 打单节点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPrintOrder_Click(object sender, EventArgs e)
{
WfAppRunner appRunner = new WfAppRunner();
appRunner.ProcessGUID = process_guid;
appRunner.AppInstanceID = application_instance_id;
appRunner.AppName = application_name;
appRunner.UserID = per_dict["yiran"];
appRunner.UserName = "yiran";
//先启动流程
var wfService = new WorkflowService();
var r1 = wfService.StartProcess(appRunner);
var msg = string.Format("生产订单流程开始:{0}, {1}\r\n", r1.Status, r1.Message);
WriteText(msg);
if (r1.Status == WfExecutedStatus.Success)
{
//打单环节加入条件,运行流程
var cond = new Dictionary<string, string>();
cond["CanUseStock"] = chkStock.Checked.ToString().ToLower();
cond["IsHavingWeight"] = chkWeight.Checked.ToString().ToLower();
appRunner.Conditions = cond;
string message = string.Empty;
var nextSteps = wfService.GetNextActivityTree(appRunner, cond);
if (nextSteps != null)
{
appRunner.NextActivityPerformers = CreateNextActivityPerformers(nextSteps);
var r2 = wfService.RunProcessApp(appRunner);
message = r2.Message;
WriteText(string.Format("执行【打单】: {0}, {1}\r\n", r2.Status, r2.Message));
if (r2.Status == WfExecutedStatus.Success)
{
WriteText(string.Format("任务已经发送到下一节点:{0}\r\n\r\n", nextSteps[0].ActivityName));
}
}
else
{
message = "下一步节点不匹配!";
WriteText(string.Format("{0}\r\n", message));
}
}
}
示例15: GetNextStepRoleUserTree
public ResponseResult<List<NodeView>> GetNextStepRoleUserTree(WfAppRunner runner)
{
var result = ResponseResult<List<NodeView>>.Default();
try
{
var wfservice = new WorkflowService();
var nodeViewList = wfservice.GetNextActivityRoleUserTree(runner).ToList<NodeView>();
result = ResponseResult<List<NodeView>>.Success(nodeViewList, "获取流程下一步信息成功!");
}
catch (System.Exception ex)
{
result = ResponseResult<List<NodeView>>.Error(string.Format(
" 请确认角色身份是否切换?! {0}",
ex.Message));
}
return result;
}