From 20df6573e4d4a64fffbac0cfc96258d42c39d418 Mon Sep 17 00:00:00 2001 From: daisukenishino2 Date: Wed, 23 May 2018 18:16:51 +0900 Subject: [PATCH 1/5] Added the Xml/SPDefinition.xml. --- .../AsyncProcessingService/Xml/SPDefinition.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml diff --git a/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml b/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml new file mode 100644 index 0000000..6baf634 --- /dev/null +++ b/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml @@ -0,0 +1,15 @@ + + + + +]> + + + + + + + From 3524d0ce9477cb97f774e7f58ecadd829a4e48ca Mon Sep 17 00:00:00 2001 From: daisukenishino2 Date: Fri, 24 Aug 2018 23:39:31 +0900 Subject: [PATCH 2/5] fixed #4 fixed #5 fixed #6 fixed #7 fixed #8 --- .../Xml/TMProtocolDefinition.xml | 17 +- root/programs/CS/6_CopyToService.bat | 1 + root/programs/CS/7_SubmitTask.bat | 1 + .../AsyncProcessingService.cs | 232 ++++++----- .../AsyncProcessingService/app.config | 11 +- .../AsyncProcessingService/ApsLayerB.cs | 259 ++++++++++++ .../AsyncProcessingService/ApsLayerD.cs | 338 ++++++++++++++++ ...ParameterValue.cs => ApsParameterValue.cs} | 108 +---- ...erviceReturnValue.cs => ApsReturnValue.cs} | 9 +- .../AsyncProcessingService/ApsUtility.cs | 115 ++++++ .../Business/AsyncProcessingService/LayerB.cs | 262 ------------- .../Business/AsyncProcessingService/LayerD.cs | 368 ------------------ .../AsyncProcessingService/MyApsBaseLogic.cs | 12 +- .../Infrastructure/Business/Business.csproj | 9 +- .../AsyncSvc_sample/App.config | 3 + .../AsyncSvc_sample/AsyncSvc_sample.csproj | 8 + .../AsyncSvc_sample/AsyncSvc_sample/LayerB.cs | 292 +++++++------- .../AsyncSvc_sample/packages.config | 4 + .../TestAsyncSvc_Sample/Program.cs | 75 ++-- .../TestAsyncSvc_Sample.csproj | 12 +- .../TestAsyncSvc_Sample/app.config | 8 +- .../TestAsyncSvc_Sample/packages.config | 4 + root/programs/VB/6_CopyToService.bat | 1 + root/programs/VB/7_SubmitTask.bat | 1 + .../AsyncProcessingServiceParameterValue.vb | 184 --------- .../AsyncProcessingServiceReturnValue.vb | 81 ---- .../Business/AsyncProcessingService/LayerB.vb | 246 ------------ .../Business/AsyncProcessingService/LayerD.vb | 353 ----------------- .../Infrastructure/Business/Business.vbproj | 19 +- .../AsyncSvc_sample/AsyncSvc_sample.vbproj | 7 + .../AsyncSvc_sample/AsyncSvc_sample/LayerB.vb | 287 ++++++++------ .../TestAsyncSvc_Sample/Program.vb | 79 ++-- .../TestAsyncSvc_Sample.vbproj | 9 +- 33 files changed, 1326 insertions(+), 2089 deletions(-) create mode 100644 root/programs/CS/6_CopyToService.bat create mode 100644 root/programs/CS/7_SubmitTask.bat create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs rename root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/{AsyncProcessingServiceParameterValue.cs => ApsParameterValue.cs} (51%) rename root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/{AsyncProcessingServiceReturnValue.cs => ApsReturnValue.cs} (92%) create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs delete mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs delete mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs create mode 100644 root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/App.config create mode 100644 root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/packages.config create mode 100644 root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config create mode 100644 root/programs/VB/6_CopyToService.bat create mode 100644 root/programs/VB/7_SubmitTask.bat delete mode 100644 root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb delete mode 100644 root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb delete mode 100644 root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb delete mode 100644 root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb diff --git a/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml b/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml index 18f0271..1a467a3 100644 --- a/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml +++ b/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml @@ -9,23 +9,10 @@ + url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED> ]> - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/root/programs/CS/6_CopyToService.bat b/root/programs/CS/6_CopyToService.bat new file mode 100644 index 0000000..cb319f2 --- /dev/null +++ b/root/programs/CS/6_CopyToService.bat @@ -0,0 +1 @@ +xcopy /E /Y "Samples\AsyncSvc_sample\AsyncSvc_sample\bin\Debug" "Frameworks\Infrastructure\AsyncProcessingService\bin\Debug\" \ No newline at end of file diff --git a/root/programs/CS/7_SubmitTask.bat b/root/programs/CS/7_SubmitTask.bat new file mode 100644 index 0000000..d4628ce --- /dev/null +++ b/root/programs/CS/7_SubmitTask.bat @@ -0,0 +1 @@ +call "Samples\AsyncSvc_sample\TestAsyncSvc_Sample\bin\Debug\TestAsyncSvc_Sample.exe" \ No newline at end of file diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs index e6f39a2..9360bd0 100644 --- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs +++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs @@ -51,46 +51,29 @@ //* Implemented code to 'Enable and Handle pre-shutdown notification' technique, to resolve the issue of //* OnShutdown method, when you restart or shutdown the OS //* 06/01/2016 Sandeep Implemented '_isServiceException' property and 'SetServiceException' method, to enhance the Start and Stop behavior +//* 2018/08/24 西野 大介 ログ詳細化と、デッドコードの削除 //********************************************************************************** using System; -using System.IO; using System.Threading; using System.Reflection; -using System.Runtime.Serialization.Formatters.Binary; using System.ServiceProcess; using Touryo.Infrastructure.Business.AsyncProcessingService; using Touryo.Infrastructure.Business.Util; +using Touryo.Infrastructure.Framework.AsyncProcessingService; using Touryo.Infrastructure.Framework.Transmission; using Touryo.Infrastructure.Framework.Exceptions; using Touryo.Infrastructure.Framework.Common; using Touryo.Infrastructure.Framework.Util; using Touryo.Infrastructure.Public.Db; -using Touryo.Infrastructure.Public.Str; using Touryo.Infrastructure.Public.Log; using Touryo.Infrastructure.Public.Util; -namespace Touryo.Infrastructure.Framework.AsyncProcessingService +namespace Touryo.Infrastructure.AsyncProcessingService { - /// Method names to update asynchronous task - public class AsyncTaskUpdate - { - /// Update start - public const string START = "UpdateTaskStart"; - - /// Update retry - public const string RETRY = "UpdateTaskRetry"; - - /// Update fail - public const string FAIL = "UpdateTaskFail"; - - /// Update success - public const string SUCCESS = "UpdateTaskSuccess"; - } - /// Asynchronous Processing Service class for windows service - public class AsyncProcessingService : System.ServiceProcess.ServiceBase + public class AsyncProcessingService : ServiceBase { #region Member variables @@ -144,7 +127,9 @@ public AsyncProcessingService() this.CanShutdown = true; // To enable pre-shutdown notification technique - FieldInfo acceptedCommandsFieldInfo = typeof(ServiceBase).GetField("acceptedCommands", BindingFlags.Instance | BindingFlags.NonPublic); + FieldInfo acceptedCommandsFieldInfo = typeof(ServiceBase).GetField( + "acceptedCommands", BindingFlags.Instance | BindingFlags.NonPublic); + if (acceptedCommandsFieldInfo == null) { throw new ApplicationException(GetMessage.GetMessageDescription("E0009")); @@ -165,10 +150,8 @@ public AsyncProcessingService() /// public static void Main() { - System.ServiceProcess.ServiceBase[] ServicesToRun; - ServicesToRun = - new System.ServiceProcess.ServiceBase[] { new AsyncProcessingService() }; - System.ServiceProcess.ServiceBase.Run(ServicesToRun); + ServiceBase[] ServicesToRun = new ServiceBase[] { new AsyncProcessingService() }; + ServiceBase.Run(ServicesToRun); } /// @@ -209,8 +192,8 @@ protected override void OnStart(string[] args) ThreadPool.SetMaxThreads(this._maxThreadCount, 0); // Starts main thread invocation. - _mainThread = new Thread(new ThreadStart(MainThreadInvoke)); - _mainThread.Start(); + this._mainThread = new Thread(new ThreadStart(MainThreadInvoke)); + this._mainThread.Start(); } } @@ -228,6 +211,7 @@ protected override void OnStop() // Stop the process of asynchronous service and Waits to complete all worker thread to complete. this.StopAsyncProcess(); } + LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0005")); } @@ -245,6 +229,7 @@ protected override void OnPause() // Stop the process of asynchronous service and Waits to complete all worker thread to complete. this.StopAsyncProcess(); } + LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0006")); } @@ -271,6 +256,7 @@ protected override void OnCustomCommand(int command) this.StopAsyncProcess(); base.OnCustomCommand(command); } + LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0009")); } @@ -310,14 +296,17 @@ public void MainThreadInvoke() try { // Get asynchronous task from the database. - AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "SelectTask", "SelectTask", "SQL", - new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + ApsParameterValue asyncParameterValue = new ApsParameterValue( + "AsyncProcessingService", "SelectTask", "SelectTask", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + asyncParameterValue.RegistrationDateTime = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0); asyncParameterValue.NumberOfRetries = this._maxNumberOfRetries; asyncParameterValue.CompletionDateTime = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0); - LayerB layerB = new LayerB(); - AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic( - (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); + + ApsLayerB layerB = new ApsLayerB(); + ApsReturnValue selectedAsyncTask = (ApsReturnValue)layerB.DoBusinessLogic( + (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); // Existence check of asynchronous task if (string.IsNullOrEmpty(selectedAsyncTask.UserId)) @@ -349,8 +338,10 @@ public void MainThreadInvoke() } // Selected asynchronous task is assigned to a worker thread - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.START); - LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0002"), selectedAsyncTask.TaskId)); + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskStart); + + LogIF.InfoLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("I0002"), selectedAsyncTask.TaskId)); // Assign the task to the worker thread ThreadPool.QueueUserWorkItem(new WaitCallback(this.WorkerThreadCallBack), (object)selectedAsyncTask); @@ -360,7 +351,9 @@ public void MainThreadInvoke() // Service Failed due to unexpected exception. this._isServiceException = true; this._infiniteLoop = false; - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0000"), ex.Message.ToString())); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0000"), ex.Message.ToString())); } } } @@ -375,7 +368,7 @@ public void MainThreadInvoke() /// Selected Asynchronous Task private void WorkerThreadCallBack(object asyncTask) { - AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)asyncTask; + ApsReturnValue selectedAsyncTask = (ApsReturnValue)asyncTask; // A new worker thread started an Async task this._workerThreadCount++; @@ -383,27 +376,37 @@ private void WorkerThreadCallBack(object asyncTask) try { // To handle unstable "Register" state, when you invoke [Abort] at this state - if (selectedAsyncTask.CommandId == (int)AsyncProcessingServiceParameterValue.AsyncCommand.Abort) + if (selectedAsyncTask.CommandId == (int)AsyncCommand.Abort) { - throw new BusinessSystemException("APSAbortCommand", GetMessage.GetMessageDescription("CTE0004")); + throw new BusinessSystemException( + AsyncErrorMessageID.APSAbortCommand.ToString(), + GetMessage.GetMessageDescription("CTE0004")); } // Call User Program to execute by using communication control function - AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "Start", "Start", "SQL", - new MyUserInfo(selectedAsyncTask.UserId, selectedAsyncTask.TaskId.ToString())); + ApsParameterValue asyncParameterValue = new ApsParameterValue( + "AsyncProcessingService", "Start", "Start", "SQL", + new MyUserInfo(selectedAsyncTask.UserId, selectedAsyncTask.TaskId.ToString())); + asyncParameterValue.TaskId = selectedAsyncTask.TaskId; asyncParameterValue.Data = selectedAsyncTask.Data; + CallController callController = new CallController(asyncParameterValue.User); - AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)callController.Invoke(selectedAsyncTask.ProcessName, asyncParameterValue); + ApsReturnValue asyncReturnValue = (ApsReturnValue)callController.Invoke(selectedAsyncTask.ProcessName, asyncParameterValue); if (asyncReturnValue.ErrorFlag == true) { - if (asyncReturnValue.ErrorMessageID == "APSStopCommand") + if (asyncReturnValue.ErrorMessageID == AsyncErrorMessageID.APSStopCommand.ToString()) { - string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage; + string exceptionInfo = + "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + + "ErrorMessage: " + asyncReturnValue.ErrorMessage; + // Asynchronous task is stopped due to user 'stop' command. - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo); - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0001") + asyncReturnValue.ErrorMessage, selectedAsyncTask.TaskId)); + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskRetry, exceptionInfo); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0001") + asyncReturnValue.ErrorMessage, selectedAsyncTask.TaskId)); } else { @@ -413,41 +416,64 @@ private void WorkerThreadCallBack(object asyncTask) { // Asynchronous task does not exceeds the maximum number of retries // Updated as retry later - string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage; + string exceptionInfo = + "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + + "ErrorMessage: " + asyncReturnValue.ErrorMessage; + selectedAsyncTask.NumberOfRetries += 1; - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo); - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0004"), selectedAsyncTask.TaskId)); + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskRetry, exceptionInfo); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0004"), selectedAsyncTask.TaskId)); } else { // Asynchronous task exceeds maximum number of retries // Update task as abort - string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage; - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo); - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0005"), selectedAsyncTask.TaskId)); + string exceptionInfo = + "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + + "ErrorMessage: " + asyncReturnValue.ErrorMessage; + + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0005"), selectedAsyncTask.TaskId)); } } } else { // Selected Asynchronous task is completed successfully. - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.SUCCESS); - LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0003"), selectedAsyncTask.TaskId)); + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskSuccess); + LogIF.InfoLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("I0003"), selectedAsyncTask.TaskId)); } } catch (BusinessSystemException ex) { // Asynchronous task is aborted due to BusinessSystemException sent by user program. - string exceptionInfo = "ErrorMessageID: " + ex.messageID + Environment.NewLine + "ErrorMessage: " + ex.Message; - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo); - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message)); + string exceptionInfo = + "ErrorMessageID: " + ex.messageID + Environment.NewLine + + "ErrorMessage: " + ex.Message; + + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0006"), + selectedAsyncTask.TaskId, ex.ToString())); // ログ詳細化 } catch (Exception ex) { // Asynchronous task is aborted due to unexpected exception. - string exceptionInfo = "ErrorMessageID: " + ex.GetType().Name + Environment.NewLine + "ErrorMessage: " + ex.Message; - this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo); - LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message)); + string exceptionInfo = + "ErrorMessageID: " + ex.GetType().Name + Environment.NewLine + + "ErrorMessage: " + ex.Message; + + this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo); + + LogIF.ErrorLog("ASYNC-SERVICE", string.Format( + GetMessage.GetMessageDescription("E0006"), + selectedAsyncTask.TaskId, ex.ToString())); // ログ詳細化 } finally { @@ -538,71 +564,54 @@ public void SetFromConfig() /// Selected Asynchronous Task /// SQL_Update_Method_name /// - public AsyncProcessingServiceReturnValue UpdateAsyncTask(AsyncProcessingServiceReturnValue selectedAsyncTask, string updateTask, string exceptionInfo = null) + public ApsReturnValue UpdateAsyncTask(ApsReturnValue selectedAsyncTask, AsyncTaskUpdate updateTask, string exceptionInfo = null) { - AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", updateTask, updateTask, "SQL", - new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + ApsParameterValue asyncParameterValue = new ApsParameterValue( + "AsyncProcessingService", updateTask.ToString(), updateTask.ToString(), "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + asyncParameterValue.TaskId = selectedAsyncTask.TaskId; // Update databse based on task switch (updateTask) { - case AsyncTaskUpdate.START: + case AsyncTaskUpdate.UpdateTaskStart: asyncParameterValue.ExecutionStartDateTime = DateTime.Now; - asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Processing; + asyncParameterValue.StatusId = (int)AsyncStatus.Processing; break; - case AsyncTaskUpdate.RETRY: + + case AsyncTaskUpdate.UpdateTaskRetry: if (exceptionInfo.Length > 512) { exceptionInfo = exceptionInfo.Substring(0, 512); } asyncParameterValue.NumberOfRetries = selectedAsyncTask.NumberOfRetries; asyncParameterValue.CompletionDateTime = DateTime.Now; - asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd; + asyncParameterValue.StatusId = (int)AsyncStatus.AbnormalEnd; asyncParameterValue.ExceptionInfo = exceptionInfo; break; - case AsyncTaskUpdate.FAIL: + + case AsyncTaskUpdate.UpdateTaskFail: if (exceptionInfo.Length > 512) { exceptionInfo = exceptionInfo.Substring(0, 512); } asyncParameterValue.CompletionDateTime = DateTime.Now; - asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Abort; + asyncParameterValue.StatusId = (int)AsyncStatus.Abort; asyncParameterValue.ExceptionInfo = exceptionInfo; break; - case AsyncTaskUpdate.SUCCESS: + + case AsyncTaskUpdate.UpdateTaskSuccess: asyncParameterValue.CompletionDateTime = DateTime.Now; asyncParameterValue.ProgressRate = 100; - asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.End; + asyncParameterValue.StatusId = (int)AsyncStatus.End; break; } - LayerB layerB = new LayerB(); - AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic( - (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); - return asyncReturnValue; - } - - #endregion + ApsLayerB layerB = new ApsLayerB(); + ApsReturnValue asyncReturnValue = (ApsReturnValue)layerB.DoBusinessLogic( + (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); - #region DeserializeFromBase64 - - /// - /// Converts string data to byte array and byte array data to object. - /// - /// Base64 String - /// Deserialized Object - public object DeserializeFromBase64(string strBase64) - { - byte[] deserializeData = null; - MemoryStream memStream = new MemoryStream(); - BinaryFormatter binForm = new BinaryFormatter(); - - deserializeData = CustomEncode.FromBase64String(strBase64); - memStream.Write(deserializeData, 0, deserializeData.Length); - memStream.Seek(0, SeekOrigin.Begin); - object obj = (object)binForm.Deserialize(memStream); - - return obj; + return asyncReturnValue; } #endregion @@ -621,17 +630,22 @@ public void StopAsyncProcess() this._mainThread.Join(); // Update stop command to all the running asynchronous task - AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "StopAllTask", "StopAllTask", "SQL", - new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); - asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Processing; - asyncParameterValue.CommandId = (int)AsyncProcessingServiceParameterValue.AsyncCommand.Stop; - LayerB layerB = new LayerB(); - AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic( - (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); + ApsParameterValue asyncParameterValue = new ApsParameterValue( + "AsyncProcessingService", "StopAllTask", "StopAllTask", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + + asyncParameterValue.StatusId = (int)AsyncStatus.Processing; + asyncParameterValue.CommandId = (int)AsyncCommand.Stop; + + ApsLayerB layerB = new ApsLayerB(); + ApsReturnValue asyncReturnValue = (ApsReturnValue)layerB.DoBusinessLogic( + (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); if (asyncReturnValue.ErrorFlag) { - LogIF.ErrorLog("ASYNC-SERVICE", "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + "ErrorMessage: " + asyncReturnValue.ErrorMessage); + LogIF.ErrorLog("ASYNC-SERVICE", + "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + + "ErrorMessage: " + asyncReturnValue.ErrorMessage); } // Wait for all worker thread to be complete @@ -659,9 +673,11 @@ public void SetServiceException() try { // Checks for successful connection to the database. - AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "TestConnection", "TestConnection", "SQL", - new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); - LayerB layerB = new LayerB(); + ApsParameterValue asyncParameterValue = new ApsParameterValue( + "AsyncProcessingService", "TestConnection", "TestConnection", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + + ApsLayerB layerB = new ApsLayerB(); layerB.DoBusinessLogic((BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.NoTransaction); // Asynchronous Processing Service initializes successfully without any errors diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config index f5dbebc..11353a4 100644 --- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config +++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config @@ -1,15 +1,18 @@ - + + + - - - + + + + diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs new file mode 100644 index 0000000..6b2a38b --- /dev/null +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs @@ -0,0 +1,259 @@ +//********************************************************************************** +//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +//********************************************************************************** + +#region Apache License +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#endregion + +//********************************************************************************** +//* クラス名 :LayerB +//* クラス日本語名 :LayerB +//* +//* 日時 更新者 内容 +//* ---------- ---------------- ------------------------------------------------- +//* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service +//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service +//* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service +//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task +//* Modified code to reset Exception information, before starting asynchronous task +//* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method, +//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state +//* 06/01/2016 Sandeep Implemented method to test the connection of specified database +//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +//********************************************************************************** + +using System; +using System.Data; + +using Touryo.Infrastructure.Business.Business; + +namespace Touryo.Infrastructure.Business.AsyncProcessingService +{ + /// + /// LayerB class for AsyncProcessing Service + /// + public class ApsLayerB : MyFcBaseLogic + { + #region Insert + + /// + /// Inserts Async Parameter values to Database through LayerD + /// + /// + public void UOC_InsertTask(ApsParameterValue parameterValue) + { + // 戻り値クラスを生成して、事前に戻り値に設定しておく。 + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.InsertTask(parameterValue, returnValue); + } + + #endregion + + #region Update + + #region UpdateTaskStart + + /// + /// Updates information in the database that the asynchronous task is started + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskStart(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskStart(parameterValue, returnValue); + } + + #endregion + + #region UpdateTaskRetry + + /// + /// Updates information in the database that the asynchronous task is failed and can be retried later + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskRetry(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskRetry(parameterValue, returnValue); + } + + #endregion + + #region UpdateTaskFail + + /// + /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskFail(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskFail(parameterValue, returnValue); + } + + #endregion + + #region UpdateTaskSuccess + + /// + /// Updates information in the database that the asynchronous task is completed + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskSuccess(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskSuccess(parameterValue, returnValue); + } + + #endregion + + #region UpdateTaskProgress + + /// + /// Updates progress rate of the asynchronous task in the database. + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskProgress(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskProgress(parameterValue, returnValue); + } + + #endregion + + #region UpdateTaskCommand + + /// + /// Updates command value information of a selected asynchronous task + /// + /// Asynchronous Parameter Values + private void UOC_UpdateTaskCommand(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.UpdateTaskCommand(parameterValue, returnValue); + } + + #endregion + + #region StopAllTask + + /// + /// Set stop command for all running asynchronous task + /// + /// Asynchronous Parameter Values + private void UOC_StopAllTask(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.StopAllTask(parameterValue, returnValue); + } + + #endregion + + #endregion + + #region Select + + #region SelectCommand + + /// + /// Selects user command from Database through LayerD + /// + /// + private void UOC_SelectCommand(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.SelectCommand(parameterValue, returnValue); + } + + #endregion + + #region SelectTask + + /// + /// Selects Asynchronous task from LayerD + /// + /// Async Parameter Value + private void UOC_SelectTask(ApsParameterValue parameterValue) + { + ApsReturnValue returnValue = new ApsReturnValue(); + this.ReturnValue = returnValue; + + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + layerD.SelectTask(parameterValue, returnValue); + + DataTable dt = (DataTable)returnValue.Obj; + returnValue.Obj = null; + + if (dt != null) + { + if (dt.Rows.Count != 0) + { + returnValue.TaskId = Convert.ToInt32(dt.Rows[0]["Id"]); + returnValue.UserId = dt.Rows[0]["UserId"].ToString(); + returnValue.ProcessName = dt.Rows[0]["ProcessName"].ToString(); + returnValue.Data = dt.Rows[0]["Data"].ToString(); + returnValue.NumberOfRetries = Convert.ToInt32(dt.Rows[0]["NumberOfRetries"]); + returnValue.ReservedArea = dt.Rows[0]["ReservedArea"].ToString(); + returnValue.CommandId = Convert.ToInt32(dt.Rows[0]["CommandId"]); + } + } + } + + #endregion + + #endregion + + #region TestConnection + + /// + /// Tests the connection with the specified database + /// + /// Async Parameter Value + private void UOC_TestConnection(ApsParameterValue parameterValue) + { + ApsLayerD layerD = new ApsLayerD(this.GetDam()); + } + + #endregion + } +} diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs new file mode 100644 index 0000000..2a3edb8 --- /dev/null +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs @@ -0,0 +1,338 @@ +//********************************************************************************** +//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +//********************************************************************************** + +#region Apache License +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#endregion + +//********************************************************************************** +//* クラス名 :LayerD +//* クラス日本語名 :LayerD +//* +//* 日時 更新者 内容 +//* ---------- ---------------- ------------------------------------------------- +//* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service +//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service +//* 04/14/2015 Sandeep Did code modification of update and select asynchronous task +//* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource +//* 05/28/2015 Sandeep Did code implementation to update Exception information to the database +//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task +//* Modified code to reset Exception information, before starting asynchronous task +//* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task, +//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state +//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +//********************************************************************************** + +using System; +using System.Data; + +using Touryo.Infrastructure.Business.Dao; +using Touryo.Infrastructure.Framework.AsyncProcessingService; +using Touryo.Infrastructure.Public.Db; + +namespace Touryo.Infrastructure.Business.AsyncProcessingService +{ + /// + /// LayerD class for AsyncProcessing Service + /// + public class ApsLayerD : MyBaseDao + { + /// AsyncProcessingService用B層 + /// dam + public ApsLayerD(BaseDam dam) : base(dam) { } + + #region Insert + + /// + /// Inserts async parameter values to database + /// + /// + /// + public void InsertTask(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "AsyncProcessingServiceInsert.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P2", parameterValue.UserId); + this.SetParameter("P3", parameterValue.ProcessName); + this.SetParameter("P4", parameterValue.Data); + this.SetParameter("P5", parameterValue.RegistrationDateTime); + this.SetParameter("P6", DBNull.Value); + this.SetParameter("P7", parameterValue.NumberOfRetries); + this.SetParameter("P8", DBNull.Value); + this.SetParameter("P9", parameterValue.StatusId); + this.SetParameter("P10", parameterValue.ProgressRate); + this.SetParameter("P11", parameterValue.CommandId); + this.SetParameter("P12", parameterValue.ReservedArea); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region Update + + #region UpdateTaskStart + + /// + /// Updates information in the database that the asynchronous task is started + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskStart(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskStart.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.ExecutionStartDateTime); + this.SetParameter("P3", parameterValue.StatusId); + this.SetParameter("P4", DBNull.Value); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region UpdateTaskRetry + + /// + /// Updates information in the database that the asynchronous task is failed and can be retried later + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskRetry(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskRetry.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.NumberOfRetries); + this.SetParameter("P3", parameterValue.CompletionDateTime); + this.SetParameter("P4", parameterValue.StatusId); + this.SetParameter("P5", parameterValue.ExceptionInfo); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region UpdateTaskFail + + /// + /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskFail(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskFail.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.CompletionDateTime); + this.SetParameter("P3", parameterValue.StatusId); + this.SetParameter("P4", parameterValue.ExceptionInfo); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region UpdateTaskSuccess + + /// + /// Updates information in the database that the asynchronous task is completed + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskSuccess(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskSuccess.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.CompletionDateTime); + this.SetParameter("P3", parameterValue.ProgressRate); + this.SetParameter("P4", parameterValue.StatusId); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region UpdateTaskProgress + + /// + /// Updates progress rate of the asynchronous task in the database. + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskProgress(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskProgress.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.ProgressRate); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region UpdateTaskCommand + + /// + /// Updates command value information of a selected asynchronous task + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void UpdateTaskCommand(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "UpdateTaskCommand.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + this.SetParameter("P2", parameterValue.CommandId); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #region StopAllTask + + /// + /// Set stop command for all running asynchronous task. + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void StopAllTask(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "StopAllTask.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.StatusId); + this.SetParameter("P2", parameterValue.CommandId); + + // Execute SQL query + returnValue.Obj = this.ExecInsUpDel_NonQuery(); + } + + #endregion + + #endregion + + #region Select + + #region SelectCommand + + /// + /// Selects user command from database + /// + /// Asynchronous Parameter Values + /// Asynchronous Return Values + public void SelectCommand(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "SelectCommand.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.TaskId); + + // Execute SQL query + returnValue.Obj = this.ExecSelectScalar(); + } + + #endregion + + #region SelectTask + + /// + /// To get Asynchronous Task from the database + /// + /// + /// + public void SelectTask(ApsParameterValue parameterValue, ApsReturnValue returnValue) + { + string filename = string.Empty; + filename = "SelectTask.sql"; + + // Get SQL query from file. + this.SetSqlByFile2(filename); + + // Set SQL parameter values + this.SetParameter("P1", parameterValue.RegistrationDateTime); + this.SetParameter("P2", parameterValue.NumberOfRetries); + this.SetParameter("P3", (int)AsyncStatus.Register); + this.SetParameter("P4", (int)AsyncStatus.AbnormalEnd); + this.SetParameter("P7", parameterValue.CompletionDateTime); + + DataTable dt = new DataTable(); + + // Get Asynchronous Task from the database + this.ExecSelectFill_DT(dt); + returnValue.Obj = dt; + } + + #endregion + + #endregion + } +} diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs similarity index 51% rename from root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs rename to root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs index d18d6bd..d685002 100644 --- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs @@ -19,13 +19,15 @@ #endregion //********************************************************************************** -//* クラス名 :AsyncProcessingServiceParameterValue -//* クラス日本語名 :AsyncProcessingServiceParameterValue +//* クラス名 :ApsParameterValue +//* クラス日本語名 :ApsParameterValue //* //* 日時 更新者 内容 //* ---------- ---------------- ------------------------------------------------- //* 11/28/2014 Supragyan Paramter Value class for Asynchronous Processing Service //* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. +//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +//* 2018/08/24 西野 大介 列挙型と列挙型処理クラスの移動 //********************************************************************************** using System; @@ -39,7 +41,7 @@ namespace Touryo.Infrastructure.Business.AsyncProcessingService /// /// Paramter Value class for Asynchronous Processing Service /// - public class AsyncProcessingServiceParameterValue : MyParameterValue + public class ApsParameterValue : MyParameterValue { /// 汎用エリア public object Obj; @@ -86,109 +88,13 @@ public class AsyncProcessingServiceParameterValue : MyParameterValue #region コンストラクタ /// コンストラクタ - public AsyncProcessingServiceParameterValue(string screenId, string controlId, string methodName, string actionType, MyUserInfo user) + public ApsParameterValue( + string screenId, string controlId, string methodName, string actionType, MyUserInfo user) : base(screenId, controlId, methodName, actionType, user) { // Baseのコンストラクタに引数を渡すために必要。 } #endregion - - #region AsyncStatus - - /// - /// AsyncStatus Enum for storing all status - /// - public enum AsyncStatus - { - /// Register - [StringValue("Register")] - Register = 1, - - /// Processing - [StringValue("Processing")] - Processing, - - /// End - [StringValue("End")] - End, - - /// AbnormalEnd - [StringValue("AbnormalEnd")] - AbnormalEnd, - - /// Abort - [StringValue("Abort")] - Abort, - } - - #endregion - - #region AsyncCommand - - /// - /// AsyncCommand Enum for storing command values - /// - public enum AsyncCommand - { - /// Stop - [StringValue("Stop")] - Stop = 1, - - /// Abort - [StringValue("Abort")] - Abort, - } - - #endregion - } - - /// - /// To get the string value - /// - public class StringValueAttribute : System.Attribute - { - private string _value; - - /// StringValueAttribute - /// value - public StringValueAttribute(string value) - { - _value = value; - } - - /// Value - public string Value - { - get { return _value; } - } - } - - /// - /// Class that holds the Enum values string - /// - public class StringEnum - { - /// - /// To get the string value from Enum value - /// - /// Enum value - /// String value of Enum - public static string GetStringValue(Enum value) - { - string output = null; - Type type = value.GetType(); - - // Gets the 'StringValueAttribute' - FieldInfo fi = type.GetField(value.ToString()); - StringValueAttribute[] attrs = - fi.GetCustomAttributes(typeof(StringValueAttribute), - false) as StringValueAttribute[]; - if (attrs.Length > 0) - { - output = attrs[0].Value; - } - return output; - } } } diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs similarity index 92% rename from root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs rename to root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs index cfd6ae2..5b45b57 100644 --- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs @@ -19,13 +19,14 @@ #endregion //********************************************************************************** -//* クラス名 :AsyncProcessingServiceReturnValue -//* クラス日本語名 :AsyncProcessingServiceReturnValue +//* クラス名 :ApsReturnValue +//* クラス日本語名 :ApsReturnValue //* //* 日時 更新者 内容 //* ---------- ---------------- ------------------------------------------------- //* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service //* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. +//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) //********************************************************************************** using System; @@ -33,11 +34,10 @@ namespace Touryo.Infrastructure.Business.AsyncProcessingService { - /// /// Paramter Return Value class for Asynchronous Processing Service /// - public class AsyncProcessingServiceReturnValue : MyReturnValue + public class ApsReturnValue : MyReturnValue { /// 汎用エリア public object Obj; @@ -81,5 +81,4 @@ public class AsyncProcessingServiceReturnValue : MyReturnValue /// ExceptionInfo public string ExceptionInfo; } - } diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs new file mode 100644 index 0000000..f7d3bea --- /dev/null +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs @@ -0,0 +1,115 @@ +//********************************************************************************** +//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +//********************************************************************************** + +#region Apache License +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#endregion + +//********************************************************************************** +//* クラス名 :ApsUtility +//* クラス日本語名 :ApsUtility +//* +//* 日時 更新者 内容 +//* ---------- ---------------- ------------------------------------------------- +//* 2018/08/24 西野 大介 新規作成(Utilityメソッドを部品化) +//********************************************************************************** + +using Touryo.Infrastructure.Business.Util; +using Touryo.Infrastructure.Public.Db; + +namespace Touryo.Infrastructure.Business.AsyncProcessingService +{ + /// ApsUtility + public class ApsUtility + { + /// Get command information from database. + /// asynchronous task id + /// asynchronous return value + /// BaseDam + public static void GetCommandValue(int taskID, ApsReturnValue returnValue, BaseDam dam) + { + // Sets parameters of AsyncProcessingServiceParameterValue to get command value. + ApsParameterValue parameterValue = new ApsParameterValue( + "AsyncProcessingService", "SelectCommand", "SelectCommand", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + + parameterValue.TaskId = taskID; + + // Calls data access part of asynchronous processing service. + ApsLayerD layerD = new ApsLayerD(dam); + layerD.SelectCommand(parameterValue, returnValue); + returnValue.CommandId = (int)returnValue.Obj; + } + + /// + /// Resumes asynchronous process in the middle of the processing. + /// + /// Task ID + /// asynchronous return value + /// BaseDam + public static void ResumeProcessing(int taskID, ApsReturnValue returnValue, BaseDam dam) + { + // Reset the command of selected task. + ApsUtility.UpdateTaskCommand(taskID, 0, returnValue, dam); + } + + /// + /// Updates the progress rate in the database. + /// + /// asynchronous task id + /// ApsReturnValue + /// progress rate + /// BaseDam + public static void UpdateProgressRate(int taskID, ApsReturnValue returnValue, decimal progressRate, BaseDam dam) + { + // Sets parameters of AsyncProcessingServiceParameterValue to Update progress rate + ApsParameterValue parameterValue = new ApsParameterValue( + "AsyncProcessingService", "UpdateTaskProgress", "UpdateTaskProgress", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + + parameterValue.TaskId = taskID; + parameterValue.ProgressRate = progressRate; + + // Calls data access part of asynchronous processing service. + ApsLayerD layerD = new ApsLayerD(dam); + layerD.UpdateTaskProgress(parameterValue, returnValue); + } + + /// + /// Updates the command of selected task + /// + /// Task ID + /// Command ID + /// user parameter value + /// BaseDam + public static void UpdateTaskCommand(int taskID, int commandId, ApsReturnValue returnValue, BaseDam dam) + { + // Sets parameters of AsyncProcessingServiceParameterValue to update the command of selected task. + ApsParameterValue parameterValue = new ApsParameterValue( + "AsyncProcessingService", "UpdateTaskCommand", "UpdateTaskCommand", "SQL", + new MyUserInfo("AsyncProcessingService", "AsyncProcessingService")); + + parameterValue.TaskId = taskID; + parameterValue.CommandId = commandId; + + // Calls data access part of asynchronous processing service. + ApsLayerD layerD = new ApsLayerD(dam); + layerD.UpdateTaskCommand(parameterValue, returnValue); + } + + + } +} diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs deleted file mode 100644 index 4afc7e0..0000000 --- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs +++ /dev/null @@ -1,262 +0,0 @@ -//********************************************************************************** -//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -//********************************************************************************** - -#region Apache License -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#endregion - -//********************************************************************************** -//* クラス名 :LayerB -//* クラス日本語名 :LayerB -//* -//* 日時 更新者 内容 -//* ---------- ---------------- ------------------------------------------------- -//* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service -//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service -//* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service -//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task -//* Modified code to reset Exception information, before starting asynchronous task -//* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method, -//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state -//* 06/01/2016 Sandeep Implemented method to test the connection of specified database -//********************************************************************************** - -using System; -using System.Data; - -using Touryo.Infrastructure.Business.Business; - -namespace Touryo.Infrastructure.Business.AsyncProcessingService -{ - #region LayerB - - /// - /// LayerB class for AsyncProcessing Service - /// - public class LayerB : MyFcBaseLogic - { - #region Insert - - /// - /// Inserts Async Parameter values to Database through LayerD - /// - /// - public void UOC_InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue) - { - // 戻り値クラスを生成して、事前に戻り値に設定しておく。 - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.InsertTask(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region Update - - #region UpdateTaskStart - - /// - /// Updates information in the database that the asynchronous task is started - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskStart(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskStart(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region UpdateTaskRetry - - /// - /// Updates information in the database that the asynchronous task is failed and can be retried later - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskRetry(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskRetry(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region UpdateTaskFail - - /// - /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskFail(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskFail(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region UpdateTaskSuccess - - /// - /// Updates information in the database that the asynchronous task is completed - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskSuccess(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskSuccess(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region UpdateTaskProgress - - /// - /// Updates progress rate of the asynchronous task in the database. - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskProgress(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskProgress(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region UpdateTaskCommand - - /// - /// Updates command value information of a selected asynchronous task - /// - /// Asynchronous Parameter Values - private void UOC_UpdateTaskCommand(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.UpdateTaskCommand(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region StopAllTask - - /// - /// Set stop command for all running asynchronous task - /// - /// Asynchronous Parameter Values - private void UOC_StopAllTask(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.StopAllTask(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #endregion - - #region Select - - #region SelectCommand - - /// - /// Selects user command from Database through LayerD - /// - /// - private void UOC_SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.SelectCommand(asyncParameterValue, asyncReturnValue); - } - - #endregion - - #region SelectTask - - /// - /// Selects Asynchronous task from LayerD - /// - /// Async Parameter Value - private void UOC_SelectTask(AsyncProcessingServiceParameterValue asyncParameterValue) - { - AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); - this.ReturnValue = asyncReturnValue; - - LayerD myDao = new LayerD(this.GetDam()); - myDao.SelectTask(asyncParameterValue, asyncReturnValue); - - DataTable dt = (DataTable)asyncReturnValue.Obj; - asyncReturnValue.Obj = null; - - if (dt != null) - { - if (dt.Rows.Count != 0) - { - asyncReturnValue.TaskId = Convert.ToInt32(dt.Rows[0]["Id"]); - asyncReturnValue.UserId = dt.Rows[0]["UserId"].ToString(); - asyncReturnValue.ProcessName = dt.Rows[0]["ProcessName"].ToString(); - asyncReturnValue.Data = dt.Rows[0]["Data"].ToString(); - asyncReturnValue.NumberOfRetries = Convert.ToInt32(dt.Rows[0]["NumberOfRetries"]); - asyncReturnValue.ReservedArea = dt.Rows[0]["ReservedArea"].ToString(); - asyncReturnValue.CommandId = Convert.ToInt32(dt.Rows[0]["CommandId"]); - } - } - } - - #endregion - - #endregion - - #region TestConnection - - /// - /// Tests the connection with the specified database - /// - /// Async Parameter Value - private void UOC_TestConnection(AsyncProcessingServiceParameterValue asyncParameterValue) - { - LayerD myDao = new LayerD(this.GetDam()); - } - - #endregion - } - - #endregion -} diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs deleted file mode 100644 index d990a2e..0000000 --- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs +++ /dev/null @@ -1,368 +0,0 @@ -//********************************************************************************** -//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -//********************************************************************************** - -#region Apache License -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#endregion - -//********************************************************************************** -//* クラス名 :LayerD -//* クラス日本語名 :LayerD -//* -//* 日時 更新者 内容 -//* ---------- ---------------- ------------------------------------------------- -//* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service -//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service -//* 04/14/2015 Sandeep Did code modification of update and select asynchronous task -//* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource -//* 05/28/2015 Sandeep Did code implementation to update Exception information to the database -//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task -//* Modified code to reset Exception information, before starting asynchronous task -//* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task, -//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state -//********************************************************************************** - -using System; -using System.Data; -using System.Text; - -using Touryo.Infrastructure.Business.Dao; -using Touryo.Infrastructure.Public.Db; -using Touryo.Infrastructure.Public.IO; -using Touryo.Infrastructure.Public.Util; - -namespace Touryo.Infrastructure.Business.AsyncProcessingService -{ - /// - /// LayerD class for AsyncProcessing Service - /// - public class LayerD : MyBaseDao - { - /// AsyncProcessingService用B層 - /// dam - public LayerD(BaseDam dam) : base(dam) { } - - #region SetSqlByFile3 - - ///// - ///// Get SQL query from the embedded resource assembly - ///// - //public void SetSqlByFile3(string filename) - //{ - // // SQLファイルのEncoding情報の取得 - // string sqlEncoding = GetConfigParameter.GetConfigValue(PubLiteral.SQL_ENCODING); - - // if (string.IsNullOrEmpty(sqlEncoding)) - // { - // // デフォルト:UTF-8 - // sqlEncoding = "utf-8"; - // } - - // string assemblyString = "Business"; - // string assemblyNameSpace = "Touryo.Infrastructure.Business.AsyncProcessingService"; - // string loadFileName = assemblyNameSpace + "." + filename; - - // // Get SQL query from embedded resource file. - // string commandText = EmbeddedResourceLoader.LoadAsString(assemblyString, loadFileName, Encoding.GetEncoding(sqlEncoding)); - - // // Set sql command as text - // this.SetSqlByCommand(commandText); - //} - - #endregion - - #region Insert - - /// - /// Inserts async parameter values to database - /// - /// - /// - public void InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "AsyncProcessingServiceInsert.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P2", asyncParameterValue.UserId); - this.SetParameter("P3", asyncParameterValue.ProcessName); - this.SetParameter("P4", asyncParameterValue.Data); - this.SetParameter("P5", asyncParameterValue.RegistrationDateTime); - this.SetParameter("P6", DBNull.Value); - this.SetParameter("P7", asyncParameterValue.NumberOfRetries); - this.SetParameter("P8", DBNull.Value); - this.SetParameter("P9", asyncParameterValue.StatusId); - this.SetParameter("P10", asyncParameterValue.ProgressRate); - this.SetParameter("P11", asyncParameterValue.CommandId); - this.SetParameter("P12", asyncParameterValue.ReservedArea); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region Update - - #region UpdateTaskStart - - /// - /// Updates information in the database that the asynchronous task is started - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskStart(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskStart.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.ExecutionStartDateTime); - this.SetParameter("P3", asyncParameterValue.StatusId); - this.SetParameter("P4", DBNull.Value); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region UpdateTaskRetry - - /// - /// Updates information in the database that the asynchronous task is failed and can be retried later - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskRetry(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskRetry.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.NumberOfRetries); - this.SetParameter("P3", asyncParameterValue.CompletionDateTime); - this.SetParameter("P4", asyncParameterValue.StatusId); - this.SetParameter("P5", asyncParameterValue.ExceptionInfo); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region UpdateTaskFail - - /// - /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskFail(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskFail.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.CompletionDateTime); - this.SetParameter("P3", asyncParameterValue.StatusId); - this.SetParameter("P4", asyncParameterValue.ExceptionInfo); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region UpdateTaskSuccess - - /// - /// Updates information in the database that the asynchronous task is completed - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskSuccess(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskSuccess.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.CompletionDateTime); - this.SetParameter("P3", asyncParameterValue.ProgressRate); - this.SetParameter("P4", asyncParameterValue.StatusId); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region UpdateTaskProgress - - /// - /// Updates progress rate of the asynchronous task in the database. - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskProgress(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskProgress.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.ProgressRate); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region UpdateTaskCommand - - /// - /// Updates command value information of a selected asynchronous task - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void UpdateTaskCommand(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "UpdateTaskCommand.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - this.SetParameter("P2", asyncParameterValue.CommandId); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #region StopAllTask - - /// - /// Set stop command for all running asynchronous task. - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void StopAllTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "StopAllTask.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.StatusId); - this.SetParameter("P2", asyncParameterValue.CommandId); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); - } - - #endregion - - #endregion - - #region Select - - #region SelectCommand - - /// - /// Selects user command from database - /// - /// Asynchronous Parameter Values - /// Asynchronous Return Values - public void SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "SelectCommand.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.TaskId); - - // Execute SQL query - asyncReturnValue.Obj = this.ExecSelectScalar(); - } - - #endregion - - #region SelectTask - - /// - /// To get Asynchronous Task from the database - /// - /// - /// - public void SelectTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) - { - string filename = string.Empty; - filename = "SelectTask.sql"; - - // Get SQL query from file. - this.SetSqlByFile2(filename); - - // Set SQL parameter values - this.SetParameter("P1", asyncParameterValue.RegistrationDateTime); - this.SetParameter("P2", asyncParameterValue.NumberOfRetries); - this.SetParameter("P3", (int)AsyncProcessingServiceParameterValue.AsyncStatus.Register); - this.SetParameter("P4", (int)AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd); - this.SetParameter("P7", asyncParameterValue.CompletionDateTime); - - DataTable dt = new DataTable(); - - // Get Asynchronous Task from the database - this.ExecSelectFill_DT(dt); - asyncReturnValue.Obj = dt; - } - - #endregion - - #endregion - } -} diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs index aa15e1d..9d9a7a9 100644 --- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs +++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs @@ -195,12 +195,12 @@ protected override void UOC_ConnectionOpen( if (parameterValue.ActionType.Split('%')[0] == "SQL") { - // SQL Server / SQL Client用のDamを生成 - damABT = new DamSqlSvr(); - damAMT = new DamSqlSvr(); + // SQL Server / SQL Client用のDamを生成 + damABT = new DamSqlSvr(); + damAMT = new DamSqlSvr(); - // 接続文字列をロード - connstring = GetConfigParameter.GetConnectionString("ConnectionString_SQL"); + // 接続文字列をロード + connstring = GetConfigParameter.GetConnectionString("ConnectionString_SQL"); } else if (parameterValue.ActionType.Split('%')[0] == "OLE") { @@ -662,7 +662,7 @@ protected override void UOC_ABEND(BaseParameterValue parameterValue, ref BaseRet // Log4Netへログ出力 LogIF.ErrorLog("ACCESS", strLogMessage); - + // スタックトレースを保って InnerException を throw ExceptionDispatchInfo.Capture(ex).Throw(); } diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj index 8beeba9..bea576c 100644 --- a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj +++ b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj @@ -85,10 +85,11 @@ - - - - + + + + + diff --git a/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/App.config b/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/App.config new file mode 100644 index 0000000..99ddf3e --- /dev/null +++ b/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/App.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.csproj b/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.csproj index 1159246..f8b6029 100644 --- a/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.csproj +++ b/root/programs/CS/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.csproj @@ -14,6 +14,7 @@ 512 + true x86 @@ -38,6 +39,10 @@ + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + True + ..\..\..\Frameworks\Infrastructure\Build\OpenTouryo.Business.dll @@ -53,6 +58,9 @@ + + + @@ -13,15 +13,15 @@ - + - + - + diff --git a/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config b/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config new file mode 100644 index 0000000..bfe8416 --- /dev/null +++ b/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/root/programs/VB/6_CopyToService.bat b/root/programs/VB/6_CopyToService.bat new file mode 100644 index 0000000..8d175b1 --- /dev/null +++ b/root/programs/VB/6_CopyToService.bat @@ -0,0 +1 @@ +xcopy /E /Y "Samples\AsyncSvc_sample\AsyncSvc_sample\bin\Debug" "..\CS\Frameworks\Infrastructure\AsyncProcessingService\bin\Debug\" \ No newline at end of file diff --git a/root/programs/VB/7_SubmitTask.bat b/root/programs/VB/7_SubmitTask.bat new file mode 100644 index 0000000..d4628ce --- /dev/null +++ b/root/programs/VB/7_SubmitTask.bat @@ -0,0 +1 @@ +call "Samples\AsyncSvc_sample\TestAsyncSvc_Sample\bin\Debug\TestAsyncSvc_Sample.exe" \ No newline at end of file diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb deleted file mode 100644 index f745c60..0000000 --- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb +++ /dev/null @@ -1,184 +0,0 @@ -'********************************************************************************** -'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -'********************************************************************************** - -#Region "Apache License" -' -' Licensed under the Apache License, Version 2.0 (the "License"); -' you may not use this file except in compliance with the License. -' You may obtain a copy of the License at -' -' http://www.apache.org/licenses/LICENSE-2.0 -' -' Unless required by applicable law or agreed to in writing, software -' distributed under the License is distributed on an "AS IS" BASIS, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' See the License for the specific language governing permissions and -' limitations under the License. -' -#End Region - -'********************************************************************************** -'* クラス名 :AsyncProcessingServiceParameterValue -'* クラス日本語名 :AsyncProcessingServiceParameterValue -'* -'* 日時 更新者 内容 -'* ---------- ---------------- ------------------------------------------------- -'* 11/28/2014 Supragyan Paramter Value class for Asynchronous Processing Service -'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. -'********************************************************************************** - -Imports System.Reflection - -Imports Touryo.Infrastructure.Business.Common -Imports Touryo.Infrastructure.Business.Util - -Namespace Touryo.Infrastructure.Business.AsyncProcessingService - ''' - ''' Paramter Value class for Asynchronous Processing Service - ''' - Public Class AsyncProcessingServiceParameterValue - Inherits MyParameterValue - ''' 汎用エリア - Public Obj As Object - - ''' TaskId - Public TaskId As Integer - - ''' UserId - Public UserId As String - - ''' ProcessName - Public ProcessName As String - - ''' Data - Public Data As String - - ''' RegistrationDateTime - Public RegistrationDateTime As DateTime - - ''' ExecutionStartDateTime - Public ExecutionStartDateTime As DateTime - - ''' NumberOfRetries - Public NumberOfRetries As Integer - - ''' ProgressRate - Public ProgressRate As Decimal - - ''' Status - Public StatusId As Integer - - ''' CompletionDateTime - Public CompletionDateTime As DateTime - - ''' CommandId - Public CommandId As Integer - - ''' ReservedArea - Public ReservedArea As String - - ''' ExceptionInfo - Public ExceptionInfo As String - - #Region "コンストラクタ" - - ''' コンストラクタ - Public Sub New(screenId As String, controlId As String, methodName As String, actionType As String, user As MyUserInfo) - ' Baseのコンストラクタに引数を渡すために必要。 - MyBase.New(screenId, controlId, methodName, actionType, user) - End Sub - - #End Region - - #Region "AsyncStatus" - - ''' - ''' AsyncStatus Enum for storing all status - ''' - Public Enum AsyncStatus - ''' Register - _ - Register = 1 - - ''' Processing - _ - Processing - - ''' End - _ - [End] - - ''' AbnormalEnd - _ - AbnormalEnd - - ''' Abort - _ - Abort - End Enum - - #End Region - - #Region "AsyncCommand" - - ''' - ''' AsyncCommand Enum for storing command values - ''' - Public Enum AsyncCommand - ''' Stop - _ - [Stop] = 1 - - ''' Abort - _ - Abort - End Enum - - #End Region - End Class - - ''' - ''' To get the string value - ''' - Public Class StringValueAttribute - Inherits System.Attribute - Private _value As String - - ''' StringValueAttribute - ''' value - Public Sub New(value As String) - _value = value - End Sub - - ''' Value - Public ReadOnly Property Value() As String - Get - Return _value - End Get - End Property - End Class - - ''' - ''' Class that holds the Enum values string - ''' - Public Class StringEnum - ''' - ''' To get the string value from Enum value - ''' - ''' Enum value - ''' String value of Enum - Public Shared Function GetStringValue(value As [Enum]) As String - Dim output As String = Nothing - Dim type As Type = value.[GetType]() - - ' Gets the 'StringValueAttribute' - Dim fi As FieldInfo = type.GetField(value.ToString()) - Dim attrs As StringValueAttribute() = TryCast(fi.GetCustomAttributes(GetType(StringValueAttribute), False), StringValueAttribute()) - If attrs.Length > 0 Then - output = attrs(0).Value - End If - Return output - End Function - End Class -End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb deleted file mode 100644 index c71f8ff..0000000 --- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb +++ /dev/null @@ -1,81 +0,0 @@ -'********************************************************************************** -'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -'********************************************************************************** - -#Region "Apache License" -' -' Licensed under the Apache License, Version 2.0 (the "License"); -' you may not use this file except in compliance with the License. -' You may obtain a copy of the License at -' -' http://www.apache.org/licenses/LICENSE-2.0 -' -' Unless required by applicable law or agreed to in writing, software -' distributed under the License is distributed on an "AS IS" BASIS, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' See the License for the specific language governing permissions and -' limitations under the License. -' -#End Region - -'********************************************************************************** -'* クラス名 :AsyncProcessingServiceReturnValue -'* クラス日本語名 :AsyncProcessingServiceReturnValue -'* -'* 日時 更新者 内容 -'* ---------- ---------------- ------------------------------------------------- -'* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service -'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. -'********************************************************************************** - -Imports Touryo.Infrastructure.Business.Common - -Namespace Touryo.Infrastructure.Business.AsyncProcessingService - ''' - ''' Paramter Return Value class for Asynchronous Processing Service - ''' - Public Class AsyncProcessingServiceReturnValue - Inherits MyReturnValue - ''' 汎用エリア - Public Obj As Object - - ''' TaskId - Public TaskId As Integer - - ''' UserId - Public UserId As String - - ''' ProcessName - Public ProcessName As String - - ''' Data - Public Data As String - - ''' RegistrationDateTime - Public RegistrationDateTime As DateTime - - ''' ExecutionStartDateTime; - Public ExecutionStartDateTime As DateTime - - ''' NumberOfRetries; - Public NumberOfRetries As Integer - - ''' ProgressRate - Public ProgressRate As Decimal - - ''' StatusId; - Public StatusId As Integer - - ''' CompletionDateTime - Public CompletionDateTime As DateTime - - ''' CommandId; - Public CommandId As Integer - - ''' ReservedArea - Public ReservedArea As String - - ''' ExceptionInfo - Public ExceptionInfo As String - End Class -End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb deleted file mode 100644 index 7142286..0000000 --- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb +++ /dev/null @@ -1,246 +0,0 @@ -'********************************************************************************** -'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -'********************************************************************************** - -#Region "Apache License" -' -' Licensed under the Apache License, Version 2.0 (the "License"); -' you may not use this file except in compliance with the License. -' You may obtain a copy of the License at -' -' http://www.apache.org/licenses/LICENSE-2.0 -' -' Unless required by applicable law or agreed to in writing, software -' distributed under the License is distributed on an "AS IS" BASIS, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' See the License for the specific language governing permissions and -' limitations under the License. -' -#End Region - -'********************************************************************************** -'* クラス名 :LayerB -'* クラス日本語名 :LayerB -'* -'* 日時 更新者 内容 -'* ---------- ---------------- ------------------------------------------------- -'* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service -'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service -'* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service -'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task -'* Modified code to reset Exception information, before starting asynchronous task -'* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method, -'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state -'* 06/01/2016 Sandeep Implemented method to test the connection of specified database -'********************************************************************************** - -Imports Touryo.Infrastructure.Business.Business - -Namespace Touryo.Infrastructure.Business.AsyncProcessingService -#Region "LayerB" - - ''' - ''' LayerB class for AsyncProcessing Service - ''' - Public Class LayerB - Inherits MyFcBaseLogic -#Region "Insert" - - ''' - ''' Inserts Async Parameter values to Database through LayerD - ''' - ''' - Public Sub UOC_InsertTask(asyncParameterValue As AsyncProcessingServiceParameterValue) - ' 戻り値クラスを生成して、事前に戻り値に設定しておく。 - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.InsertTask(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "Update" - -#Region "UpdateTaskStart" - - ''' - ''' Updates information in the database that the asynchronous task is started - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskStart(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskStart(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "UpdateTaskRetry" - - ''' - ''' Updates information in the database that the asynchronous task is failed and can be retried later - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskRetry(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskRetry(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "UpdateTaskFail" - - ''' - ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskFail(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskFail(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "UpdateTaskSuccess" - - ''' - ''' Updates information in the database that the asynchronous task is completed - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskSuccess(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskSuccess(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "UpdateTaskProgress" - - ''' - ''' Updates progress rate of the asynchronous task in the database. - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskProgress(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskProgress(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "UpdateTaskCommand" - - ''' - ''' Updates command value information of a selected asynchronous task - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_UpdateTaskCommand(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.UpdateTaskCommand(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "StopAllTask" - - ''' - ''' Set stop command for all running asynchronous task - ''' - ''' Asynchronous Parameter Values - Private Sub UOC_StopAllTask(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.StopAllTask(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#End Region - -#Region "Select" - -#Region "SelectCommand" - - ''' - ''' Selects user command from Database through LayerD - ''' - ''' - Private Sub UOC_SelectCommand(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.SelectCommand(asyncParameterValue, asyncReturnValue) - End Sub - -#End Region - -#Region "SelectTask" - - ''' - ''' Selects Asynchronous task from LayerD - ''' - ''' Async Parameter Value - Private Sub UOC_SelectTask(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim asyncReturnValue As New AsyncProcessingServiceReturnValue() - Me.ReturnValue = asyncReturnValue - - Dim myDao As New LayerD(Me.GetDam()) - myDao.SelectTask(asyncParameterValue, asyncReturnValue) - - Dim dt As DataTable = DirectCast(asyncReturnValue.Obj, DataTable) - asyncReturnValue.Obj = Nothing - - If dt IsNot Nothing Then - If dt.Rows.Count <> 0 Then - asyncReturnValue.TaskId = Convert.ToInt32(dt.Rows(0)("Id")) - asyncReturnValue.UserId = dt.Rows(0)("UserId").ToString() - asyncReturnValue.ProcessName = dt.Rows(0)("ProcessName").ToString() - asyncReturnValue.Data = dt.Rows(0)("Data").ToString() - asyncReturnValue.NumberOfRetries = Convert.ToInt32(dt.Rows(0)("NumberOfRetries")) - asyncReturnValue.ReservedArea = dt.Rows(0)("ReservedArea").ToString() - asyncReturnValue.CommandId = Convert.ToInt32(dt.Rows(0)("CommandId")) - End If - End If - End Sub - -#End Region - -#End Region - -#Region "TestConnection" - - ''' - ''' Tests the connection with the specified database - ''' - ''' Async Parameter Value - Private Sub UOC_TestConnection(asyncParameterValue As AsyncProcessingServiceParameterValue) - Dim myDao As New LayerD(Me.GetDam()) - End Sub - -#End Region - End Class - -#End Region -End Namespace - diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb deleted file mode 100644 index 222f9b8..0000000 --- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb +++ /dev/null @@ -1,353 +0,0 @@ -'********************************************************************************** -'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. -'********************************************************************************** - -#Region "Apache License" -' -' Licensed under the Apache License, Version 2.0 (the "License"); -' you may not use this file except in compliance with the License. -' You may obtain a copy of the License at -' -' http://www.apache.org/licenses/LICENSE-2.0 -' -' Unless required by applicable law or agreed to in writing, software -' distributed under the License is distributed on an "AS IS" BASIS, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' See the License for the specific language governing permissions and -' limitations under the License. -' -#End Region - -'********************************************************************************** -'* クラス名 :LayerD -'* クラス日本語名 :LayerD -'* -'* 日時 更新者 内容 -'* ---------- ---------------- ------------------------------------------------- -'* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service -'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service -'* 04/14/2015 Sandeep Did code modification of update and select asynchronous task -'* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource -'* 05/28/2015 Sandeep Did code implementation to update Exception information to the database -'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task -'* Modified code to reset Exception information, before starting asynchronous task -'* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task, -'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state -'********************************************************************************** - -Imports System.Text - -Imports Touryo.Infrastructure.Business.Dao -Imports Touryo.Infrastructure.Public.Db -Imports Touryo.Infrastructure.Public.IO -Imports Touryo.Infrastructure.Public.Util - -Namespace Touryo.Infrastructure.Business.AsyncProcessingService - ''' - ''' LayerD class for AsyncProcessing Service - ''' - Public Class LayerD - Inherits MyBaseDao - ''' AsyncProcessingService用B層 - ''' dam - Public Sub New(dam As BaseDam) - MyBase.New(dam) - End Sub - -#Region "SetSqlByFile3" - - '''' - '''' Get SQL query from the embedded resource assembly - '''' - 'Public Sub SetSqlByFile3(filename As String) - ' ' SQLファイルのEncoding情報の取得 - ' Dim sqlEncoding As String = GetConfigParameter.GetConfigValue(PubLiteral.SQL_ENCODING) - - ' If String.IsNullOrEmpty(sqlEncoding) Then - ' ' デフォルト:UTF-8 - ' sqlEncoding = "utf-8" - ' End If - - ' Dim assemblyString As String = "Business" - - ' ' Get SQL query from embedded resource file. - ' Dim commandText As String = EmbeddedResourceLoader.LoadAsString(assemblyString, filename, Encoding.GetEncoding(sqlEncoding)) - - ' ' Set sql command as text - ' Me.SetSqlByCommand(commandText) - 'End Sub - -#End Region - -#Region "Insert" - - ''' - ''' Inserts async parameter values to database - ''' - ''' - ''' - Public Sub InsertTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "AsyncProcessingServiceInsert.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P2", asyncParameterValue.UserId) - Me.SetParameter("P3", asyncParameterValue.ProcessName) - Me.SetParameter("P4", asyncParameterValue.Data) - Me.SetParameter("P5", asyncParameterValue.RegistrationDateTime) - Me.SetParameter("P6", DBNull.Value) - Me.SetParameter("P7", asyncParameterValue.NumberOfRetries) - Me.SetParameter("P8", DBNull.Value) - Me.SetParameter("P9", asyncParameterValue.StatusId) - Me.SetParameter("P10", asyncParameterValue.ProgressRate) - Me.SetParameter("P11", asyncParameterValue.CommandId) - Me.SetParameter("P12", asyncParameterValue.ReservedArea) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "Update" - - #Region "UpdateTaskStart" - - ''' - ''' Updates information in the database that the asynchronous task is started - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskStart(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskStart.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.ExecutionStartDateTime) - Me.SetParameter("P3", asyncParameterValue.StatusId) - Me.SetParameter("P4", DBNull.Value) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "UpdateTaskRetry" - - ''' - ''' Updates information in the database that the asynchronous task is failed and can be retried later - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskRetry(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskRetry.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.NumberOfRetries) - Me.SetParameter("P3", asyncParameterValue.CompletionDateTime) - Me.SetParameter("P4", asyncParameterValue.StatusId) - Me.SetParameter("P5", asyncParameterValue.ExceptionInfo) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "UpdateTaskFail" - - ''' - ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskFail(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskFail.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.CompletionDateTime) - Me.SetParameter("P3", asyncParameterValue.StatusId) - Me.SetParameter("P4", asyncParameterValue.ExceptionInfo) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "UpdateTaskSuccess" - - ''' - ''' Updates information in the database that the asynchronous task is completed - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskSuccess(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskSuccess.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.CompletionDateTime) - Me.SetParameter("P3", asyncParameterValue.ProgressRate) - Me.SetParameter("P4", asyncParameterValue.StatusId) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "UpdateTaskProgress" - - ''' - ''' Updates progress rate of the asynchronous task in the database. - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskProgress(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskProgress.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.ProgressRate) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "UpdateTaskCommand" - - ''' - ''' Updates command value information of a selected asynchronous task - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub UpdateTaskCommand(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "UpdateTaskCommand.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - Me.SetParameter("P2", asyncParameterValue.CommandId) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #Region "StopAllTask" - - ''' - ''' Set stop command for all running asynchronous task. - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub StopAllTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "StopAllTask.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.StatusId) - Me.SetParameter("P2", asyncParameterValue.CommandId) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery() - End Sub - - #End Region - - #End Region - - #Region "Select" - - #Region "SelectCommand" - - ''' - ''' Selects user command from database - ''' - ''' Asynchronous Parameter Values - ''' Asynchronous Return Values - Public Sub SelectCommand(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "SelectCommand.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.TaskId) - - ' Execute SQL query - asyncReturnValue.Obj = Me.ExecSelectScalar() - End Sub - - #End Region - - #Region "SelectTask" - - ''' - ''' To get Asynchronous Task from the database - ''' - ''' - ''' - Public Sub SelectTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue) - Dim filename As String = String.Empty - filename = "SelectTask.sql" - - ' Get SQL query from file. - Me.SetSqlByFile2(filename) - - ' Set SQL parameter values - Me.SetParameter("P1", asyncParameterValue.RegistrationDateTime) - Me.SetParameter("P2", asyncParameterValue.NumberOfRetries) - Me.SetParameter("P3", CInt(AsyncProcessingServiceParameterValue.AsyncStatus.Register)) - Me.SetParameter("P4", CInt(AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd)) - Me.SetParameter("P7", asyncParameterValue.CompletionDateTime) - - Dim dt As New DataTable() - - ' Get Asynchronous Task from the database - Me.ExecSelectFill_DT(dt) - asyncReturnValue.Obj = dt - End Sub - - #End Region - - #End Region - End Class -End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj b/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj index b18a4fe..17a413f 100644 --- a/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj +++ b/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj @@ -60,19 +60,19 @@ - ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll + ..\..\..\..\..\..\..\OpenTouryo\root\programs\VB\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll - ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll + ..\..\..\..\..\..\..\OpenTouryo\root\programs\VB\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll - ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll + ..\..\..\..\..\..\..\OpenTouryo\root\programs\VB\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll - ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll + ..\..\..\..\..\..\..\OpenTouryo\root\programs\VB\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll - ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll + ..\..\..\..\..\..\..\OpenTouryo\root\programs\VB\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll @@ -89,10 +89,11 @@ - - - - + + + + + diff --git a/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj index 4f79389..f2de5bb 100644 --- a/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj +++ b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj @@ -48,6 +48,10 @@ On + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + True + False ..\..\..\Frameworks\Infrastructure\Build\OpenTouryo.Business.dll @@ -72,6 +76,9 @@ + + + Aps) +'********************************************************************************** + +Imports System +Imports System.Data + +Imports Touryo.Infrastructure.Business.Business + +Namespace Touryo.Infrastructure.Business.AsyncProcessingService + + ''' + ''' LayerB class for AsyncProcessing Service + ''' + Public Class ApsLayerB + Inherits MyFcBaseLogic + #Region "Insert" + + ''' + ''' Inserts Async Parameter values to Database through LayerD + ''' + ''' + Public Sub UOC_InsertTask(parameterValue As ApsParameterValue) + ' 戻り値クラスを生成して、事前に戻り値に設定しておく。 + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.InsertTask(parameterValue, returnValue) + End Sub + + #End Region + + #Region "Update" + + #Region "UpdateTaskStart" + + ''' + ''' Updates information in the database that the asynchronous task is started + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskStart(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskStart(parameterValue, returnValue) + End Sub + + #End Region + + #Region "UpdateTaskRetry" + + ''' + ''' Updates information in the database that the asynchronous task is failed and can be retried later + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskRetry(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskRetry(parameterValue, returnValue) + End Sub + + #End Region + + #Region "UpdateTaskFail" + + ''' + ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskFail(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskFail(parameterValue, returnValue) + End Sub + + #End Region + + #Region "UpdateTaskSuccess" + + ''' + ''' Updates information in the database that the asynchronous task is completed + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskSuccess(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskSuccess(parameterValue, returnValue) + End Sub + + #End Region + + #Region "UpdateTaskProgress" + + ''' + ''' Updates progress rate of the asynchronous task in the database. + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskProgress(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskProgress(parameterValue, returnValue) + End Sub + + #End Region + + #Region "UpdateTaskCommand" + + ''' + ''' Updates command value information of a selected asynchronous task + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_UpdateTaskCommand(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.UpdateTaskCommand(parameterValue, returnValue) + End Sub + + #End Region + + #Region "StopAllTask" + + ''' + ''' Set stop command for all running asynchronous task + ''' + ''' Asynchronous Parameter Values + Private Sub UOC_StopAllTask(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.StopAllTask(parameterValue, returnValue) + End Sub + + #End Region + + #End Region + + #Region "Select" + + #Region "SelectCommand" + + ''' + ''' Selects user command from Database through LayerD + ''' + ''' + Private Sub UOC_SelectCommand(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.SelectCommand(parameterValue, returnValue) + End Sub + + #End Region + + #Region "SelectTask" + + ''' + ''' Selects Asynchronous task from LayerD + ''' + ''' Async Parameter Value + Private Sub UOC_SelectTask(parameterValue As ApsParameterValue) + Dim returnValue As New ApsReturnValue() + Me.ReturnValue = returnValue + + Dim layerD As New ApsLayerD(Me.GetDam()) + layerD.SelectTask(parameterValue, returnValue) + + Dim dt As DataTable = DirectCast(returnValue.Obj, DataTable) + returnValue.Obj = Nothing + + If dt IsNot Nothing Then + If dt.Rows.Count <> 0 Then + returnValue.TaskId = Convert.ToInt32(dt.Rows(0)("Id")) + returnValue.UserId = dt.Rows(0)("UserId").ToString() + returnValue.ProcessName = dt.Rows(0)("ProcessName").ToString() + returnValue.Data = dt.Rows(0)("Data").ToString() + returnValue.NumberOfRetries = Convert.ToInt32(dt.Rows(0)("NumberOfRetries")) + returnValue.ReservedArea = dt.Rows(0)("ReservedArea").ToString() + returnValue.CommandId = Convert.ToInt32(dt.Rows(0)("CommandId")) + End If + End If + End Sub + + #End Region + + #End Region + + #Region "TestConnection" + + ''' + ''' Tests the connection with the specified database + ''' + ''' Async Parameter Value + Private Sub UOC_TestConnection(parameterValue As ApsParameterValue) + Dim layerD As New ApsLayerD(Me.GetDam()) + End Sub + + #End Region + End Class +End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb new file mode 100644 index 0000000..4793dd6 --- /dev/null +++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb @@ -0,0 +1,329 @@ +'********************************************************************************** +'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +'********************************************************************************** + +#Region "Apache License" +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. +' +#End Region + +'********************************************************************************** +'* クラス名 :LayerD +'* クラス日本語名 :LayerD +'* +'* 日時 更新者 内容 +'* ---------- ---------------- ------------------------------------------------- +'* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service +'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service +'* 04/14/2015 Sandeep Did code modification of update and select asynchronous task +'* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource +'* 05/28/2015 Sandeep Did code implementation to update Exception information to the database +'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task +'* Modified code to reset Exception information, before starting asynchronous task +'* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task, +'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state +'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +'********************************************************************************** + +Imports System +Imports System.Data + +Imports Touryo.Infrastructure.Business.Dao +Imports Touryo.Infrastructure.Framework.AsyncProcessingService +Imports Touryo.Infrastructure.Public.Db + +Namespace Touryo.Infrastructure.Business.AsyncProcessingService + ''' + ''' LayerD class for AsyncProcessing Service + ''' + Public Class ApsLayerD + Inherits MyBaseDao + ''' AsyncProcessingService用B層 + ''' dam + Public Sub New(dam As BaseDam) + MyBase.New(dam) + End Sub + + #Region "Insert" + + ''' + ''' Inserts async parameter values to database + ''' + ''' + ''' + Public Sub InsertTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "AsyncProcessingServiceInsert.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P2", parameterValue.UserId) + Me.SetParameter("P3", parameterValue.ProcessName) + Me.SetParameter("P4", parameterValue.Data) + Me.SetParameter("P5", parameterValue.RegistrationDateTime) + Me.SetParameter("P6", DBNull.Value) + Me.SetParameter("P7", parameterValue.NumberOfRetries) + Me.SetParameter("P8", DBNull.Value) + Me.SetParameter("P9", parameterValue.StatusId) + Me.SetParameter("P10", parameterValue.ProgressRate) + Me.SetParameter("P11", parameterValue.CommandId) + Me.SetParameter("P12", parameterValue.ReservedArea) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "Update" + + #Region "UpdateTaskStart" + + ''' + ''' Updates information in the database that the asynchronous task is started + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskStart(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskStart.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.ExecutionStartDateTime) + Me.SetParameter("P3", parameterValue.StatusId) + Me.SetParameter("P4", DBNull.Value) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "UpdateTaskRetry" + + ''' + ''' Updates information in the database that the asynchronous task is failed and can be retried later + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskRetry(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskRetry.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.NumberOfRetries) + Me.SetParameter("P3", parameterValue.CompletionDateTime) + Me.SetParameter("P4", parameterValue.StatusId) + Me.SetParameter("P5", parameterValue.ExceptionInfo) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "UpdateTaskFail" + + ''' + ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskFail(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskFail.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.CompletionDateTime) + Me.SetParameter("P3", parameterValue.StatusId) + Me.SetParameter("P4", parameterValue.ExceptionInfo) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "UpdateTaskSuccess" + + ''' + ''' Updates information in the database that the asynchronous task is completed + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskSuccess(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskSuccess.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.CompletionDateTime) + Me.SetParameter("P3", parameterValue.ProgressRate) + Me.SetParameter("P4", parameterValue.StatusId) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "UpdateTaskProgress" + + ''' + ''' Updates progress rate of the asynchronous task in the database. + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskProgress(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskProgress.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.ProgressRate) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "UpdateTaskCommand" + + ''' + ''' Updates command value information of a selected asynchronous task + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub UpdateTaskCommand(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "UpdateTaskCommand.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + Me.SetParameter("P2", parameterValue.CommandId) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #Region "StopAllTask" + + ''' + ''' Set stop command for all running asynchronous task. + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub StopAllTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "StopAllTask.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.StatusId) + Me.SetParameter("P2", parameterValue.CommandId) + + ' Execute SQL query + returnValue.Obj = Me.ExecInsUpDel_NonQuery() + End Sub + + #End Region + + #End Region + + #Region "Select" + + #Region "SelectCommand" + + ''' + ''' Selects user command from database + ''' + ''' Asynchronous Parameter Values + ''' Asynchronous Return Values + Public Sub SelectCommand(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "SelectCommand.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.TaskId) + + ' Execute SQL query + returnValue.Obj = Me.ExecSelectScalar() + End Sub + + #End Region + + #Region "SelectTask" + + ''' + ''' To get Asynchronous Task from the database + ''' + ''' + ''' + Public Sub SelectTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue) + Dim filename As String = String.Empty + filename = "SelectTask.sql" + + ' Get SQL query from file. + Me.SetSqlByFile2(filename) + + ' Set SQL parameter values + Me.SetParameter("P1", parameterValue.RegistrationDateTime) + Me.SetParameter("P2", parameterValue.NumberOfRetries) + Me.SetParameter("P3", CInt(AsyncStatus.Register)) + Me.SetParameter("P4", CInt(AsyncStatus.AbnormalEnd)) + Me.SetParameter("P7", parameterValue.CompletionDateTime) + + Dim dt As New DataTable() + + ' Get Asynchronous Task from the database + Me.ExecSelectFill_DT(dt) + returnValue.Obj = dt + End Sub + + #End Region + + #End Region + End Class +End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb new file mode 100644 index 0000000..b90ba76 --- /dev/null +++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb @@ -0,0 +1,97 @@ +'********************************************************************************** +'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +'********************************************************************************** + +#Region "Apache License" +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. +' +#End Region + +'********************************************************************************** +'* クラス名 :ApsParameterValue +'* クラス日本語名 :ApsParameterValue +'* +'* 日時 更新者 内容 +'* ---------- ---------------- ------------------------------------------------- +'* 11/28/2014 Supragyan Paramter Value class for Asynchronous Processing Service +'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. +'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +'* 2018/08/24 西野 大介 列挙型と列挙型処理クラスの移動 +'********************************************************************************** + +Imports System +Imports System.Reflection + +Imports Touryo.Infrastructure.Business.Common +Imports Touryo.Infrastructure.Business.Util + +Namespace Touryo.Infrastructure.Business.AsyncProcessingService + ''' + ''' Paramter Value class for Asynchronous Processing Service + ''' + Public Class ApsParameterValue + Inherits MyParameterValue + ''' 汎用エリア + Public Obj As Object + + ''' TaskId + Public TaskId As Integer + + ''' UserId + Public UserId As String + + ''' ProcessName + Public ProcessName As String + + ''' Data + Public Data As String + + ''' RegistrationDateTime + Public RegistrationDateTime As DateTime + + ''' ExecutionStartDateTime + Public ExecutionStartDateTime As DateTime + + ''' NumberOfRetries + Public NumberOfRetries As Integer + + ''' ProgressRate + Public ProgressRate As Decimal + + ''' Status + Public StatusId As Integer + + ''' CompletionDateTime + Public CompletionDateTime As DateTime + + ''' CommandId + Public CommandId As Integer + + ''' ReservedArea + Public ReservedArea As String + + ''' ExceptionInfo + Public ExceptionInfo As String + + #Region "コンストラクタ" + + ''' コンストラクタ + Public Sub New(screenId As String, controlId As String, methodName As String, actionType As String, user As MyUserInfo) + ' Baseのコンストラクタに引数を渡すために必要。 + MyBase.New(screenId, controlId, methodName, actionType, user) + End Sub + + #End Region + End Class +End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb new file mode 100644 index 0000000..817d9f8 --- /dev/null +++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb @@ -0,0 +1,83 @@ +'********************************************************************************** +'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +'********************************************************************************** + +#Region "Apache License" +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. +' +#End Region + +'********************************************************************************** +'* クラス名 :ApsReturnValue +'* クラス日本語名 :ApsReturnValue +'* +'* 日時 更新者 内容 +'* ---------- ---------------- ------------------------------------------------- +'* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service +'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal. +'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps) +'********************************************************************************** + +Imports System +Imports Touryo.Infrastructure.Business.Common + +Namespace Touryo.Infrastructure.Business.AsyncProcessingService + ''' + ''' Paramter Return Value class for Asynchronous Processing Service + ''' + Public Class ApsReturnValue + Inherits MyReturnValue + ''' 汎用エリア + Public Obj As Object + + ''' TaskId + Public TaskId As Integer + + ''' UserId + Public UserId As String + + ''' ProcessName + Public ProcessName As String + + ''' Data + Public Data As String + + ''' RegistrationDateTime + Public RegistrationDateTime As DateTime + + ''' ExecutionStartDateTime; + Public ExecutionStartDateTime As DateTime + + ''' NumberOfRetries; + Public NumberOfRetries As Integer + + ''' ProgressRate + Public ProgressRate As Decimal + + ''' StatusId; + Public StatusId As Integer + + ''' CompletionDateTime + Public CompletionDateTime As DateTime + + ''' CommandId; + Public CommandId As Integer + + ''' ReservedArea + Public ReservedArea As String + + ''' ExceptionInfo + Public ExceptionInfo As String + End Class +End Namespace diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb new file mode 100644 index 0000000..624f9a7 --- /dev/null +++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb @@ -0,0 +1,103 @@ +'********************************************************************************** +'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd. +'********************************************************************************** + +#Region "Apache License" +' +' Licensed under the Apache License, Version 2.0 (the "License"); +' you may not use this file except in compliance with the License. +' You may obtain a copy of the License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' See the License for the specific language governing permissions and +' limitations under the License. +' +#End Region + +'********************************************************************************** +'* クラス名 :ApsUtility +'* クラス日本語名 :ApsUtility +'* +'* 日時 更新者 内容 +'* ---------- ---------------- ------------------------------------------------- +'* 2018/08/24 西野 大介 新規作成(Utilityメソッドを部品化) +'********************************************************************************** + +Imports Touryo.Infrastructure.Business.Util +Imports Touryo.Infrastructure.Public.Db + +Namespace Touryo.Infrastructure.Business.AsyncProcessingService + ''' ApsUtility + Public Class ApsUtility + ''' Get command information from database. + ''' asynchronous task id + ''' asynchronous return value + ''' BaseDam + Public Shared Sub GetCommandValue(taskID As Integer, returnValue As ApsReturnValue, dam As BaseDam) + ' Sets parameters of AsyncProcessingServiceParameterValue to get command value. + Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "SelectCommand", "SelectCommand", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService")) + + parameterValue.TaskId = taskID + + ' Calls data access part of asynchronous processing service. + Dim layerD As New ApsLayerD(dam) + layerD.SelectCommand(parameterValue, returnValue) + returnValue.CommandId = CInt(returnValue.Obj) + End Sub + + ''' + ''' Resumes asynchronous process in the middle of the processing. + ''' + ''' Task ID + ''' asynchronous return value + ''' BaseDam + Public Shared Sub ResumeProcessing(taskID As Integer, returnValue As ApsReturnValue, dam As BaseDam) + ' Reset the command of selected task. + ApsUtility.UpdateTaskCommand(taskID, 0, returnValue, dam) + End Sub + + ''' + ''' Updates the progress rate in the database. + ''' + ''' asynchronous task id + ''' ApsReturnValue + ''' progress rate + ''' BaseDam + Public Shared Sub UpdateProgressRate(taskID As Integer, returnValue As ApsReturnValue, progressRate As Decimal, dam As BaseDam) + ' Sets parameters of AsyncProcessingServiceParameterValue to Update progress rate + Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "UpdateTaskProgress", "UpdateTaskProgress", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService")) + + parameterValue.TaskId = taskID + parameterValue.ProgressRate = progressRate + + ' Calls data access part of asynchronous processing service. + Dim layerD As New ApsLayerD(dam) + layerD.UpdateTaskProgress(parameterValue, returnValue) + End Sub + + ''' + ''' Updates the command of selected task + ''' + ''' Task ID + ''' Command ID + ''' user parameter value + ''' BaseDam + Public Shared Sub UpdateTaskCommand(taskID As Integer, commandId As Integer, returnValue As ApsReturnValue, dam As BaseDam) + ' Sets parameters of AsyncProcessingServiceParameterValue to update the command of selected task. + Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "UpdateTaskCommand", "UpdateTaskCommand", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService")) + + parameterValue.TaskId = taskID + parameterValue.CommandId = commandId + + ' Calls data access part of asynchronous processing service. + Dim layerD As New ApsLayerD(dam) + layerD.UpdateTaskCommand(parameterValue, returnValue) + End Sub + + + End Class +End Namespace diff --git a/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/packages.config b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/packages.config new file mode 100644 index 0000000..bfe8416 --- /dev/null +++ b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/root/programs/VB/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config b/root/programs/VB/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config new file mode 100644 index 0000000..bfe8416 --- /dev/null +++ b/root/programs/VB/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 5c8e744c104b3cac6fdecc007329614e15107e1d Mon Sep 17 00:00:00 2001 From: daisukenishino2 Date: Tue, 18 Sep 2018 16:48:06 +0900 Subject: [PATCH 4/5] tweak. --- .../AsyncProcessingService.csproj | 4 +- .../Infrastructure/Business/Business.csproj | 116 ++++++- .../Infrastructure/Business/Dao/CmnDao.cs | 34 ++- .../Infrastructure/Business/Dao/MyBaseDao.cs | 35 ++- .../Business/Util/MyCmnFunction.cs | 286 ++++++++++++++++++ .../Infrastructure/Business/app.config | 11 + .../Infrastructure/Business/packages.config | 24 ++ .../Infrastructure/Business/Business.vbproj | 19 +- .../Infrastructure/Business/Dao/CmnDao.vb | 88 ++++-- .../Infrastructure/Business/Dao/MyBaseDao.vb | 195 ++++++------ 10 files changed, 662 insertions(+), 150 deletions(-) create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/Util/MyCmnFunction.cs create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/app.config create mode 100644 root/programs/CS/Frameworks/Infrastructure/Business/packages.config diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj index c07a795..40e3031 100644 --- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj +++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj @@ -51,7 +51,9 @@ - + + Component + Component diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj index bea576c..a76d6a6 100644 --- a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj +++ b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj @@ -63,33 +63,116 @@ false - - ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll + + ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll + True - - ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll + + ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll + True - - ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll + + ..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll + True - - ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll + + ..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll + True - - ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll + + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll + True + + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\Npgsql.3.2.5\lib\net451\Npgsql.dll + True + + + ..\packages\Touryo.Infrastructure.Public.Db.DamManagedOdp.2.3.0\lib\net46\OpenTouryo.DamManagedOdp.dll + True + + + ..\packages\Touryo.Infrastructure.Public.Db.DamMySQL.2.3.0\lib\net46\OpenTouryo.DamMySQL.dll + True + + + ..\packages\Touryo.Infrastructure.Public.Db.DamPstGrS.2.3.0\lib\net46\OpenTouryo.DamPstGrS.dll + True + + + ..\packages\Touryo.Infrastructure.Framework.2.3.0\lib\net46\OpenTouryo.Framework.dll + True + + + ..\packages\Touryo.Infrastructure.Public.2.3.0\lib\net46\OpenTouryo.Public.dll + True + + + ..\packages\Oracle.ManagedDataAccess.12.2.1100\lib\net40\Oracle.ManagedDataAccess.dll + True + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll + True + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + - - - + + + @@ -112,11 +195,10 @@ + - - @@ -150,6 +232,10 @@ MyBusinessSystemExceptionMessageResource.Designer.cs + + + +