Exemplo n.º 1
0
 public List <string> GetRelatedByInliningSchemeCodes(string schemeCode)
 {
     using (MySqlConnection connection = new MySqlConnection(ConnectionString))
     {
         return(WorkflowScheme.GetRelatedSchemeCodes(connection, schemeCode));
     }
 }
Exemplo n.º 2
0
 public List <string> GetInlinedSchemeCodes()
 {
     using (MySqlConnection connection = new MySqlConnection(ConnectionString))
     {
         return(WorkflowScheme.GetInlinedSchemeCodes(connection));
     }
 }
Exemplo n.º 3
0
 public void SaveScheme(string schemaCode, bool canBeInlined, List <string> inlinedSchemes, string scheme)
 {
     using (MySqlConnection connection = new MySqlConnection(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
             };
             wfScheme.Insert(connection);
         }
         else
         {
             wfScheme.Scheme         = scheme;
             wfScheme.CanBeInlined   = canBeInlined;
             wfScheme.InlinedSchemes = inlinedSchemes.Any() ? JsonConvert.SerializeObject(inlinedSchemes) : null;
             wfScheme.Update(connection);
         }
     }
 }
Exemplo n.º 4
0
 public void SetSchemeTags(string schemeCode, IEnumerable <string> tags)
 {
     using (var connection = new MySqlConnection(ConnectionString))
     {
         WorkflowScheme.SetSchemeTags(connection, schemeCode, tags, _runtime.Builder);
     }
 }
Exemplo n.º 5
0
 public List <string> SearchSchemesByTags(IEnumerable <string> tags)
 {
     using (var connection = new MySqlConnection(ConnectionString))
     {
         return(WorkflowScheme.GetSchemeCodesByTags(connection, tags));
     }
 }
Exemplo n.º 6
0
        public XElement GetScheme(string code)
        {
            using(MySqlConnection connection = new MySqlConnection(ConnectionString))
            {
                WorkflowScheme scheme = WorkflowScheme.SelectByKey(connection, code);
                if (scheme == null || string.IsNullOrEmpty(scheme.Scheme))
                    throw new SchemeNotFoundException();

                return XElement.Parse(scheme.Scheme);
            }
        }
Exemplo n.º 7
0
        public XElement GetScheme(string code)
        {
            using (MySqlConnection connection = new MySqlConnection(ConnectionString))
            {
                var scheme = WorkflowScheme.SelectByKey(connection, code);
                if (scheme == null || string.IsNullOrEmpty(scheme.Scheme))
                {
                    throw SchemeNotFoundException.Create(code, SchemeLocation.WorkflowScheme);
                }

                return(XElement.Parse(scheme.Scheme));
            }
        }
Exemplo n.º 8
0
 public void SaveScheme(string schemaCode, string scheme)
 {
     using (MySqlConnection connection = new MySqlConnection(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);
         }
     }
 }