Exemplo n.º 1
0
        private ProcessEventMessage GetProEventMessageModel(InterfaceContextModel input, Guid eventId)
        {
            return(new ProcessEventMessage()
            {
                FormId = input.FormId,
                EventType = input.EventType,
                ActivityName = input.ActivityName,
                RejectActivityName = input.RejectActivityName,
                ProcInstID = input.ProcInstID,
                ActInstID = input.ActInstID,
                EventInterfaceId = eventId,

                RequstID = Guid.NewGuid().ToString()
            });
        }
Exemplo n.º 2
0
        public HttpResponseMessage OnActStarted([FromBody] InterfaceContextModel input)
        {
            logger.Info("流程事件", $"Start OnActStarted FormId {input.FormId} ProcInstID {input.ActInstID} ActivityName {input.ActivityName}");
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();

            //var formDataToJson = baseBusinessService.GetFormDataToJson(input.FormId);
            //业务逻辑

            stopwatch.Stop();
            TimeSpan timespan = stopwatch.Elapsed;

            logger.Info("流程事件", $"End OnActStarted FormId {input.FormId} ProcInstID {input.ActInstID} ActivityName {input.ActivityName} 执行时间:{timespan.TotalMilliseconds} ms");
            return(new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.OK
            });
        }
Exemplo n.º 3
0
        public HttpResponseMessage ActivityRejectInterface([FromBody] InterfaceContextModel input)
        {
            logger.Info("调用并节点驳回接口", $"Start ActivityRejectInterface Data:{ JsonConvert.SerializeObject(input) }");
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();

            try
            {
                string _busServiceEntranceUrl = _dictionaryContext[SettingType.EnvironmentVariable, SettingVariable.PushBusServiceEntranceUrl];//推送业务系统接口地址

                var eventInterfaceList = _eventBusinessInterfaceService.GetProcessEventInterfaceList(input.FormId, input.EventType, input.ActivityName, input.RejectActivityName);
                if (eventInterfaceList.Count == 0)
                {
                    var processEvent = (ProcessEventEnum)Enum.Parse(typeof(ProcessEventEnum), input.EventType);
                    logger.Warn("调用并节点驳回接口", $"End ActivityRejectInterface Data:{ JsonConvert.SerializeObject(input) }.FormId:{ input.FormId }没有配置“{ processEvent.GetDescription() }”事件接口。");
                    return(new HttpResponseMessage()
                    {
                        StatusCode = System.Net.HttpStatusCode.OK
                    });
                }
                else
                {
                    foreach (var interfaceInfo in eventInterfaceList)
                    {
                        var processEventMsg = GetProEventMessageModel(input, interfaceInfo.InterfaceId);
                        KStar.Jobs.EventBusHttpService.QueueHttpsRequest(_busServiceEntranceUrl, Newtonsoft.Json.JsonConvert.SerializeObject(processEventMsg));
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, $"FormId:{ input.FormId }");
            }

            stopwatch.Stop();
            TimeSpan timespan = stopwatch.Elapsed;

            logger.Info("调用并节点驳回接口", $"End ActivityRejectInterface Data:{ JsonConvert.SerializeObject(input) } 执行时间:{timespan.TotalMilliseconds} ms");
            return(new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.OK
            });
        }