예제 #1
0
        internal static string CleanModelData(Dev2DecisionCallbackHandler callBackHandler)
        {
            // Remove naughty chars...
            string tmp = callBackHandler.ModelData;

            // remove the silly Choose... from the string
            tmp = Dev2DecisionStack.RemoveDummyOptionsFromModel(tmp.ToStringBuilder());
            // remove [[]], &, !
            tmp = Dev2DecisionStack.RemoveNaughtyCharsFromModel(tmp);
            return(tmp);
        }
예제 #2
0
        /// <summary>
        /// Saves the JSON model for decisions from the wizard ;)
        /// </summary>
        /// <param name="args">The args.</param>
        /// <param name="workspaceId">The workspace ID.</param>
        /// <param name="dataListId">The data list ID.</param>
        /// <returns></returns>
        public string SaveModel(string args, Guid workspaceId, Guid dataListId)
        {
            string result = "{ \"message\" : \"Error Saving Model\"} ";

            if (dataListId != GlobalConstants.NullDataListID)
            {
                var           compiler = DataListFactory.CreateDataListCompiler();
                ErrorResultTO errors;

                // remove the silly Choose... from the string
                args = Dev2DecisionStack.RemoveDummyOptionsFromModel(new StringBuilder(args));
                // remove [[]], &, !
                args = Dev2DecisionStack.RemoveNaughtyCharsFromModel(args);

                compiler.UpsertSystemTag(dataListId, enSystemTag.SystemModel, args, out errors);

                result = "{  \"message\" : \"Saved Model\"} ";
            }

            return(result);
        }