/// <summary> /// Fills the placeholders /// </summary> /// <param name="template">Template to use</param> /// <param name="errorCollection">Error Collection</param> /// <param name="parsedData">Parsed config data</param> /// <param name="valueObject">Value object</param> /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param> /// <param name="curStep">Current step that is rendered</param> /// <param name="nextStep">Next step that is being rendered</param> /// <param name="exportSettings">Export Settings</param> /// <param name="stepRenderer">Action Step renderer</param> /// <returns>Filled placeholders</returns> protected override async Task <string> FillPlaceholders(ExportTemplate template, ExportPlaceholderErrorCollection errorCollection, SetQuestStateActionData parsedData, IFlexFieldExportable valueObject, FlexFieldObject flexFieldObject, ExportDialogData curStep, ExportDialogData nextStep, ExportSettings exportSettings, IActionStepRenderer stepRenderer) { ScribanSetQuestStateActionData setStateData = new ScribanSetQuestStateActionData(); setStateData.Quest = FlexFieldValueCollectorUtil.BuildFlexFieldValueObject <ScribanExportQuest>(null, null, valueObject, exportSettings, errorCollection); setStateData.TargetState = ConvertQuestState(parsedData.QuestState); return(await ScribanActionRenderingUtil.FillPlaceholders(_cachedDbAccess, errorCollection, template.Code, setStateData, flexFieldObject, curStep, nextStep, _scribanLanguageKeyGenerator, stepRenderer)); }
/// <summary> /// Fills the placeholders /// </summary> /// <param name="template">Template to use</param> /// <param name="errorCollection">Error Collection</param> /// <param name="parsedData">Parsed config data</param> /// <param name="valueObject">Value object</param> /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param> /// <param name="curStep">Current step that is rendered</param> /// <param name="nextStep">Next step that is being rendered</param> /// <param name="exportSettings">Export Settings</param> /// <param name="stepRenderer">Action Step renderer</param> /// <returns>Filled placeholders</returns> protected override async Task <string> FillPlaceholders(ExportTemplate template, ExportPlaceholderErrorCollection errorCollection, SetQuestStateActionData parsedData, IFlexFieldExportable valueObject, FlexFieldObject flexFieldObject, ExportDialogData curStep, ExportDialogData nextStep, ExportSettings exportSettings, IActionStepRenderer stepRenderer) { string actionCode = ExportUtil.RenderPlaceholderIfTrue(template.Code, Placeholder_QuestState_NotStarted_Start, Placeholder_QuestState_NotStarted_End, parsedData.QuestState == SetQuestStateActionData.QuestState_NotStarted); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_QuestState_InProgress_Start, Placeholder_QuestState_InProgress_End, parsedData.QuestState == SetQuestStateActionData.QuestState_InProgress); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_QuestState_Success_Start, Placeholder_QuestState_Success_End, parsedData.QuestState == SetQuestStateActionData.QuestState_Success); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_QuestState_Failed_Start, Placeholder_QuestState_Failed_End, parsedData.QuestState == SetQuestStateActionData.QuestState_Failed); ExportObjectData flexFieldExportData = new ExportObjectData(); flexFieldExportData.ExportData.Add(ExportConstants.ExportDataObject, valueObject); flexFieldExportData.ExportData.Add(ExportConstants.ExportDataObjectType, ExportConstants.ExportObjectTypeQuest); _flexFieldPlaceholderResolver.SetErrorMessageCollection(errorCollection); actionCode = _flexFieldPlaceholderResolver.FillPlaceholders(actionCode, flexFieldExportData).Result; return(await stepRenderer.ReplaceBasePlaceholders(errorCollection, actionCode, curStep, nextStep, flexFieldObject)); }