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); }
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); }
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); } }
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); }
protected internal virtual void verifyStringValue(IDictionary <string, object> stringValue) { StringValue exampleValue = MockProvider.EXAMPLE_HISTORIC_DECISION_STRING_VALUE; assertThat(stringValue, hasEntry("type", (object)VariableValueDto.toRestApiTypeName(exampleValue.Type.Name))); assertThat(stringValue, hasEntry("value", (object)exampleValue.Value)); assertThat(stringValue, hasEntry("valueInfo", (object)Collections.emptyMap())); }
protected internal virtual void verifyByteArrayValue(IDictionary <string, object> byteArrayValue) { BytesValue exampleValue = MockProvider.EXAMPLE_HISTORIC_DECISION_BYTE_ARRAY_VALUE; assertThat(byteArrayValue, hasEntry("type", (object)VariableValueDto.toRestApiTypeName(exampleValue.Type.Name))); string byteString = Base64.encodeBase64String(exampleValue.Value).Trim(); assertThat(byteArrayValue, hasEntry("value", (object)byteString)); assertThat(byteArrayValue, hasEntry("valueInfo", (object)Collections.emptyMap())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") protected void verifySerializedValue(java.util.Map<String, Object> serializedValue) protected internal virtual void verifySerializedValue(IDictionary <string, object> serializedValue) { ObjectValue exampleValue = MockProvider.EXAMPLE_HISTORIC_DECISION_SERIALIZED_VALUE; assertThat(serializedValue, hasEntry("type", (object)VariableValueDto.toRestApiTypeName(exampleValue.Type.Name))); assertThat(serializedValue, hasEntry("value", exampleValue.Value)); IDictionary <string, string> valueInfo = (IDictionary <string, string>)serializedValue["valueInfo"]; assertThat(valueInfo, hasEntry("serializationDataFormat", exampleValue.SerializationDataFormat)); assertThat(valueInfo, hasEntry("objectTypeName", exampleValue.ObjectTypeName)); }