I have a specification with several templates in it. Each template exports a different predefined view from the same module. What I would like to know is if there is a way to set it up where if the view a template is seeking does not exist in the module, that template does not publish any data to the output document.
Is this possible?
Pinned topic Possible to only publish data if a particular DOORS view exists?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-12-09T20:02:14Z at 2012-12-09T20:02:14Z by kbmurphy
ChrisHardy68 270001C1X686 Posts
Re: Possible to only publish data if a particular DOORS view exists?2012-11-29T22:28:18ZThis is the accepted answer. This is the accepted answer.Hi
I though that is a view specified in the spec did not exist, then the template uses the standard view i think
If this is not the case then i would try the following:
in the data source, there is a entry for
So at eh top of you template create a container the queries this value. If its set to the name of the view you are expecting then continue, otherwise do nothing
Think that should work although i havent tried it
kbmurphy 270001QKQK97 Posts
Re: Possible to only publish data if a particular DOORS view exists?2012-11-29T23:58:22ZThis is the accepted answer. This is the accepted answer.
- ChrisHardy68 270001C1X6
The name of the view is provided by the .dsx file (though in this case it sounds as if it's hardcoded into the template itself). RPE will report on that view name no matter what, whether the standard view or the actual view is used--it will always report out the name as the view name it was given, not what was actually used.
One of my clients had a document go out that was marked with a view called "External" but it had internal items on it precisely because of this problem. The document said the view used was the "External" view but there was a small, hard to detect typo, and the document contained the standard view instead.
I immediately contacted IBM and entered an SR and escalated it as well. IBM is aware of this issue and apparently it would involve changing one of the fundamental aspects of the RPE DOORS driver and so changing it apparently isn't such a simple matter.
Re: Possible to only publish data if a particular DOORS view exists?2012-11-30T06:26:35ZThis is the accepted answer. This is the accepted answer.
- kbmurphy 270001QKQK
To try to distill my question a bit... do you guys think it's possible to only publish a view if it exists? Another way to state the question is, is there a way to programmatically detect that the Standard View is being exported?
ChrisHardy68 270001C1X686 Posts
Re: Possible to only publish data if a particular DOORS view exists?2012-12-04T00:52:42ZThis is the accepted answer. This is the accepted answer.Hi Guys,
Kevin, thanks for the info - it made me sad especially since the console window reports back that it cant find the named view so its going to use "Standard View" instead.
Still puzzled about the implementation of named view to data source, rather than data source being a module, with the view selectable as an attribute in the template, but that another discussion.
Bob, I have another idea, which is clunky but may work around the issue.
When you define the view that you want (lets call this view "MyView"), name one of the columns in this view in a specific way.
For example if you use the ID Column call it "#ID#"
So in any module which has the view "MyView" there will be a column named "#ID#, which is part of that view.
At the top of the template inside a containers for the whole module, set up a series of contains that for the view search for a column called "#ID#". If a column with this name is found, set an internal variable to "True".
You can then use this variable as a check to see if you want to print the contents of the module out or not.
You may want to do a clean up of the column header to turn it back from "#ID#" to say "ID" in the printed doc but that should be fairly straight forward.
Not the nicest fix in the world but it should get you to where you need to be.
Does that help?
Dragos.Cojocari 270001QUCG1622 Posts
Re: Possible to only publish data if a particular DOORS view exists?2012-12-04T15:55:02ZThis is the accepted answer. This is the accepted answer.Hey all,
the cleanest solution would be for RPE to report both the name of the view specified by the user and the one that is actually used. Please create an RFE for this.
As a workaround for this, in addition to the ones already suggested, you can use the following UNDOCUMENTED and UNSUPPORTED feature of RPE. No support is provided for using it or issues caused by its usage.
The solution consists in adding a special attribute in the DOORS schema which gets translated by RPE into Layout DXL at runtime. This attribute gives the name of the current view. This is not extremely efficient since the view name is going to be exported for each object in the module and and this results in more memory being used and more time need for docgen.
The implementation of this requires changes to the schema and this can result in damaging the report templates. Make sure you create backup copies of your templates before trying this.
What to do:
1. backup your template
2. open your template and select "Edit in schema editor" for your DOORS data source.
3. go to the "DOORSAttribute" type and append this at the end of the attribute list.
<attribute name= "currentView" type= "string"> <annotation> <appinfo source= "#Description"> <label>Current View</label> <elevation elem_query= "dxl" elem_value= "_value"> <clause attribute= "name">currentView</clause> <clause attribute= "dxlcode">displayRich( currentView( current Module))</clause> </elevation> </appinfo> </annotation> </attribute>
4. save the schema and then the template
Alternatively you can use the DOORS schema attached to this post. This is the modified DOORS schema that ships with RPE 220.127.116.11.
What the above does is to create a DXL Column in the temporary view that RPE creates when exporting data from DOORS. This is why the displayRich is required. The annotation and clauses are just the way of telling RPE that it has to do that. The dxlcode clause can contain any valid DXL code that creates layout DXL as long as its valid XML (if it contains < or & those characters need to be escaped).
Once again note this is an UNDOCUMENTED and UNSUPPORTED feature of RPE. No support is provided for using it or issues caused by its usage.
Re: Possible to only publish data if a particular DOORS view exists?2012-12-04T21:06:44ZThis is the accepted answer. This is the accepted answer.
- Dragos.Cojocari 270001QUCG
An approach I developed to solving the problem was to have a preliminary query at the beginning of the template that queried the DOORS "Module/View." I applied a data assignment to store the name of the current view into an RPE variable ViewName. Then I placed a condition on the entire remainder of the template where it only publishes if the value of ViewName is equal to a certain view name. If not, nothing publishes and RPE moves on to the next template!
RPE is great because there are usually several ways to solve a problem!
Thanks again everyone.
kbmurphy 270001QKQK97 Posts
Re: Possible to only publish data if a particular DOORS view exists?2012-12-09T20:02:14ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK