提交申请时,可以选择流程模板

This commit is contained in:
yubaolee
2016-09-16 18:05:57 +08:00
parent dbdfbaab52
commit 5996d6b5f7
9 changed files with 43 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ namespace OpenAuth.Mvc.Controllers
{
apply.UserId = AuthUtil.GetCurrentUser().User.Id;
_app.AddOrUpdate(apply);
CreateWorkflowIfNotExists(apply.Id);
CreateWorkflowIfNotExists(apply.Id,apply.WorkflowName);
}
catch (Exception ex)
@@ -110,14 +110,14 @@ namespace OpenAuth.Mvc.Controllers
}
private void CreateWorkflowIfNotExists(Guid id)
private void CreateWorkflowIfNotExists(Guid id, string schemecode)
{
if (WorkflowInit.Runtime.IsProcessExists(id))
return;
using (var sync = new WorkflowSync(WorkflowInit.Runtime, id))
{
WorkflowInit.Runtime.CreateInstance("SimpleWF", id);
WorkflowInit.Runtime.CreateInstance(schemecode, id);
sync.StatrtWaitingFor(new List<ProcessStatus> { ProcessStatus.Initialized, ProcessStatus.Initialized });