CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  企业开发 >  BizTalk Server

Biztalk中碰到的难题?

楼主lym51(老玉米)2005-05-10 10:55:11 在 企业开发 / BizTalk Server 提问

如果Biztalk中的某一个业务流程被挂起或正在执行,如何通过Client程序去终止该业务流程?  
   
  能解决该问题者,高分相谢!!!!!!! 问题点数:100、回复次数:6Top

1 楼OSDN(相忘于江湖)回复于 2005-05-11 09:33:12 得分 10

能否具体解释一下这里的Client程序,譬如?Top

2 楼lym51(老玉米)回复于 2005-05-11 10:20:30 得分 0

就是我用自己写的exe程序去终止Biztalk中被挂起的业务流程实例。Top

3 楼lym51(老玉米)回复于 2005-05-19 17:31:38 得分 0

现在到这里来的高手越来越少了!!!!!!!!!!!!!!!Top

4 楼lym51(老玉米)回复于 2005-05-21 10:34:02 得分 0

自己顶一下,唉!!!!!!!!!!!!Top

5 楼xz_king(西煞魄工人)回复于 2005-05-24 00:45:39 得分 10

BTS主要用来完成一个完整的业务流程,中间出现的任务问题都可以在HAT中找到答案。  
  如果你非要实现使用Client去控制一个流程,就要对MessageBoxDB非常了解,并对数据直接进行操作。  
   
  以我现在对BTS的研究成度,暂时还无法找到一个合适的方案来解决你的问题。  
  Top

6 楼OSDN(相忘于江湖)回复于 2005-05-31 09:55:19 得分 80

可以通过调用Biztalk的WMI对象来解决这个问题,如下示例代码:  
  using   System.Management;  
                  public   void   ResumeSvcInstByOrchestrationName(string   strOrchestrationName)  
                  {  
                          try  
                          {  
                                  const   uint   SERVICE_CLASS_ORCHESTRATION   =   1;  
                                  const   uint   SERVICE_STATUS_SUSPENDED_RESUMABLE   =   4;  
                                  const   uint   REGULAR_RESUME_MODE   =   1;  
   
                                  //   Query   for   suspended   (resumable)   service   instances   of   the   specified   orchestration  
                                  //   Suggestion:   Similar   queries   can   be   written   for   Suspend/Terminate   operations   by   using   different   ServiceStatus   value.     See   MOF   definition   for   details.  
                                  string   strWQL   =   string.Format(  
                                          "SELECT   *   FROM   MSBTS_ServiceInstance   WHERE   ServiceClass   =   {0}   AND   ServiceStatus   =   {1}   AND   ServiceName   =   \"{2}\"",  
                                          SERVICE_CLASS_ORCHESTRATION.ToString(),   SERVICE_STATUS_SUSPENDED_RESUMABLE.ToString(),   strOrchestrationName);    
                                  ManagementObjectSearcher   searcherServiceInstance   =   new   ManagementObjectSearcher   (new   ManagementScope   ("root\\MicrosoftBizTalkServer"),   new   WqlObjectQuery(strWQL),   null);  
                                  int   nNumSvcInstFound   =   searcherServiceInstance.Get().Count;  
                                  //   If   we   found   any  
                                  if   (   nNumSvcInstFound   >   0   )  
                                  {  
                                          //   Construct   ID   arrays   to   be   passed   into   ResumeServiceInstancesByID()   method  
                                          string[]   InstIdList   =   new   string[nNumSvcInstFound];  
                                          string[]   ClassIdList   =   new   string[nNumSvcInstFound];  
                                          string[]   TypeIdList   =   new   string[nNumSvcInstFound];  
                                          string   strHost   =   string.Empty;  
                                          string   strReport   =   string.Empty;  
                                          int   i   =   0;  
                                          foreach   (   ManagementObject   objServiceInstance   in   searcherServiceInstance.Get()   )  
                                          {  
                                                  //   It   is   safe   to   assume   that   all   service   instances   belong   to   a   single   Host.  
                                                  if   (   strHost   ==   string.Empty   )  
                                                          strHost   =   objServiceInstance["HostName"].ToString();  
                                                  ClassIdList[i]   =   objServiceInstance["ServiceClassId"].ToString();  
                                                  TypeIdList[i]     =   objServiceInstance["ServiceTypeId"].ToString();  
                                                  InstIdList[i]     =   objServiceInstance["InstanceID"].ToString();  
                                                  strReport   +=   string.Format("     {0}\n",   objServiceInstance["InstanceID"].ToString());  
                                                  i++;  
                                          }  
                                          //   Load   the   MSBTS_HostQueue   with   Host   name   and   invoke   the   "ResumeServiceInstancesByID"   method  
                                          string   strHostQueueFullPath   =   string.Format("root\\MicrosoftBizTalkServer:MSBTS_HostQueue.HostName=\"{0}\"",   strHost);  
                                          ManagementObject   objHostQueue   =   new   ManagementObject(strHostQueueFullPath);  
                                          //   Note:   The   ResumeServiceInstanceByID()   method   processes   at   most   2047   service   instances   with   each   call.  
                                          //       If   you   are   dealing   with   larger   number   of   service   instances,   this   script   needs   to   be   modified   to   break   down   the  
                                          //       service   instances   into   multiple   batches.  
                                          objHostQueue.InvokeMethod("ResumeServiceInstancesByID",  
                                                  new   object[]   {ClassIdList,   TypeIdList,   InstIdList,   REGULAR_RESUME_MODE}  
                                          );  
                                          Console.WriteLine(   string.Format("Service   instances   with   the   following   service   instance   IDs   have   been   resumed:\n{0}",   strReport)   );  
                                  }  
                                  else  
                                  {  
                                          System.Console.WriteLine(string.Format("There   is   no   suspended   (resumable)   service   instance   found   for   orchestration   '{0}'.",   strOrchestrationName));  
                                  }  
                          }  
                          catch(Exception   excep)  
                          {  
                                  Console.WriteLine("Error:   "   +   excep.Message);  
                          }  
                  }Top

相关问题

  • 用StretchDIBits()时碰到的难题
  • 刚工作,碰到的难题
  • 碰到难题了,请大家帮忙!
  • 利用泛型编程巧妙解决ATL开发COM中碰到的若干难题
  • --利用泛型编程巧妙解决ATL开发COM中碰到的若干难题
  • 我碰到了难题,所以要找大侠
  • 小妹碰到了难题,各位大哥请帮忙!!
  • 有谁碰到这样的网络难题吗?
  • 碰到了难题,关于资料档案库的
  • 又碰到难题了,大伙帮帮忙。

关键词

  • biztalk
  • 流程
  • 业务
  • 解决
  • service
  • orchestration
  • suspended
  • 业务流程
  • resumable
  • 程序

得分解答快速导航

  • 帖主:lym51
  • OSDN
  • xz_king
  • OSDN

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo