本文整理汇总了C#中Slickflow.Engine.Common.WfAppRunner类的典型用法代码示例。如果您正苦于以下问题:C# WfAppRunner类的具体用法?C# WfAppRunner怎么用?C# WfAppRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WfAppRunner类属于Slickflow.Engine.Common命名空间,在下文中一共展示了WfAppRunner类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:35,代码来源:TransitionInstanceManager.cs
示例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");
}
}
开发者ID:zengfanlin,项目名称:Slickflow,代码行数:37,代码来源:MOrderUserCaseForm.cs
示例4: DiscardProcess
public ResponseResult DiscardProcess(WfAppRunner discarder)
{
IWorkflowService service = new WorkflowService();
var result = service.DiscardProcess(discarder);
return ResponseResult.Success();
}
开发者ID:yydon,项目名称:slickflow,代码行数:7,代码来源:WfTaskMISubProcessController.cs
示例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();
}
}
开发者ID:yydon,项目名称:slickflow,代码行数:30,代码来源:WfTaskMISubProcessController.cs
示例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;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:29,代码来源:FormOfficeIn.cs
示例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;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:28,代码来源:FormOfficeInXorSplitXorJoin.cs
示例8: ActivityResource
internal ActivityResource(WfAppRunner runner,
IDictionary<string, PerformerList> nextActivityPerformers,
IDictionary<string, string> conditionKeyValuePair = null)
{
AppRunner = runner;
NextActivityPerformers = nextActivityPerformers;
ConditionKeyValuePair = conditionKeyValuePair;
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:8,代码来源:ActivityResource.cs
示例9: StartProcess
/// <summary>
/// 启动流程
/// </summary>
public WfExecutedResult StartProcess(WfAppRunner runner)
{
//启动流程
var wfService = new WorkflowService();
var result = wfService.StartProcess(runner);
return result;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:11,代码来源:WfAppInteropService.cs
示例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;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:16,代码来源:WfAppInteropService.cs
示例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);
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:18,代码来源:TaskManager.cs
示例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);
}
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:14,代码来源:PerformanceTest.cs
示例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);
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:21,代码来源:ActivityInstanceManager.cs
示例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));
}
}
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:53,代码来源:MOrderUserCaseForm.cs
示例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;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:17,代码来源:WfController.cs
示例16: CreateRuntimeInstanceAppRunning
/// <summary>
/// 创建运行时实例
/// </summary>
/// <param name="appName"></param>
/// <param name="appInstanceID"></param>
/// <param name="processGUID"></param>
/// <param name="userID"></param>
/// <param name="userName"></param>
/// <param name="nextActivityPerformers"></param>
/// <returns></returns>
public static WfRuntimeManager CreateRuntimeInstanceAppRunning(
WfAppRunner runner,
ref WfExecutedResult result)
{
//检查传人参数是否有效
var rmins = new WfRuntimeManagerAppRunning();
rmins.WfExecutedResult = result = new WfExecutedResult();
if (string.IsNullOrEmpty(runner.AppName)
|| String.IsNullOrEmpty(runner.AppInstanceID)
|| runner.ProcessGUID == null)
{
result.Status = WfExecutedStatus.Exception;
result.ExceptionType = WfExceptionType.RunApp_ErrorArguments;
result.Message = "方法参数错误,无法运行流程!";
return rmins;
}
//传递runner变量
rmins.AppRunner = runner;
var aim = new ActivityInstanceManager();
TaskViewEntity taskView = null;
var runningNode = aim.GetRunningNodeOfMine(runner, out taskView);
//判断是否是当前登录用户的任务
if (runningNode.AssignedToUsers.Contains(runner.UserID.ToString()) == false)
{
result.Status = WfExecutedStatus.Exception;
result.ExceptionType = WfExceptionType.RunApp_HasNoTask;
result.Message = "当前没有登录用户要办理的任务,无法运行流程!";
return rmins;
}
var processModel = new ProcessModel(runningNode.ProcessGUID);
var activityResource = new ActivityResource(runner, runner.NextActivityPerformers, runner.Conditions);
var tm = new TaskManager();
rmins.TaskView = taskView;
rmins.RunningActivityInstance = runningNode;
rmins.ProcessModel = processModel;
rmins.ActivityResource = activityResource;
return rmins;
}
开发者ID:zengcheng,项目名称:Slickflow,代码行数:54,代码来源:WfRuntimeManagerFactory.cs
示例17: Cancel
/// <summary>
/// 流程的取消操作
/// </summary>
/// <returns>是否成功</returns>
internal bool Cancel(WfAppRunner runner, IDbConnection conn = null)
{
bool isCanceled = false;
if (conn == null)
{
conn = SessionFactory.CreateConnection();
}
try
{
var entity = GetProcessInstanceLatest(runner.AppName,
runner.AppInstanceID,
runner.ProcessGUID);
if (entity == null || entity.ProcessState != (short)ProcessStateEnum.Running)
{
throw new WorkflowException("无法取消流程,错误原因:当前没有运行中的流程实例,或者同时有多个运行中的流程实例(不合法数据)!");
}
IDbSession session = SessionFactory.CreateSession();
entity.ProcessState = (short)ProcessStateEnum.Canceled;
entity.RecordStatusInvalid = 1;
entity.LastUpdatedByUserID = runner.UserID;
entity.LastUpdatedByUserName = runner.UserName;
entity.LastUpdatedDateTime = System.DateTime.Now;
Update(entity, session);
isCanceled = true;
}
catch (System.Exception e)
{
throw new WorkflowException(string.Format("取消流程实例失败,错误原因:{0}", e.Message));
}
finally
{
conn.Close();
}
return isCanceled;
}
开发者ID:uname-yang,项目名称:WorkFlow-Engine-OData-WebApi-with-OdataClient,代码行数:44,代码来源:ProcessInstanceManager.cs
示例18: btnJump_Click
/// <summary>
/// 跳转流程
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnJump_Click(object sender, EventArgs e)
{
WfAppRunner appRunner = new WfAppRunner();
appRunner.ProcessGUID = process_guid;
appRunner.AppInstanceID = application_instance_id;
appRunner.AppName = "WallwaOrder";
appRunner.UserID = "1";
appRunner.UserName = "admin";
//下一步执行人
PerformerList list = new PerformerList();
Performer p = new Performer("13", "andun");//下一步人ID,Name
list.Add(p);
Dictionary<String, PerformerList> dict = new Dictionary<String, PerformerList>();
dict.Add("7c1aa9f9-7f0f-46bf-a219-0b80fdfbbe3d", list); //print activity:"fc8c71c5-8786-450e-af27-9f6a9de8560f"下一步节点的标识ID
appRunner.NextActivityPerformers = dict;
IWorkflowService wfService = new WorkflowService();
var result = wfService.JumpProcess(appRunner);
var msg = string.Format("流程跳转结果:{0}\r\n", result.Status);
textBox1.Text += msg;
}
开发者ID:zengfanlin,项目名称:Slickflow,代码行数:28,代码来源:FlowForm.cs
示例19: btnRun_Click
/// <summary>
/// 运行流程
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnRun_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();
TaskQueryEntity en = new TaskQueryEntity
{
UserID = "1"
};
IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en);
if (taskViewList != null)
{
dataGridView1.DataSource = taskViewList;
}
////下一步执行人
//PerformerList list = new PerformerList();
//Performer p = new Performer("3", "user3");
//下一步人ID,Name 注意有角色区分
//list.Add(p);
//Dictionary<string, string> dictCondition = new Dictionary<string, string>();
//dictCondition.Add("IsHavingWeight", "true");
//dictCondition.Add("CanUseStock", "false");
//appRunner.Conditions = dictCondition;
//NodeView nv = wfService.GetNextActivity(appRunner);//, dictCondition
//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", result.Status);
textBox1.Text += msg;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:42,代码来源:FlowForm.cs
示例20: RunProcess
/// <summary>
/// 工作流运行
/// </summary>
/// <param name="session"></param>
/// <param name="runner"></param>
/// <returns></returns>
public WfExecutedResult RunProcess(IDbSession session, WfAppRunner runner, IDictionary<string, string> conditions = null)
{
var result = new WfExecutedResult();
var wfService = new WorkflowService();
var nodeViewList = wfService.GetNextActivityTree(runner, conditions).ToList<NodeView>();
foreach (var node in nodeViewList)
{
var performerList = wfService.GetPerformerList(node); //根据节点角色定义,读取执行者列表
Dictionary<string, PerformerList> dict = new Dictionary<string, PerformerList>();
dict.Add(node.ActivityGUID, performerList);
runner.NextActivityPerformers = dict;
if (node.IsSkipTo == true)
{
result = wfService.JumpProcess(session.Connection, runner, session.Transaction);
}
else
{
result = wfService.RunProcessApp(session.Connection, runner, session.Transaction);
}
}
return result;
}
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:30,代码来源:WfAppInteropService.cs
注:本文中的Slickflow.Engine.Common.WfAppRunner类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论