Beispiel #1
0
        /// <summary>
        /// Update the workflow pointed by this WorkflowReference
        /// </summary>
        /// <param name="newwf">The (new or modified) <see cref="Core.WF.Workflow"/> Workflow </param>
        /// <returns><value>true</value>on success,<value>false</value> otherwise</returns>
        public bool UpdateWorkflow(Core.WF.Workflow newwf)
        {
            Model mod = sto.getEntityByID <Model>(modelId);

            if (mod != null)
            {
                mod.xml       = sto.object2ByteArray(newwf);
                mod.nameModel = newwf.WorkflowName;
                if (sto.commit())
                {
                    //Ok, update cached object
                    wf_cache = newwf;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }