Custom report

Hi,

I’m struggling with a report for a while now.
Based on the reports delivered with the ‘Report Writer’ and a custom one I found on this forum I’m trying to create the following structure from the project root (“VPProject”):

1.0.0.0.0) Title: classes
1.1.0.0.0) List: Sub-Title: Class diagram name 1
1.1.1.0.0) Image: class diagram
1.1.2.0.0) Documentation of diagram
1.1.3.0.0) List: Sub-Sub-Title: class names from the diagram (also from dependant projects)
1.1.3.1.0) Documentation, Stereotypes and Tagged Values of Class
1.1.3.2.0) List: Sub-Sub-Sub-Title: attribute names
1.1.3.2.1) Table of:
1.1.3.2.2) Documentation, Type, Default value, Stereotypes and Tagged Values of Attribute

Somehow, it is not possible to display the attribute details.
One of my many attempts:


<?xml version="1.0" encoding="UTF-8"?>
<Template>
	<TemplateInformationHeader name="5.1 Class Diagrams" description="/" type="table" default="true"/>
	<ProjectBaseInitiationBlock>
		
		<ParagraphBreak/>
		
		<HasDiagramChecker type="ClassDiagram">
			<ForEachDiagram diagramType="ClassDiagram">
				<StringPropertyText propertyText="name" style="Heading 2"/>
				<ParagraphBreak/>
				
				<StaticText content="" style="Default"/>
				<ElementImage imageType="diagram" alignment="center"/>
				
				<ParagraphBreak/>
				<HasChildElementChecker flag = "true">
					
					<IterationBlock modelType="Class" allLevel="true">
					<!-- class -->
					<!-- class's name -->
					<StaticText content="Class : " style="Heading 3"/>
					<StringPropertyText propertyText="name" style="Heading 3"/>
					<ParagraphBreak/>

					<!-- class's documentation -->
					<ValueConditionChecker property="documentation" operator="not equals" value="">
						<StaticText content="Description: " style="Default"/>
						<ParagraphBreak/>
						<StringPropertyText propertyText="documentation" style="Default"/>
						<ParagraphBreak/>
					</ValueConditionChecker>
					
					<!-- class's stereotypes -->
					<HasMetaModelPropertyChecker property="stereotypes" flag="true">
						<StaticText content="Stereotypes: " style="Default"/>
						<ForEach property="stereotypes" ignoreParagraphBreakForLastModel="true">
							<!-- <StaticText content="- " style="Default"/> -->
							<StaticText content="' " style="Default"/>
							<StringPropertyText propertyText="name" style="Default"/>
							<StaticText content=" ', " style="Default"/>
							<!-- <StaticText content="\n" style="Default"/>-->
						</ForEach>
						<StaticText content="' " style="Default"/>
						<ParagraphBreak/>
					</HasMetaModelPropertyChecker>
					
					<HasChildElementChecker flag = "true">
						<TableBlock colWidths = "5000,5000" tableWidth = "14500" alignment = "right">
							<TableRow>
								<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
									<StaticText content = "Name" style = "Column header 1"/>
								</TableCell>
								<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
									<StaticText content = "Type" style = "Column header 1"/>
								</TableCell>
							</TableRow>
							<IterationBlock>
								<TableRow>
									<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
										<StringPropertyText propertyText = "name" style = "Table Contents"/>
									</TableCell>
									<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
										<StringPropertyText propertyText = "modelType" style = "Table Contents"/>
									</TableCell>
								</TableRow>
							</IterationBlock>
						</TableBlock>
					</HasChildElementChecker>
		
		
					<TableBlock colWidths = "4000,2500,10000," tableWidth = "16000" alignment = "right">
						<TableRow>
							<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
								<StaticText content = "Name" style = "Column header 1"/>
							</TableCell>
							<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
								<StaticText content = "Type" style = "Column header 1"/>
							</TableCell>
							<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
								<StaticText content = "Info" style = "Column header 1"/>
							</TableCell>
						</TableRow>
						<IterationBlock>
							<TableRow>
								<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
									<StringPropertyText propertyText = "name" style = "Table Contents"/>
								</TableCell>
								<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
									<StringPropertyText propertyText = "modelType" style = "Table Contents"/>
								</TableCell>
								<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
									<StringPropertyText propertyText = "documentation" style = "Table Contents"/>
								</TableCell>
							</TableRow>
						</IterationBlock>
					</TableBlock>
					
					
					<!-- attributes of class -->
					<HasChildElementChecker modelType="Attribute" flag="true">
						<ParagraphBreak/>
						
						<IterationBlock modelType="Attribute">
							<!-- attribute -->
							<!-- attribute's name -->
							<StaticText content="- " isBold="true"/>
							<StringPropertyText propertyText="name" style="Default"/>
							<ParagraphBreak/>
							
							<!-- attribute's type -->
							<ValueConditionChecker property="type" operator="not equals" value="">
								<StaticText content="Type: " style="Default"/>
								<StringPropertyText propertyText="type" style="Default"/>
								<ParagraphBreak/>
							</ValueConditionChecker>
							
							<!-- attribute's documentation -->
							<ValueConditionChecker property="documentation" operator="not equals" value="">
								<StaticText content="Documentation: " style="Default"/>
								<ParagraphBreak/>
								<StringPropertyText propertyText="documentation" style="Default"/>
								<ParagraphBreak/>
							</ValueConditionChecker>
							
							<!-- attribute's multiplicity -->
							<DefaultConditionChecker property="multiplicity" flag="false">
								<StaticText content="Multiplicity: " style="Default"/>
								<StringPropertyText propertyText="multiplicity" style="Default"/>
								<ParagraphBreak/>
							</DefaultConditionChecker>
							
						</IterationBlock>
					</HasChildElementChecker>

					</IterationBlock>
					
				</HasChildElementChecker>
				<ParagraphBreak/>
				
			</ForEachDiagram>
		</HasDiagramChecker>
		
		<StaticText content="" style="Default"/>
	</ProjectBaseInitiationBlock>
</Template>

Best regards,
Marqui

Hi Marqui,

Thanks for your post and details. I’ve forwarded the issue to our engineers to follow-up, and I’ll come back to you once there is any feedback.

Best regards,
Lilian Wong

HI Marqui,

The problem is that your template is working on Shape of class but not Model of the class. Therefore, getting children from Shape will not have any Attribute.

To fix it, please refer to the attached image.
The template is getting class diagrams from project, and then get classes from the diagrams. At this step, the classes are “shape” but not “model”. You can use to make sure the class is “model”, not “shape”.

Hope this helps. Please feel free to contact me if there is anything I can do to help.

Best regards,
Lilian Wong


edit_template.png

Hello Marqui, hello LilianWong,

as I’m currently working on a customization for the Report Writer i’m wondering whether there is any documentation of the Report Writer’s XML-dialect, or any DTDs, schemata and where i could find it.

Thanks in advance,
-cbarth

Hi Cbarth,

Thanks for your inquiry. I’m sorry that there is no documentation of Report Writer’s XML-dialect, please refer to default templates in VPSuite/resources/Report/Default folder. If you want to have some specific output but don;t know how to customize the template to get it, please feel free to post your requirements (appreciate if with sample as well) and I’ll ask our engineer to prepare a sample template for your.

Best regards,
Lilian Wong

<?xml version="1.0" encoding="UTF-8"?>
                                        <PageBreak/>
                                        
                                        <!--PRINTDOCUMENT HISTORY--> 
                                      <Include template="History.xml"/>
                                      
                                      <StringPropertyText propertyText="documentation" style="Default"/>

                       <!--PRINT BPM--> 
  <ParagraphBreak/>
                                        <PageBreak/>
		<ValueConditionChecker property="diagramType" propertyType="string" operator="EQUALS" 
                                            value="BusinessProcessDiagram">
		<StaticText content="BPM" />
		 </ValueConditionChecker>
	</DiagramProperty>
</IterationBlock>
	<DiagramProperty property="diagramId">      
		
		<StringPropertyText propertyText="diagramType"/>           
		<StringPropertyText propertyText="name"/>   
	
	</DiagramProperty>

============================================
QUESTIONS

  • why is the iteration block needed?

  • I cannot get the ValueConditionChecker property to work

-I cannot get the diagramchecker to work.
I do not even get it to print
I tried with and without optional attribute (diagramType and type)

-What is the difference between for Each and iterator

GOAL is that I make a “basic diagram” per report I want.
The user can drop and drag “overview diagrams” on that report diagram

He can drag and drop multiple BPM and Use case models.

I want the report to print 1 BPM first
Then I need to search the UC models and see if one of the use cases has a link witht the BPM (“transit to or from” attribute)
Only then I want to print the UC diagram and description.

So in general I want to run through a list of diagrams of type “overview”.
I want to open the overview diagram and look into the object what type this diagram is.

If diagram is BPM I want to print.
If diagram is usecase I first want to check all elements and look for links with BPM.

So a basic way to loop through a list of diagrams and do some logic testings.

If you have any documentation please share.
I use http://www.visual-paradigm.com/support/documents/vpumluserguide/304/399/24043_customizingr.html

Is there a way to look at the code that is processing the XML tags? That would reduce the trial and error in customizing repots.

Hi user,

Q: why is the iteration block needed?

A:
is used to get a list of “children” from a “parent” model element. The “parent” can be Project/Diagram/Shape/Model.

In your template, line 35-48, it checks “” first, then to get children. Are you asking what does " + " mean?

You may need this combination if you want to print some title before getting the children
e.g.



… print the details of the classes.


so, no Title will be print if no “Class” in Diagram

HOWEVER. In the attached template, both and are WRONG.
Because inside the , it is trying to get the properties of the diagram. It is not getting children of the diagram.
Therefore, you should remove both ,

Q: I cannot get the ValueConditionChecker property to work
A:
Currently, ValueConditionChecker is only supported for Model, not for Diagram. We will support it soon.

Q: I cannot get the diagramchecker to work. I do not even get it to print I tried with and without optional attribute (diagramType and type)

A:
First, You need to know the base object that your template need to work on
Read line 3:
You are working on a diagram.
(This template should be placed on a diagram’s folder, e.g. {VPSuite_installation_dir}/resources/Report/Default/BusinessProcessDiagram folder)

So on line 50, there is , which is WRONG.
is based on a Project, to check whether the project has the diagram.
But you are working (based) on a Diagram, so, it does not work.

Q: What is the difference between for Each and iterator

can be used to get values from Model’s property
can be used to get children from parent. (as Question 1’s answer)

Sorry but we do not understand your goal. What do you mean by “basic diagram”, and “drag and drop multi BPM and use case models”? Please clarify.

Best regards,
Jick

Correction of the code, forgot an end tag.

However this still does not work.
I understand that there is no support for checking on diagramTypes at all?
Do you have any Idea when this will be supported?


<?xml version="1.0" encoding="UTF-8"?>
<Template>
	<TemplateInformationHeader name="Custom report JKS" description="/" type="text" default="false"/>
	
<DiagramBaseInitiationBlock>
                                             
                                          

<StaticText content="Business Process" style="Heading 1 (VP)"/>
<ParagraphBreak/>


<IterationBlock diagramType="BusinessProcessDiagram'">
		<!-- Here I want to open the child element print its name and the diagram-->
		<DiagramProperty property="diagramId">      
		<StringPropertyText propertyText="name"/>   
		<ElementImage imageType = "diagram" alignment = "center"/>
	
		</DiagramProperty>

</IterationBlock>



</DiagramBaseInitiationBlock>
</Template>

Hi JoachimKnoops,

In your template you started with a DiagramBaseInitiationBlock, which means that your template is designed for diagram. But in line 13, you try to iterate for something whose diagramType is business process diagram, which is wrong.

Let’s say if you are going to apply this template on business process diagram, what line 13 means is to loop everything in the diagram whose diagramType is business process diagram, which is wrong. If you want to loop the shapes, you should use shapeType.

We are also unclear what you want to in line 15, 16 and 17. DiagramProperty contains StringPropertyText is not supported.

Best regards,
Jick

Hi,

thanks for follow up

First take a look at the screenshots in WORD how I construct my basic diagram

Then take a look at the exported XML from that diagram

THIS IS A SNIPPET OF THE EXPORTED XML


<Project author="jks" company="FOD" description="<html>
  <head>
    <style type="text/css">
      <!--
        body { color: #000000; font-family: Courier New; font-size: 11px }
      -->
    </style>
    
  </head>
  <body>
    <p>
      This is a project to test the customizations to the report writer
    </p>
  </body>
</html>
" documentationType="html" exportedFromDifferentName="false" exporterVersion="7.0.0" name="TEST XML" textualAnalysisHighlightCaseSensitive="false" umlVersion="2.x">

<ProjectInfo>
  <LogicalView/>
</ProjectInfo>
<Models>


<!-- HERE I SHOW 1 MODEL ELEMENT THAT WAS GENERATED FOR THE Business process that is on the basic diagram-->
   <Model composite="false" considerDefaultProperties="false" displayModelType="Diagram Overview" id="_Ko04uSFYECOqRQc" modelType="DiagramOverview" name="Configure Special Effects Concert">
         
          <ModelProperties>
		<StringProperty displayName="Name" name="name" value="Configure Special Effects Concert"/>
		<StringProperty displayName="Model Type" name="modelType" value="DiagramOverview"/>
		<ModelsProperty displayName="Comments" name="comments"/>
		<HTMLProperty displayName="Documentation" name="documentation" plainTextValue=""/>
		<ModelsProperty displayName="Voices" name="voices"/>
		<ModelsProperty displayName="References" name="references"/>
		<StringProperty displayName="Transit From" name="transitFrom"/>
		<StringProperty displayName="Transit To" name="transitTo"/>
		<ModelRefProperty displayName="Pm Status" name="pmStatus"/>
		<ModelRefProperty displayName="Pm Difficulty" name="pmDifficulty"/>
		<ModelRefProperty displayName="Pm Priority" name="pmPriority"/>
		<ModelRefProperty displayName="Pm Version" name="pmVersion"/>
		<ModelRefProperty displayName="Pm Iteration" name="pmIteration"/>
		<ModelRefProperty displayName="Pm Phase" name="pmPhase"/>
		<ModelRefProperty displayName="Pm Discipline" name="pmDiscipline"/>
		<StringProperty displayName="Pm Author" name="pmAuthor" value="jks"/>
		<StringProperty displayName="Pm Create Date Time" name="pmCreateDateTime" value="1268209440063"/>
		<StringProperty displayName="Pm Last Modified" name="pmLastModified" value="1268209871752"/>
		<DiagramRefProperty displayName="Diagram Id" name="diagramId">
	               <DiagramRef diagramType="BusinessProcessDiagram" id="OrFskOSFYECOqSmV" name="Configure Special Effects Concert"/>
		</DiagramRefProperty>
	</ModelProperties>
</Model>
</Models>
 

So here I give another try to be able to look through the elements of diagramoverview and only “open” the diagram of type businessprocessdiagram to print the diagram picture and documentation


  <DiagramBaseInitiationBlock>
    <HasChildElementChecker modeltype="DiagramOverview">
      <IterationBlock>
 
<!-- WHAT DO I DO WHEN I EXECUTE THE NEXT LINE? Will I open something that corresponds with the XML that I would have if I exported the BPM diagram itself? If I leave these DiagramPropertyTag off it will just print the blue pictures that are on my Basic Diagrmam of type overview. However now because I typed DiagramProperty propertye="diagramId" I get the original picture linked to the BP diagram and the correct documentation.    But I cannot find back where I am now, how does the XML structure look that I am working on? -->     

        <DiagramProperty property="diagramId">

<!--  Now offcourse he is printing all off the overview diagrams: Also use case and class.  However I want to be able to write different report logic for different diagram types. Eg BP diagram we use documentation, for use case I want the description, for class nothing  more than the diagram. But I cannot filter on it. Offcourse I also do not know what XML I am working on-->

      <ValueConditionChecker property="diagramType" propertyType="string" operator="EQUALS" value="BusinessProcessDiagram">    
        
          <ParagraphBreak/>
          <StringPropertyText propertyText="name" style="Heading 2 (VP)"/>
          <ParagraphBreak/>
          <StaticText content=" " style="Text body"/>
          <ElementImage imageType = "diagram" alignment = "center"/>
          <ParagraphBreak/>
          <StringPropertyText propertyText="documentation" style="Default"/>
          </ValueConditionChecker>
        </DiagramProperty>
      </IterationBlock>
    </HasChildElementChecker>
  </DiagramBaseInitiationBlock>

 

=> I think I need to understand how I can code in my reportXML that he has to open the XML of the diagram I will be able to check on the diagramType

=> the solution below was a try by running through the diagrams of the generated XML for the basic diagram. However this does not work either.

Our goal is offcourse to centralize the logic of how a report should look so that the people only need to to drag and drop there diagrams (BP, use case, class) on a basic diagram. If they then generate a report for that basic diagram the output will be a desired.

I really hope there will be invested in proper documentation and a good aid to make really custom reports.

Thanks in advance

Joachim
SO I make a diagram of type Basic diagram.doc
project.xml

Hi Joachim,

Thanks for replying. We’ll prepare a sample template for your reference of how to generate details of associated business process diagram (BPD) of a diagram overview and documentation of the BPD.

Best regards,
Lilian Wong

Hi Joachim,

Attached you can find a sample template for generate associated diagram details of DiagramOverview, and please place it in VPSuite/resources/Report/Default/BasicDiagram directory. I also attached an image of what you should get with the sample template.

And please allow me to explain more details so you can get more ideas of how to customize the templates of Report Writer:
1. Usage of <DiagramProperty …>
It is used to get the “diagram” from the current object property.

i) On your template, it is based (working) on a BasicDiagram. First of all, you use <IterationBlock …> to get the children from the BasicDiagram.
ii) In the VP project (.vpp), the children are DiagramOverview’s Shape, and you have “changed” to work on the children within …. After that, you use <DiagramProperty property=“diagramId”…> to get the diagram from DiagramOverview (the diagram is referenced by DiagramOverview).
iii) In the VP project, the DiagramOverview(s) refer to BPD, UseCasediagram, etc… Inside the …, you “changed” to work in the diagram (BPD, UseCaseDiagram, etc…).
iv) Then, you use to generate the diagram’s image.
PS: If there is no “<DiagramProperty …>”, the template is still working the children (DiagramOverview’s shape). Use will generate the Diagramoverview’s shape’s image.

2. Problems on your template
i) …
It should be modelType instead of modeltype.

ii)
You should add modelType=“DiagramOverview” (i.e. <IterationBlock modelType=“DiagramOverview”) since you need to show DiagramOverview only.

iii) <ValueConditionChecker property=“diagramType” …>
The property of diagram type is “type”, so it should be <ValueConditionChecker property=“type” …>

We hope the information is helpful and easy to understand. Please feel free to ask if there is any question.

Best regards,
Lilian Wong
Overviews.xml


results_with_template.png

Thanks alot.

Works fine!

Now what I would like to know more about is what I can do on the object "diagram"
What is my best way to guess this?
Exporting XML or looking in the application.
The exported XML don’t really give a good representation of this object structure.
Is it possible to give an overview of XML and object that run behind this.

It is a very strong tool to make your own reports.
However it is really time consuming and a lot of trial and error. This makes VP not really to a suitable candidate to work with.
Is there any idea when more documentation will be available?

Another question: is it only possible to split cells and not to merge them. I have a table of 3 columns and somtimes I want to make 1 row spanning the 3 columns.

Thanks again

Joachim

Hi again,

2 other requirements where I can use your help.
How can I avoid printing use case descriptions twice? Ideally it woul be represented by a link (cross-reference)

Another requirement would be the sorting of the printing based on the position on the diagram.

I.e sorting my overview diagrams

  • first the once on top, then the ones on the bottom
    eg imageHeight= “166” first
    eg imageHeight= “55” second

This to give controll about the user to controll the order of diagrams.

Also for the print order of use cases in the use case diagram this would be usefull. (See attachment)
Off course here I would like to print in the logical order of the application flow

  • UC 001
  • UC 002
  • UC 003
  • UC 004
  • reference to UC 003
  • UC 005

Is this possible? Some help would be greatly appreciated

Thanks in advance

TEST1.jpg

Hi Joachimm,

Thanks for your post. For your questions:

Now what I would like to know more about is what I can do on the object “diagram”
What is my best way to guess this?

From the folder names in VPSuite/resources/Report/Default/ directory, you will know the diagram types for customizing the Report Writer template. You can also refer to the XML files inside the folders for how to customize the templates.

Another question: is it only possible to split cells and not to merge them. I have a table of 3 columns and somtimes I want to make 1 row spanning the 3 columns.

I’m sorry that this is not supported at the moment, but I’ve fired a feature request to our engineers to study. I’ll let you know once there is any news on this issue.

How can I avoid printing use case descriptions twice? Ideally it woul be represented by a link (cross-reference)

May I know what do you mean by printing use case descriptions twice? Also, would you mind to attach the template you are using (or send to lilian.wong@visual-paradigm.com ) so we can take a look?

Another requirement would be the sorting of the printing based on the position on the diagram…Also for the print order of use cases in the use case diagram this would be usefull.

If you use to retrieve children on the diagram, you can sort the children by name, modelType and property. For example:

Do you think this would help you to sort the models?

Best regards,
Lilian Wong

Hi Joachimm,

Thanks for sending your templates and details to my email address so I can follow-up the generating use case description twice problem. Your problem has been forward to our Online Ticket System, so let’s keep this issue in the ticket system (ticket ID: VAE-425169).

I will reply you shortly in ticket system and you should receive my email very soon. You can respond by logging into our ticket system ( https://support.visual-paradigm.com/ ) or by replying that E-mail. If you do not receive one, it is possible that the security settings of your E-mail program are preventing our E-mail from being delivered to you. Please find it from the junk or trash folders.

Best regards,
Lilian Wong

Hi Joachimm,

I would like to let you know that we enhanced Report Writer to support merging table cells, please first run “VP Suite Update” to update your product to latest patch (sp1_20100317j or later). For details about updating to latest patch, please visit:

After that, please refer to attached sample template and attached image of results for merging table cells. Please let us know if there is anything else we can help.

Best regards,
Lilian Wong


results.png
ActivityDiagrams2.xml

Hi Joachimm,

I’m sorry that our engineers just found a problem that in patch sp1_20100317j, all tables generated in Report Writer will have 4 columns. Our engineers have just fixed the problem and the new patch will be deployed soon. Once the new patch is ready, I’ll let you know.

If you did not update to sp1_20100317j, please do not update first and wait for the new patch. Once again, we apologize for our fault.

Best regards,
Lilian Wong

Hi Joachim,

Sorry for my late response. The patch with fix on number of table column is ready, please run “VP Suite Update” to update your software to patch build sp1_20100317r or later. Should you have any inquiry, please do not hesitate to ask.

Best regards,
Lilian Wong

Thanks,

Is there any new concerning the functionality of sorting the printing of use cases based upon the layout of the diagram I want to print?

Also another question that is still open is how to avoid printing use cases twice.

Many thanks in advance

Joachim