阅读:3755
回复:4
|
[求助]流程发起后没有流程名称异常的问题。
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); } } } |
1楼#
发布于:2016-08-04 15:57
你检查一下“劲牌公司入职调岗流程”有没有在流程模板上配置流程名称;
|
|
2楼#
发布于:2016-08-04 16:15
|
|
3楼#
发布于:2016-08-04 16:55
楼主,如果在截图提问的时候有涉及贵司的一些信息的话建议打码隐藏一下,以免泄露不必要的信息,仅为建议,请参考。
|
|
|
4楼#
发布于:2016-08-05 08:33
|
|