110,536
社区成员
发帖
与我相关
我的任务
分享
int _wfObjID = int.Parse(reqMsg.GetParaVal("WFObjID").ToString());
Guid guid = Guid.Parse(reqMsg.GetParaVal("InstanceID").ToString());
WFObj _wfObj = WFManager.GetWFObjFromDB(_wfObjID);
UTF8Encoding _utf8 = new UTF8Encoding();
byte[] _bs = _utf8.GetBytes(_wfObj.Definition);
MemoryStream _memoryStream = new MemoryStream(_bs);
Activity _activity = ActivityXamlServices.Load(_memoryStream);
WorkflowApplication instance = new WorkflowApplication(_activity);
if (instanceStore == null)
{
string connectionString = "Server=10.100.111.211;Database=WorkflowStore;Uid=sa;Pwd=gtja.8888";
instanceStore = new SqlWorkflowInstanceStore(connectionString);
view = instanceStore.Execute(instanceStore.CreateInstanceHandle(), new CreateWorkflowOwnerCommand(), TimeSpan.FromSeconds(30));
instanceStore.DefaultInstanceOwner = view.InstanceOwner;
}
instance.InstanceStore = instanceStore;
instance.PersistableIdle = persistableIdle;
instance.Idle = workflowIdle;
instance.Unloaded = unload;
instance.Completed = workflowCompleted;
instance.Load(guid);
if (instance.GetBookmarks().Count(p => p.BookmarkName == "zork") == 1)
instance.ResumeBookmark("zork", "");