Ejemplo n.º 1
0
        public void SaveScheme(string schemaCode, string scheme)
        {
            var cache = Store.GetOrCreateCache <string, WorkflowScheme>(IgniteConstants.WorkflowSchemeCacheName);

            WorkflowScheme wfScheme = cache.ContainsKey(schemaCode) ? cache.Get(schemaCode) : null;

            if (wfScheme == null)
            {
                wfScheme = new WorkflowScheme {
                    Code = schemaCode, Scheme = scheme
                };
                cache.Put(wfScheme.Code, wfScheme);
            }
            else
            {
                wfScheme.Scheme = scheme;
                cache.Put(wfScheme.Code, wfScheme);
            }
        }
Ejemplo n.º 2
0
        public XElement GetScheme(string code)
        {
            var cache = Store.GetOrCreateCache <string, WorkflowScheme>(IgniteConstants.WorkflowSchemeCacheName);


            WorkflowScheme scheme = null;

            try
            {
                scheme = cache.Get(code);
            }
            catch (KeyNotFoundException)
            {
            }

            if (scheme == null || string.IsNullOrEmpty(scheme.Scheme))
            {
                throw SchemeNotFoundException.Create(code, SchemeLocation.WorkflowScheme);
            }

            return(XElement.Parse(scheme.Scheme));
        }