Ejemplo n.º 1
0
        public HttpResponseMessage RouteCase([FromBody] WorkFlowCaseDto workFlowCaseDto)
        {
            try
            {
                Setup();

                _logger.WriteLogEntry(_tenantId.ToString(),
                                      new List <object> {
                    workFlowCaseDto
                },
                                      string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name),
                                      LogLevelType.Info);

                var service = ProcessMakerServiceFactory.Create(_tenantId, workFlowCaseDto.EquipmentId);
                service.RouteCase(workFlowCaseDto.CaseId, workFlowCaseDto.Index);
                return(this.Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                _logger.WriteLogEntry(_tenantId.ToString(),
                                      new List <object> {
                    workFlowCaseDto
                },
                                      string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name),
                                      LogLevelType.Error,
                                      ex.GetInnerMostException());
                throw;
            }
        }
Ejemplo n.º 2
0
        public HttpResponseMessage RetrieveCases(int equipmentId)
        {
            try
            {
                Setup();

                _logger.WriteLogEntry(_tenantId.ToString(),
                                      new List <object> {
                    equipmentId
                },
                                      string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name),
                                      LogLevelType.Info);

                var service = ProcessMakerServiceFactory.Create(_tenantId, equipmentId);
                var list    = service.RetrieveCaseList().SerializeObjectToString();
                return(this.Request.CreateResponse(HttpStatusCode.OK, list));
            }
            catch (Exception ex)
            {
                _logger.WriteLogEntry(_tenantId.ToString(),
                                      new List <object> {
                    equipmentId
                },
                                      string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name),
                                      LogLevelType.Error,
                                      ex.GetInnerMostException());
                throw;
            }
        }