关于工作流加载的load事件的问题,求!!!解惑!!!

wqandxxj 2011-08-03 11:04:41

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", "");

...全文
183 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chiyan42 2011-08-03
  • 打赏
  • 举报
回复
前来学习,工作流没用过,帮你顶一下
wqandxxj 2011-08-03
  • 打赏
  • 举报
回复
- - 没人回答啊?????
wqandxxj 2011-08-03
  • 打赏
  • 举报
回复
每次运行到instance.load() 实例的加载事件的时候都会提示错误:
发生错误,名为 {urn:schemas-microsoft-com:System.Activities.Persistence/command}LoadWorkflow 的 InstancePersistenceCommand 已中断执行。

但是实例本身是在运行的时候进行的持久化操作 这里不需要 求解惑!!!
wqandxxj 2011-08-03
  • 打赏
  • 举报
回复
貌似现在学习工作流的真不多 还是我帖子发错区了??? 这个在平时的工业方面经常会用到吧

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧