public void TestSyncExpiredTask() { string url = Formatter.CombinePath(apiHost, @"api/k2callback/syncexpiredtask"); IList <WebApiQueryParam> _queryParams = new List <WebApiQueryParam>(); _queryParams.Add(new WebApiQueryParam("procInstID", "6444")); _queryParams.Add(new WebApiQueryParam("originalTaskID", "CAAFA419-0EDD-4CAA-BD9C-2FDD2E66E016")); MCDAMReturnObject _returnAMObject = WebApiProxy.Call <MCDAMReturnObject>(url, _queryParams, "POST"); Console.WriteLine("Result: {0}", JsonConvert.SerializeObject(_returnAMObject, Formatting.Indented)); }
public void TestPrepareTask() { string url = Formatter.CombinePath(apiHost, @"api/k2callback/preparetask"); IList <WebApiQueryParam> _queryParams = new List <WebApiQueryParam>(); _queryParams.Add(new WebApiQueryParam("procInstID", "1104")); _queryParams.Add(new WebApiQueryParam("taskID", "CAAFA419-0EDD-4CAA-BD9C-2FDD2E66E016")); _queryParams.Add(new WebApiQueryParam("taskURL", ConvertHelper.Base64Encode("/MajorLease/Main#/MajorLease/ConsInvtChecking/Process/View?ProcInstID=1104"))); _queryParams.Add(new WebApiQueryParam("receiverID", "E5006154")); _queryParams.Add(new WebApiQueryParam("creater", "bpm.service")); _queryParams.Add(new WebApiQueryParam("k2SN", "1104_24")); _queryParams.Add(new WebApiQueryParam("activity", ConvertHelper.Base64Encode("Supervisor Approval"))); MCDAMReturnObject _returnAMObject = WebApiProxy.Call <MCDAMReturnObject>(url, _queryParams, "POST"); Console.WriteLine("Result: {0}", JsonConvert.SerializeObject(_returnAMObject, Formatting.Indented)); }
/// <summary> /// Call the mcdonalds AM api. /// </summary> /// <param name="url">The URL.</param> /// <param name="queryParams">The query parameters.</param> /// <param name="httpMethod">The HTTP method.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> private bool CallAMAPI(string url, IList <WebApiQueryParam> queryParams = null, string httpMethod = "GET") { bool _isExecuted = false; MCDAMReturnObject _returnAMObject = WebApiProxy.Call <MCDAMReturnObject>(url, queryParams, httpMethod); if (_returnAMObject != null) { if (!string.IsNullOrEmpty(_returnAMObject.ReturnData)) { _isExecuted = ConvertHelper.ToBool(_returnAMObject.ReturnData); } if (_isExecuted == false && !string.IsNullOrEmpty(_returnAMObject.ErrorMessage)) { LogMCDAMApiException(_returnAMObject, true); } } return(_isExecuted); }