Get diagram picture in DNG into RPE report
Accepted answer
With DNG 6.0.4 onwards, DNG diagram artifacts can be rendered directly. You should use the text schema and print the rich text body (dataSource/artifact/content/text/richTextBody/div) just like you do for other text artifacts.
Note: There is no separate "diagram" artifact format supported by DNG REST API. While designing RPE template, consider diagram artifact as "text" artifact.
5 other answers
Which version of DNG are you using? Can you specify the Artifact type and Artifact format selected while creating artifact in DNG?
If it is the new "Diagram" Artifact format, it is not a supported artifact format in DNG Reportable REST API. Unlike wrappedResourceImageURI for WrapperResources, we cannot get diagram URI for diagrams. To print the diagram, you can Insert the Diagram artifact into a Text artifact and then GET the Text artifact (https://server:port/rm/publish/text?resourceURI=UUID&maximiseEmbeds=true).
If it is a Graphical Artifact (ex. Business Process Diagram), you can derive the imageURL as in the attached sample template. For other graphical artifacts (ex. UCD), you can use dataSource/artifact/content/usecasediagram/rendering as Image content.
Comments
We are using 6.0.2 iFix006 and yes, it is the artifact format "diagram" that is fairly new. This being not available via the reportable REST API is really bad, I think it should be.
Could you please detail your idea to insert the diagram artifact into a text artifact? This would have to be done manually, right? So it would just mean to insert the artifact into a text artifact as it would be done e.g. for pictures, right?
Thanks in advance!
Right. So you have only two options:
1) Include the diagram in a module then create a report for the module view. (Limitation is that view schema is not public, so this cannot be used on for custom RPE template).
2) Insert/embed the Diagram artifact into a text artifact then print the text artifact. (This option can be used for custom RPE template as well).
Thanks for your answer. Could you please elaborate your suggestion #1? Our diagrams are included in modules, but I was not able to get them printed
Thank you!
Did you guys figure out how to print graphical artifact in the module in a custom RPE Template?
If you are generating document through RPE (custom report), the work around is to embed the diagram artifact into a text artifact then print the text artifact. Note that you need to append maximiseEmbeds=true to the data source URL. If you are generating report through DNG, include the diagrams in a module then create a report for the module view.
No. There is an Enhancement created (Add Diagram artifact format to the RDNG Reportable REST API), which is under consideration.
Given that there are only a few artifact formats in DNG 6.0.3, like Module, Text, or Diagram; any artifact of format "Diagram" is unable to be directly published by RPE? Do I understand this correctly?
Comments
There are several supported artifact formats including uisketches, usecasediagrams, etc. You can refer https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI
Only diagram artifact type that is newly added in DNG 6.0.x is currently not supported.
Also, as already mentioned you can publish all the diagrams within the module if you are generating the document through DNG itself (since it uses view schema).
-
add a container with condition
- format == "Diagram"
- Data source of _text from dataSource/artifact/moduleContext/contextBinding
-
another container with _text of dataSource/artifact (source $48)
- paragraph with Text of "Figure:", Figure Caption, Text of dataSource/artifact/title (source $48)