Exemple #1
0
 public void SaveScheme(string schemaCode, bool canBeInlined, List <string> inlinedSchemes, string scheme,
                        List <string> tags)
 {
     using (SqlConnection connection = new SqlConnection(ConnectionString))
     {
         WorkflowScheme wfScheme = WorkflowScheme.SelectByKey(connection, schemaCode);
         if (wfScheme == null)
         {
             wfScheme = new WorkflowScheme
             {
                 Code           = schemaCode,
                 Scheme         = scheme,
                 CanBeInlined   = canBeInlined,
                 InlinedSchemes = inlinedSchemes.Any()
                     ? JsonConvert.SerializeObject(inlinedSchemes)
                     : null,
                 Tags = TagHelper.ToTagStringForDatabase(tags)
             };
             wfScheme.Insert(connection);
         }
         else
         {
             wfScheme.Scheme         = scheme;
             wfScheme.CanBeInlined   = canBeInlined;
             wfScheme.InlinedSchemes = inlinedSchemes.Any() ? JsonConvert.SerializeObject(inlinedSchemes) : null;
             wfScheme.Tags           = TagHelper.ToTagStringForDatabase(tags);
             wfScheme.Update(connection);
         }
     }
 }
        public XElement GetScheme(string code)
        {
            using (OracleConnection connection = new OracleConnection(ConnectionString))
            {
                WorkflowScheme scheme = WorkflowScheme.SelectByKey(connection, code);
                if (scheme == null || string.IsNullOrEmpty(scheme.Scheme))
                {
                    throw new SchemeNotFoundException();
                }

                return(XElement.Parse(scheme.Scheme));
            }
        }
Exemple #3
0
        public XElement GetScheme(string code)
        {
            using (SqlConnection connection = new SqlConnection(ConnectionString))
            {
                WorkflowScheme scheme = WorkflowScheme.SelectByKey(connection, code);
                if (scheme == null || string.IsNullOrEmpty(scheme.Scheme))
                {
                    throw SchemeNotFoundException.Create(code, SchemeLocation.WorkflowProcessScheme);
                }

                return(XElement.Parse(scheme.Scheme));
            }
        }
 public void SaveScheme(string schemaCode, string scheme)
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         WorkflowScheme wfScheme = WorkflowScheme.SelectByKey(connection, schemaCode);
         if (wfScheme == null)
         {
             wfScheme        = new WorkflowScheme();
             wfScheme.Code   = schemaCode;
             wfScheme.Scheme = scheme;
             wfScheme.Insert(connection);
         }
         else
         {
             wfScheme.Scheme = scheme;
             wfScheme.Update(connection);
         }
     }
 }