public override string GetExecutionData() { LocalizableParameterValuesList decisionOptionItems = null; if (BranchingDecisions.Value.IsNotNullOrEmpty()) { Process process = Owner; ProcessSchema processSchema = process.ProcessSchema; string resourceManagerName = processSchema.OwnerSchema == null ? processSchema.GetResourceManagerName() : processSchema.OwnerSchema.GetResourceManagerName(); var element = processSchema.GetBaseElementByUId(SchemaElementUId); var resourceItemName = "BaseElements." + element.Name + ".Parameters.BranchingDecisions.Value"; var localizableString = new LocalizableString(Storage, resourceManagerName, resourceItemName); string value = localizableString.Value; if (value.IsNotNullOrEmpty()) { decisionOptionItems = LocalizableParameterValuesList.DeserializeFrom77FormatData(value, "Caption"); } else { decisionOptionItems = LocalizableParameterValuesList.DeserializeData(BranchingDecisions.Value); decisionOptionItems.SetupDefaultLocalizableValues("Caption", NoCaptionLocalizableString.Value); } } string informationOnStep = LocalizableString.IsNullOrEmpty(InformationOnStep) ? GetParameterValue("InformationOnStep")?.ToString() ?? string.Empty : InformationOnStep.Value; string executionData = SerializeToString(new { procElUId = UId, name = Name, processId = ProcessUserTaskUtilities.GetParentProcessId(Owner), isProcessExecutedBySignal = ProcessUserTaskUtilities.GetIsProcessExecutedBySignal(Owner), processName = Owner.Name, urlToken = "ProcessCardModuleV2/UserQuestionProcessPageV2", recommendation = GetActivityTitle(), informationOnStep, activityRecordId = CurrentActivityId, questionText = Question.ToString(), decisionMode = DecisionMode, isDecisionRequired = IsDecisionRequired, decisionOptions = decisionOptionItems?.To77FormatList(), executionContext = ExecutionContext, nextProcElUId = "nextProcElUIdValue" }); string userContextData = ProcessLane?.GetUserContextData(); if (!string.IsNullOrEmpty(userContextData)) { var sb = new StringBuilder(executionData); sb.Length--; sb.Append(","); sb.Append(userContextData); sb.Append("}"); executionData = sb.ToString(); } return(executionData); }
private string GetUserContextExecutionData(string jsonData) { string userContextData = ProcessLane?.GetUserContextData(); if (userContextData.IsNullOrEmpty()) { return jsonData; } var sb = new StringBuilder(jsonData); sb.Length--; sb.Append(",").Append(userContextData).Append("}"); return sb.ToString(); }
public override string GetExecutionData() { var sb = new StringBuilder(512); string parameterConfigs = GenerateParameterConfigs(sb); string valueConfigs = sb.ToString(); sb.Length = 0; string pageSchemaConfig = GeneratePageSchemaConfigs(sb, valueConfigs); sb.Length = 0; bool isNotFirstProperty = false; string uid = UId.ToString(); object title = GetParameterValue("Title") ?? string.Empty; object recommendation = GetParameterValue("Recommendation") ?? string.Empty; object informationOnStep = GetParameterValue("InformationOnStep") ?? string.Empty; sb.Append("{"); AppendJSonProperty(sb, "procElUId", uid, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "name", Name, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "processId", ProcessUserTaskUtilities.GetParentProcessId(Owner), 1, ref isNotFirstProperty); AppendJSonProperty(sb, "isProcessExecutedBySignal", ProcessUserTaskUtilities.GetIsProcessExecutedBySignal(Owner), 2, ref isNotFirstProperty); AppendJSonProperty(sb, "processName", Owner.Name, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "title", title, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "recommendation", recommendation, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "informationOnStep", informationOnStep, 1, ref isNotFirstProperty); AppendJSonProperty(sb, "nextProcElUId", "nextProcElUIdValue", 1, ref isNotFirstProperty); AppendJSonProperty(sb, "urlToken", "ProcessCardModuleV2/AutoGeneratedPageV2", 1, ref isNotFirstProperty); AppendJSonProperty(sb, "autoGeneratedPage", true, 1, ref isNotFirstProperty); if (EntityId != Guid.Empty) { AppendJSonProperty(sb, "recordId", EntityId, 1, ref isNotFirstProperty); } AppendJSonProperty(sb, "pageSchema", pageSchemaConfig, 3, ref isNotFirstProperty); AppendJSonProperty(sb, "parameters", parameterConfigs, 3, ref isNotFirstProperty); string userContextData = ProcessLane?.GetUserContextData(); if (!string.IsNullOrEmpty(userContextData)) { sb.Append(","); sb.Append(userContextData); } sb.Append("}"); return(sb.ToString()); }