public void SaveGlobalParameter <T>(string type, string name, T value)
        {
            using (OracleConnection connection = new OracleConnection(ConnectionString))
            {
                var parameter = WorkflowGlobalParameter.SelectByTypeAndName(connection, type, name).FirstOrDefault();

                if (parameter == null)
                {
                    parameter = new WorkflowGlobalParameter()
                    {
                        Id    = Guid.NewGuid(),
                        Type  = type,
                        Name  = name,
                        Value = JsonConvert.SerializeObject(value)
                    };

                    parameter.Insert(connection);
                }
                else
                {
                    parameter.Value = JsonConvert.SerializeObject(value);

                    parameter.Update(connection);
                }

                WorkflowProcessInstance.Commit(connection);
            }
        }
        public List <T> LoadGlobalParameters <T>(string type)
        {
            using (OracleConnection connection = new OracleConnection(ConnectionString))
            {
                var parameters = WorkflowGlobalParameter.SelectByTypeAndName(connection, type);

                return(parameters.Select(p => JsonConvert.DeserializeObject <T>(p.Value)).ToList());
            }
        }
        public T LoadGlobalParameter <T>(string type, string name)
        {
            using (OracleConnection connection = new OracleConnection(ConnectionString))
            {
                var parameter = WorkflowGlobalParameter.SelectByTypeAndName(connection, type, name).FirstOrDefault();

                if (parameter == null)
                {
                    return(default(T));
                }

                return(JsonConvert.DeserializeObject <T>(parameter.Value));
            }
        }