Beispiel #1
0
        public void SaveScheme(string schemeCode, bool canBeInlined, List <string> inlinedSchemes, string scheme)
        {
            using (var session = Store.OpenSession())
            {
                var wfscheme =
                    session.Query <WorkflowScheme>().Customize(c => c.WaitForNonStaleResultsAsOfNow()).FirstOrDefault(wps => wps.Code == schemeCode);

                if (wfscheme == null)
                {
                    wfscheme = new WorkflowScheme
                    {
                        Code           = schemeCode,
                        Scheme         = scheme,
                        CanBeInlined   = canBeInlined,
                        InlinedSchemes = inlinedSchemes
                    };
                    session.Store(wfscheme);
                }
                else
                {
                    wfscheme.CanBeInlined   = canBeInlined;
                    wfscheme.InlinedSchemes = inlinedSchemes;
                    wfscheme.Scheme         = scheme;
                }

                session.SaveChanges();
            }
        }
Beispiel #2
0
        public void SaveScheme(string schemeCode, string scheme)
        {
            using (var session = Store.OpenSession())
            {
                var wfscheme =
                    session.Query <WorkflowScheme>().FirstOrDefault(wps => wps.Code == schemeCode);

                if (wfscheme == null)
                {
                    wfscheme = new WorkflowScheme()
                    {
                        Code   = schemeCode,
                        Scheme = scheme
                    };
                    session.Store(wfscheme);
                }
                else
                {
                    wfscheme.Scheme = scheme;
                }

                session.SaveChanges();
            }
        }
Beispiel #3
0
        public void SaveScheme(string schemeCode, string scheme)
        {
            using (var session = Store.OpenSession())
            {
                var wfscheme =
                    session.Query <WorkflowScheme>().Customize(c => c.WaitForNonStaleResultsAsOfNow()).FirstOrDefault(wps => wps.Code == schemeCode);

                if (wfscheme == null)
                {
                    wfscheme = new WorkflowScheme
                    {
                        Code   = schemeCode,
                        Scheme = scheme
                    };
                    session.Store(wfscheme);
                }
                else
                {
                    wfscheme.Scheme = scheme;
                }

                session.SaveChanges();
            }
        }