Esempio n. 1
0
        public string GetExecutionData(EmailTemplateUserTask userTask)
        {
            string informationOnStep = LocalizableString.IsNullOrEmpty(userTask.InformationOnStep)
                                ? userTask.GetParameterValue("InformationOnStep")?.ToString() ?? string.Empty
                                : userTask.InformationOnStep.Value;
            string allowedActivityResults = ProcessUserTaskUtilities.GetAllowedActivityResults(UserConnection,
                                                                                               userTask.ActivityId);
            Guid parentProcessId = ProcessUserTaskUtilities.GetParentProcessId(userTask.Owner);

            return
                (ServiceStackTextHelper.Serialize(
                     new {
                procElUId = userTask.UId,
                name = userTask.Name,
                processId = parentProcessId,
                isProcessExecutedBySignal = userTask.Owner.IsProcessExecutedBySignal,
                processName = userTask.Owner.Name,
                entitySchemaName = "Activity",
                recommendation = GetActivityTitle(userTask),
                informationOnStep,
                pageTypeId = ActivityConsts.EmailTypeUId,
                activityRecordId = userTask.ActivityId,
                executionContext = userTask.ExecutionContext,
                nextProcElUId = "nextProcElUIdValue",
                allowedResults = allowedActivityResults
            }));
        }
Esempio n. 2
0
        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);
        }
        /// <inheritdoc />
        public override string GetExecutionData()
        {
            CoreEntitySchema entitySchema = UserConnection.EntitySchemaManager.GetInstanceByUId(ObjectSchemaId);
            var defaultColumnValues       = new Dictionary <string, object>();

            foreach (var columnValue in RecordColumnValues.Values)
            {
                var column = entitySchema.GetSchemaColumnByMetaPath(columnValue.Key);
                if ((column.DataValueType is LookupDataValueType || column.DataValueType is MultiLookupDataValueType) &&
                    ((Guid)columnValue.Value).IsEmpty())
                {
                    continue;
                }
                defaultColumnValues[column.Name] = SerializeEntityColumn(column, columnValue.Value);
            }
            var editMode = (RecordEditMode)Enum.ToObject(typeof(RecordEditMode), EditMode);

            if (editMode == RecordEditMode.New)
            {
                EntitySchemaColumnCollection columns = entitySchema.Columns;
                defaultColumnValues["ProcessListeners"] =
                    SerializeEntityColumn(columns.GetByName("ProcessListeners"), (int)EntityChangeType.Inserted);
            }
            string actionName        = GetActionName();
            string informationOnStep = LocalizableString.IsNullOrEmpty(InformationOnStep)
                                ? GetParameterValue("InformationOnStep")?.ToString() ?? string.Empty
                                : InformationOnStep.Value;

            return(SerializeToString(new {
                processId = ProcessUserTaskUtilities.GetParentProcessId(Owner),
                procElUId = UId,
                name = Name,
                isProcessExecutedBySignal = ProcessUserTaskUtilities.GetIsProcessExecutedBySignal(Owner),
                processName = Owner.Name,
                action = actionName,
                entitySchemaName = entitySchema.Name,
                recordId = RecordId,
                activityRecordId = CurrentActivityId,
                recommendation = GetActivityTitle(),
                informationOnStep,
                defaultValues = defaultColumnValues.Count > 0 ? defaultColumnValues : null,
                executionContext = ExecutionContext,
                completeExecution = actionName == "add",
                pageTypeId = PageTypeUId == Guid.Empty ? string.Empty : PageTypeUId.ToString(),
                nextProcElUId = "nextProcElUIdValue"
            }));
        }
Esempio n. 4
0
        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());
        }
        public override string GetExecutionData()
        {
            var element = (IProcessElementMetaInfo)GetSchemaElement();
            var informationOnStepParameter = element.Parameters.GetByName("InformationOnStep");
            var informationOnStep          = GetParameterValue(informationOnStepParameter) ?? string.Empty;

            return(SerializeToString(new {
                procElUId = UId,
                name = Name,
                processId = ProcessUserTaskUtilities.GetParentProcessId(Owner),
                isProcessExecutedBySignal = ProcessUserTaskUtilities.GetIsProcessExecutedBySignal(Owner),
                processName = Owner.Name,
                entitySchemaName = "Activity",
                recommendation = GetActivityTitle(),
                informationOnStep = informationOnStep.ToString(),
                pageTypeId = ActivityConsts.TaskTypeUId,
                activityRecordId = CurrentActivityId,
                executionContext = ExecutionContext,
                nextProcElUId = "nextProcElUIdValue",
                allowedResults = ProcessUserTaskUtilities.GetAllowedActivityResults(UserConnection, CurrentActivityId)
            }));
        }