阅读:3083 回复:4
Jingpai
7

帖子

19

跟帖

727

积分

中级榴莲
中级榴莲
  • 社区居民

[求助]流程发起后没有流程名称异常的问题。

楼主#
更多 发布于:2016-08-04 14:57
1、流程实例查询页面查到流程名称为:"流程模版名.版本号”
2、后台数据库中InstanceContent表中立场名称为:"流程模版名.版本号”。
3、 [H3CloudLog].[dbo].[OT_Notification]表中找到的流程名称为正确的流程名称。


用户给我反馈的时候,我都惊呆了。为什么用流程管理打开看不到名称,只能通过邮件才能看到。
以下代码是写入日志的代码,titile也是从流程中取的,为什么这里就有了呢?求大神解答。


public void OnCreated(OThinker.H3.IEngine Engine, OThinker.H3.WorkItem.WorkItem Obj)
       {
           if (Obj.State == WorkItemState.Finished || Obj.State == WorkItemState.Canceled)
           {
               Engine.LogWriter.Write("WorkItem Handler Jump Success:" + Obj.WorkItemID);
           }
           else
           {
               try
               {
                   Engine.LogWriter.Write("WorkItem Handler Create Start:" + Obj.WorkItemID);
                   if (Obj.TokenId == 1)
                   {
                       Engine.LogWriter.Write("First Activity Return:" + Obj.WorkItemID);
                       return;
                   }
      
                   OThinker.Organization.User user = Engine.Organization.GetUnit(Obj.Participant) as OThinker.Organization.User;
      
                   OThinker.H3.WorkflowTemplate.PublishedWorkflowTemplate workflow =Engine.WorkflowManager.GetPublishedTemplate(Obj.WorkflowCode,Obj.WorkflowVersion);
                   OThinker.H3.WorkflowTemplate.Activity activity = workflow.GetActivityByCode(Obj.ActivityCode);
      
                   InstanceContext context = Engine.InstanceManager.GetInstanceContext(Obj.InstanceId);
                   string title = context.InstanceName; // 流程实例名称
                   title += string.IsNullOrEmpty(title) ? "" : ".";
                   title += Obj.ActivityDisplayName;
      
      
                   try
                   {
      
                       //发送待办
                       if (CheckIsNeedTask(Obj.WorkflowCode, Obj.ActivityCode, "1",Engine))
                       {
                           AddTask(title, Obj, Engine);
                           Engine.LogWriter.Write("WorkItem Handler Create Success:" + Obj.WorkItemID);
      
                       }
      
                       if (user.CheckNotification(OThinker.Organization.NotificationType.NewWorkItem))
                       {
      
                           if (Obj.EmailNotification)
                           {// 接收新邮件通知,才发邮件
                               //发送lotus邮件提醒
                               if (!string.IsNullOrEmpty(user.Email))
                               {
                                   OThinker.H3.Notification.Notification notify = new OThinker.H3.Notification.Notification()
                                   {
                                       Content = string.Empty,
                                       Title = title,
                                       InstanceId = Obj.InstanceId,
                                       Type = OThinker.H3.Notification.NotifyType.Other,
                                       ReceiverID = Obj.Participant,
                                       ReceiverAddress = user.Email,
                                       BizObjectId=Obj.ObjectID
                                   };
                                   Engine.Notifier.Notify(notify);
      
                                   Engine.LogWriter.Write("WorkItem Handler Send Email Success:" + Obj.WorkItemID);
      
                               }
                               if(!string.IsNullOrEmpty(user.EmployeeNumber))
                               {//发送微信消息
                                   OThinker.H3.Notification.Notification notify = new OThinker.H3.Notification.Notification()
                                   {
                                       Content = string.Empty,
                                       Title = title,
                                       InstanceId = Obj.InstanceId,
                                       Type = OThinker.H3.Notification.NotifyType.CustomType4,
                                       ReceiverID = Obj.Participant,
                                       ReceiverAddress = user.EmployeeNumber,
                                       BizObjectId = Obj.ObjectID
                                   };
                                   Engine.Notifier.Notify(notify);
      
                                   Engine.LogWriter.Write("WorkItem Handler Send WeChart Success:" + Obj.WorkItemID);
      
                               }
      
                           }
      
                       }
                   }
                   catch (Exception ex)
                   {
                       Engine.LogWriter.Write("WorkItem Handler Create Fail:" + Obj.WorkItemID + ",Exception:" + ex.Message);
                   }
               }
               catch (Exception e)
               {
                   Engine.LogWriter.Write("创建待办事务发生致命错误:" + Obj.WorkItemID + ",Exception:" + e.Message);
               }
           }
       }
limingwl
4

帖子

44

跟帖

764

积分

中级榴莲
中级榴莲
1楼#
发布于:2016-08-04 15:57
你检查一下“劲牌公司入职调岗流程”有没有在流程模板上配置流程名称;
Jingpai
7

帖子

19

跟帖

727

积分

中级榴莲
中级榴莲
  • 社区居民
2楼#
发布于:2016-08-04 16:15
limingwl:你检查一下“劲牌公司入职调岗流程”有没有在流程模板上配置流程名称;回到原帖
这个流程调用webservice接口发起的流程。设置是没有错误的,因为有的流程有名称,但是有的流程没有名称。
上善若水
17

帖子

1282

跟帖

12345

积分

管理员
管理员
  • 社区居民
3楼#
发布于:2016-08-04 16:55
楼主,如果在截图提问的时候有涉及贵司的一些信息的话建议打码隐藏一下,以免泄露不必要的信息,仅为建议,请参考。
H3 BPM 让天下没有难用的流程。全国统一服务热线 :400-889-8625
Jingpai
7

帖子

19

跟帖

727

积分

中级榴莲
中级榴莲
  • 社区居民
4楼#
发布于:2016-08-05 08:33
上善若水:楼主,如果在截图提问的时候有涉及贵司的一些信息的话建议打码隐藏一下,以免泄露不必要的信息,仅为建议,请参考。回到原帖
多谢提醒,之前没注意。
游客

返回顶部