Salesforce converter drops OSI metrics during export

Open
#399 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
backend, tooling

Research direction

Start in converters/salesforce/src/main/java/org/apache/ossie/converter/MetricMappingHandler.java, where the forward path skips metric mapping, and review the README limitation alongside #222 and discussion #28. Done means supported OSI metrics become semanticCalculatedMeasurements with resolved references, while unsupported metrics produce actionable errors and tests verify preservation beyond schema validation.

Written by the indexing model from the issue text.

Description

i reproduced this on main at 1f367e35.

When exporting an OSI model to Salesforce using toSF, the converter generates objects and fields but skips the entire metrics[] section. It exits successfully without producing semanticCalculatedMeasurements.

This affects anyone relying on OSI metric definitions to create Salesforce semantic models, regardless of the source platform.

Example

A model declares a numeric orders.amount field and this metric:

metrics:
  - name: total_sales
    expression:
      dialects:
        - dialect: TABLEAU
          expression: SUM([orders].[amount])

The numeric field is exported, but total_sales is missing from the output. Using a TABLEAU expression does not resolve the issue.

The forward path in MetricMappingHandler explicitly skips metric mapping. The README documents this limitation, but successful conversion can still leave downstream automation with an incomplete model.

Proposed behavior

  • Export supported OSI metrics as semanticCalculatedMeasurements, preserving names, descriptions, expressions and types.
  • Resolve expressions against the model’s semantic fields.
  • Fail with an actionable error when a metric cannot be converted, rather than silently omitting it.
  • Add tests that verify metric preservation and resolved references, beyond JSON-schema validation.

Expression handling should align with the existing work in #222 and discussion #28.

Is anyone already working on this? i’d like to align on the scope before contributing an implementation.

Dominant language
Python
Stars
2.2k
Forks
280
Avg merge
2d 7h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/ossie

All issues in apache/ossie

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.