Exemplo n.º 1
0
        public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance)
        {
            HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto();

            dto.id   = historicVariableInstance.Id;
            dto.name = historicVariableInstance.Name;
            dto.processDefinitionKey = historicVariableInstance.ProcessDefinitionKey;
            dto.processDefinitionId  = historicVariableInstance.ProcessDefinitionId;
            dto.processInstanceId    = historicVariableInstance.ProcessInstanceId;
            dto.executionId          = historicVariableInstance.ExecutionId;
            dto.activityInstanceId   = historicVariableInstance.ActivityInstanceId;
            dto.caseDefinitionKey    = historicVariableInstance.CaseDefinitionKey;
            dto.caseDefinitionId     = historicVariableInstance.CaseDefinitionId;
            dto.caseInstanceId       = historicVariableInstance.CaseInstanceId;
            dto.caseExecutionId      = historicVariableInstance.CaseExecutionId;
            dto.taskId                = historicVariableInstance.TaskId;
            dto.tenantId              = historicVariableInstance.TenantId;
            dto.state                 = historicVariableInstance.State;
            dto.createTime            = historicVariableInstance.CreateTime;
            dto.removalTime           = historicVariableInstance.RemovalTime;
            dto.rootProcessInstanceId = historicVariableInstance.RootProcessInstanceId;

            if (string.ReferenceEquals(historicVariableInstance.ErrorMessage, null))
            {
                VariableValueDto.fromTypedValue(dto, historicVariableInstance.TypedValue);
            }
            else
            {
                dto.errorMessage = historicVariableInstance.ErrorMessage;
                dto.type         = VariableValueDto.toRestApiTypeName(historicVariableInstance.TypeName);
            }

            return(dto);
        }
Exemplo n.º 2
0
        public static VariableInstanceDto fromVariableInstance(VariableInstance variableInstance)
        {
            VariableInstanceDto dto = new VariableInstanceDto();

            dto.id   = variableInstance.Id;
            dto.name = variableInstance.Name;
            dto.processInstanceId = variableInstance.ProcessInstanceId;
            dto.executionId       = variableInstance.ExecutionId;

            dto.caseExecutionId = variableInstance.CaseExecutionId;
            dto.caseInstanceId  = variableInstance.CaseInstanceId;

            dto.taskId             = variableInstance.TaskId;
            dto.activityInstanceId = variableInstance.ActivityInstanceId;

            dto.tenantId = variableInstance.TenantId;

            if (string.ReferenceEquals(variableInstance.ErrorMessage, null))
            {
                VariableValueDto.fromTypedValue(dto, variableInstance.TypedValue);
            }
            else
            {
                dto.errorMessage = variableInstance.ErrorMessage;
                dto.type         = VariableValueDto.toRestApiTypeName(variableInstance.TypeName);
            }

            return(dto);
        }
Exemplo n.º 3
0
        protected internal static void fromHistoricVariableUpdate(HistoricVariableUpdateDto dto, HistoricVariableUpdate historicVariableUpdate)
        {
            dto.revision           = historicVariableUpdate.Revision;
            dto.variableName       = historicVariableUpdate.VariableName;
            dto.variableInstanceId = historicVariableUpdate.VariableInstanceId;

            if (string.ReferenceEquals(historicVariableUpdate.ErrorMessage, null))
            {
                try
                {
                    VariableValueDto variableValueDto = VariableValueDto.fromTypedValue(historicVariableUpdate.TypedValue);
                    dto.value        = variableValueDto.Value;
                    dto.variableType = variableValueDto.Type;
                    dto.valueInfo    = variableValueDto.ValueInfo;
                }
                catch (Exception e)
                {
                    dto.errorMessage = e.Message;
                    dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.TypeName);
                }
            }
            else
            {
                dto.errorMessage = historicVariableUpdate.ErrorMessage;
                dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.TypeName);
            }
        }
Exemplo n.º 4
0
        public static HistoricDecisionOutputInstanceDto fromHistoricDecisionOutputInstance(HistoricDecisionOutputInstance historicDecisionOutputInstance)
        {
            HistoricDecisionOutputInstanceDto dto = new HistoricDecisionOutputInstanceDto();

            dto.id = historicDecisionOutputInstance.Id;
            dto.decisionInstanceId    = historicDecisionOutputInstance.DecisionInstanceId;
            dto.clauseId              = historicDecisionOutputInstance.ClauseId;
            dto.clauseName            = historicDecisionOutputInstance.ClauseName;
            dto.ruleId                = historicDecisionOutputInstance.RuleId;
            dto.ruleOrder             = historicDecisionOutputInstance.RuleOrder;
            dto.variableName          = historicDecisionOutputInstance.VariableName;
            dto.createTime            = historicDecisionOutputInstance.CreateTime;
            dto.removalTime           = historicDecisionOutputInstance.RemovalTime;
            dto.rootProcessInstanceId = historicDecisionOutputInstance.RootProcessInstanceId;

            if (string.ReferenceEquals(historicDecisionOutputInstance.ErrorMessage, null))
            {
                VariableValueDto.fromTypedValue(dto, historicDecisionOutputInstance.TypedValue);
            }
            else
            {
                dto.errorMessage = historicDecisionOutputInstance.ErrorMessage;
                dto.type         = VariableValueDto.toRestApiTypeName(historicDecisionOutputInstance.TypeName);
            }

            return(dto);
        }
Exemplo n.º 5
0
        public static HalVariableValue fromVariableInstance(VariableInstance variableInstance)
        {
            HalVariableValue dto = new HalVariableValue();

            VariableValueDto variableValueDto = VariableValueDto.fromTypedValue(variableInstance.TypedValue);

            dto.name      = variableInstance.Name;
            dto.value     = variableValueDto.Value;
            dto.type      = variableValueDto.Type;
            dto.valueInfo = variableValueDto.ValueInfo;

            return(dto);
        }
Exemplo n.º 6
0
        public virtual VariableValueDto getVariable(string variableName, bool deserializeValue)
        {
            TypedValue value = getTypedValueForVariable(variableName, deserializeValue);

            return(VariableValueDto.fromTypedValue(value));
        }