| 398 | } |
| 399 | |
| 400 | std::vector<Attribute> WorkflowStepResult_Impl::attributes() const { |
| 401 | LOG(Debug, "WorkflowStepResult::attributes is deprecated, use stepValues instead"); |
| 402 | std::vector<Attribute> result; |
| 403 | for (const auto& stepValue : stepValues()) { |
| 404 | boost::optional<Attribute> attribute; |
| 405 | |
| 406 | const VariantType variantType = stepValue.variantType(); |
| 407 | switch (variantType.value()) { |
| 408 | case VariantType::Boolean: |
| 409 | attribute = Attribute(stepValue.name(), stepValue.valueAsBoolean()); |
| 410 | break; |
| 411 | case VariantType::Double: |
| 412 | attribute = Attribute(stepValue.name(), stepValue.valueAsDouble()); |
| 413 | break; |
| 414 | case VariantType::Integer: |
| 415 | attribute = Attribute(stepValue.name(), stepValue.valueAsInteger()); |
| 416 | break; |
| 417 | case VariantType::String: |
| 418 | attribute = Attribute(stepValue.name(), stepValue.valueAsString()); |
| 419 | break; |
| 420 | default: |
| 421 | LOG(Warn, "Unknown Variant Type " << variantType.valueName()); |
| 422 | } |
| 423 | |
| 424 | if (attribute) { |
| 425 | attribute->setDisplayName(stepValue.displayName()); |
| 426 | if (stepValue.units()) { |
| 427 | attribute->setUnits(stepValue.units().get()); |
| 428 | } |
| 429 | result.push_back(*attribute); |
| 430 | } |
| 431 | } |
| 432 | return result; |
| 433 | } |
| 434 | |
| 435 | void WorkflowStepResult_Impl::setStartedAt(const DateTime& dateTime) { |
| 436 | m_startedAt = dateTime; |
nothing calls this directly
no test coverage detected