-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export from DMN to spreadsheet and import from spreadsheet to DMN #1477
Comments
Thanks for reporting. |
I can't believe that 18 months later, Camunda Modeller doesn't have the ability to import/export DMNs from/to common spreadsheet formats, or even just simply a csv straight out of the box. There's even a plugin to get spreadsheet into Modeller but not the other way around. Spreadsheets are what business people understand. Asking them to install a piece of software just so they can look at something that looks and feels like a spreadsheet to them is untenable and is undermining mine, and no doubt others, ability to get DMN into the business, let alone share information with them. It's such a shame that what should have been a relatively simple sell has become such as hassle. |
Thanks four your feedback. A DMN table, while it looks like an Excel spreadsheet, is not a simple spreadsheet after all. It contains numerous meta-data that will be lost once you convert the file to Excel. A roundtrip, i.e. Maybe you could provide an example to elaborate how a usable export would look like? |
@nikku Hi, thanks for responding. I understand the technical complexity, The use case isn't to get a perfect translation from DMN -> spreadsheet -> DMN. That indeed would be difficult to achieve. The use case is about sharing information with business colleagues. They don't care, and probably shouldn't according to "Real Life BPMN", about what is under the covers. Use case 1: Business expressed decision table. Use case 2: It need to share a DMN to a business audience. Does that help to clarify the requirement? Regards p.s. A simple XSLT will convert DMN XML to XLSX (spreadshseet) or CSV format |
Thanks for following up on this @akzincsystems. I think we're getting closer to something tangible here. Given an example decision, i.e. this one and a contained decision table (i.e. ➡️ |
@nikku I took the Dish Decision table Obviously this could also be a simple CSV file that most spreadsheet systems (MS, LibreOffice, Google etc) will simply import. This system won't allow csv files so I haven't attached it. The example has no layout. Addendum: CSV format
|
Thanks for that example output. |
ok. Not pretty, not complete. 1.5hrs of xslt programming dragged up from memory. But it's the POC that it will work. <?xml version="1.0"?>
<xsl:stylesheet
version="2.0"
xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="https://www.omg.org/spec/DMN/20191111/MODEL/">
<!--
Convert DMN XML to CSV format for Spreadsheet ingestion
@author Ashley Kitson
-->
<xsl:output method="text" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<!-- Input parameters -->
<xsl:param name="decisionId" required="yes"/>
<!-- Select the decision table nodes -->
<xsl:template match="/">
<xsl:apply-templates select="definitions/decision"/>
</xsl:template>
<!-- Output for the required decisionId -->
<xsl:template match="definitions/decision">
<xsl:for-each select=".">
<xsl:choose>
<xsl:when test="@id=$decisionId">
<!-- Decision name -->
<xsl:text>Decision,</xsl:text><xsl:value-of select="./attribute::name"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="decisionTable"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- Headings -->
<xsl:template match="decisionTable">
<xsl:value-of select="substring(@hitPolicy, 1, 1)"/><xsl:text>,</xsl:text>
<xsl:for-each select="input">
<xsl:text>Input,</xsl:text>
</xsl:for-each>
<xsl:for-each select="output">
<xsl:text>Output</xsl:text>
<xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:text>Annotations</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>,</xsl:text>
<xsl:for-each select="input/@label">
<xsl:value-of select="."/><xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:for-each select="output/@label">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:text>,</xsl:text>
<xsl:for-each select="input/@label">
<xsl:text>(</xsl:text><xsl:value-of select="./parent::node()/inputExpression/@typeRef"/><xsl:text>),</xsl:text>
</xsl:for-each>
<xsl:for-each select="output/@typeRef">
<xsl:text>(</xsl:text><xsl:value-of select="."/><xsl:text>)</xsl:text>
<xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="rule"/>
</xsl:template>
<!-- Rules -->
<xsl:template match="rule">
<!-- Rule number -->
<xsl:value-of select="position()"/><xsl:text>,</xsl:text>
<!-- Inputs -->
<xsl:for-each select="inputEntry/text">
<xsl:choose>
<xsl:when test="contains(., ',')">
<xsl:value-of select="concat('"', replace(., '"', ''), '"')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="replace(., '"', '')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>,</xsl:text>
</xsl:for-each>
<!-- Outputs -->
<xsl:for-each select="outputEntry/text">
<xsl:choose>
<xsl:when test="contains(., ',')">
<xsl:value-of select="concat('"', replace(., '"', ''), '"')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="replace(., '"', '')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>,</xsl:text>
</xsl:for-each>
<!-- Annotations -->
<xsl:choose>
<xsl:when test="description">
<xsl:value-of select="replace(description, ',', '')"/>
</xsl:when>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>```
And although the output is not a "complete" csv, it will load the result into open office at least. So, tart this up and you have the basis of your exporter. |
Further to the above. If you need to create CSV files for import to a spreadsheet until such time as Modeller gets the functionality, do the following (Linux):
#!/bin/bash
java -cp ~/SaxonHE/saxon-he-10.3.jar net.sf.saxon.Transform "$@"
You should now be able to run something like: |
I am in the same situation as the reporter and just need to share a read-only spreadsheet version of my DMN for documentation purposes, without any implementation/technical details. On a side note, exporting metadata shown in the screenshot of comment #1477 (comment) could be realised rather simple by adding more header lines, one for each metadata info, and (for XSLX) hiding or protecting these columns so business people can not break the DMN, but only edit descriptive content like human-readable input/output names, e.g.:
|
The import side is covered by the plugin and performed by the developer. Camunda's tool for Business-IT collaboration is not the locally installed modeler, but http://cawemo.com. The rules, just imported into DMN or already a refined DMN for production, can be uploaded to Cawemo. If no full roundtrip (information loss in spreadsheet) is intended, but only the new refined version of the DMN table should be shared, then Cawemo does that perfectly well and does not required a locally installed software. So, now that business can look at the latest DMN version without modeler, access DRD, and can even make changes in the Browser (working roundtrip without information loss) , is there still a need to export a DMN back into the less suitable spreadsheet format? |
While I appreciate the free online version, there is still a need for a private locally installed version for a lot of use cases, e.g. business confidential information that we are not allowed to share in an external cloud service, for example in banks or other financial instituations, which are audited in our case by the Austrian financial controlling authority. |
For completeness: Cawemo Enterprise is available aaS on a dedicated environment. Installation on premises / own infrastructure is also supported. |
this would of course mean leaving the open source version, but I understand the reasoning:) |
I believe that this |
This popped up in support. I linked relevant support case in issue description
Is your feature request related to a problem? Please describe.
Our customers have clients that dont have the modeller and are not allowed to install it on their computer, but they also need to take part in developing the DMN.
Also to keep it less "technical" for clients. They are used to Excel, but not to DMN or XML.
Describe the solution you'd like
I would be nice to have a button in Modeler that allows to export DMN table to spreadsheet.
Additionally it would be nice to import data from spreadsheets into Modeler.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
I know that there is a similar issue which should enable copy and paste from and into DMN.
Related to SUPPORT-6243
Related to #1341
The text was updated successfully, but these errors were encountered: