本文整理匯總了C#中Slickflow.Engine.Service.WorkflowService類的典型用法代碼示例。如果您正苦於以下問題:C# WorkflowService類的具體用法?C# WorkflowService怎麽用?C# WorkflowService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WorkflowService類屬於Slickflow.Engine.Service命名空間,在下文中一共展示了WorkflowService類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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();
}
}
示例2: 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");
}
}
示例3: 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;
}
示例4: EntrustTask
public ResponseResult EntrustTask(TaskEntrustedEntity entity)
{
IWorkflowService service = new WorkflowService();
service.EntrustTask(entity);
return ResponseResult.Success();
}
示例5: DiscardProcess
public ResponseResult DiscardProcess(WfAppRunner discarder)
{
IWorkflowService service = new WorkflowService();
var result = service.DiscardProcess(discarder);
return ResponseResult.Success();
}
示例6: StartProcess
/// <summary>
/// 啟動流程
/// </summary>
public WfExecutedResult StartProcess(WfAppRunner runner)
{
//啟動流程
var wfService = new WorkflowService();
var result = wfService.StartProcess(runner);
return result;
}
示例7: button1_Click
private void button1_Click(object sender, EventArgs e)
{
TaskQueryEntity query = new TaskQueryEntity();
query.AppInstanceID = "4612";
query.AppName = "order";
query.UserID = "2";
var wfService = new WorkflowService();
wfService.GetRunningTasks(query);
}
示例8: FlowList
/// <summary>
/// 當前用戶代辦任務列表(一次加載所有數據)
/// </summary>
/// <returns></returns>
public ActionResult FlowList()
{
IWorkflowService service = new WorkflowService();
TaskQueryEntity en = new TaskQueryEntity
{
UserID = User.Identity.GetUserId()
};
IList<TaskViewEntity> taskViewList = service.GetReadyTasks(en);
return View(taskViewList);
}
示例9: 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;
}
示例10: InitFlowXmlInfo
protected void InitFlowXmlInfo()
{
String ProcessGUID = Request.QueryString["ProcessGUID"] == null ? String.Empty : Request.QueryString["ProcessGUID"].ToString();
if (ProcessGUID != String.Empty)
{
IWorkflowService wfService = new WorkflowService();
ProcessFileEntity processFileEntity = wfService.GetProcessFile(ProcessGUID);
if (processFileEntity != null)
{
this.txtProcessGUID.Value = processFileEntity.ProcessGUID.ToString();
this.wfxml.InnerHtml = processFileEntity.XmlContent;
}
}
}
示例11: 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);
}
}
示例12: GetPerformerList
/// <summary>
/// 獲取任務辦理人列表
/// </summary>
/// <param name="processInstanceID"></param>
/// <param name="roles"></param>
/// <returns></returns>
public PerformerList GetPerformerList(int processInstanceID, List<Role> roles)
{
PerformerList performers = null;
//獲取流程發起人信息,在xml定義中有role變量:-1
if (roles.Count == 1 && roles[0].RoleCode == "-1")
{
IWorkflowService service = new WorkflowService();
Performer initiator = service.GetProcessInitiator(processInstanceID);
performers = new PerformerList();
performers.Add(initiator);
}
return performers;
}
示例13: GetReadyTasks
/// <summary>
/// 獲取當前用戶待辦任務列表
/// </summary>
private void GetReadyTasks()
{
IWorkflowService wfService = new WorkflowService();
TaskQueryEntity en = new TaskQueryEntity
{
UserID = LoginUserID.ToString()
};
IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en);
if (taskViewList != null)
{
Repeater2.DataSource = taskViewList;
Repeater2.DataBind();
}
}
示例14: QueryProcessFile
/// <summary>
/// 讀取XML文件
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ResponseResult<ProcessFileEntity> QueryProcessFile(ProcessFileQuery query)
{
var result = ResponseResult<ProcessFileEntity>.Default();
try
{
var wfService = new WorkflowService();
var entity = wfService.GetProcessFile(query.ProcessGUID, query.Version);
result = ResponseResult<ProcessFileEntity>.Success(entity);
}
catch (System.Exception ex)
{
result = ResponseResult<ProcessFileEntity>.Error(string.Format("獲取流程XML文件失敗!{0}", ex.Message));
}
return result;
}
示例15: 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));
}
}
}