Page 1 of 1

Multiple Verify Methods

PostPosted: Tue Jun 05, 2018 10:42 am
by keenwpatrick@gmail.com
Regarding this post: multiple-verify-methods-t4614.html

When using the report wizard for requirements, the generated document returns the 'Verify Method: " as "NA" opposed to outputting the two verify methods. Is there any way to fix this? Further, MagicDraw gave the following error when the report was generated: "[2018.06.05::11:50:12]
WARN: [Report] No such property: name of ArrayList on $object.verifyMethod.name"

Thanks in advance,

Patrick

Re: Multiple Verify Methods

PostPosted: Sun Jun 10, 2018 9:12 pm
by sarawut_w
Hello Patrick,

$element.verifyMethod returns and Array object.
You could not immediately call for ".name", you need to get its item befoe, by #foreach directive.
However, by this case, you could use $report.getStereotypePropertyString($element, "StereotypeName", "PropertyName").
Code: Select all
$report.getStereotypePropertyString($r, “extendedRequirement”, “verifyMethod”)


If this could not solve your issue, please share us your sample model and template.

Best regards,
Sarawut W.
Support Engineer

Re: Multiple Verify Methods

PostPosted: Mon Jun 11, 2018 7:29 am
by keenwpatrick@gmail.com
Hi Sarawut,

I'm not sure how to input the code into my project. Is it a relatively simple process? If you are able to show steps, that would be wonderful. If I can't get it to work, I'll upload a sample project for more clarification. Thank you for the help!

Best,

Patrick

Re: Multiple Verify Methods

PostPosted: Mon Jun 11, 2018 7:54 pm
by sarawut_w
Hello,

So, please share us your sample project, template and expected result on the output report.

Best regards,
Sarawut

Re: Multiple Verify Methods

PostPosted: Tue Jun 12, 2018 6:27 am
by keenwpatrick@gmail.com
Hi Sarawut,

I am not able to upload the project due to the nature of the sensitive information contained within but I will try and make an example of what I would like and will edit this reply with that information. Thank you for the help!

Best wishes,

Patrick

EDIT: PNG's uploaded showing the problem with the requirements report. The double verify method is showing up in the requirements diagram as well as the requirements table but is showing an 'NA' on the report. Thank you!

Re: Multiple Verify Methods

PostPosted: Tue Jun 12, 2018 9:43 pm
by sarawut_w
Hello,

As we told you, your Requirement element contains 2 values in verifyMethod attribute.
You need to print it out with this code:
Code: Select all
$report.getStereotypePropertyString($requirement, “extendedRequirement”, “verifyMethod”)

or
Code: Select all
#foreach($requirement in $ExtendedRequirement)
$requirement.name
#foreach($value in $report.getStereotypeProperty($requirement, “extendedRequirement”, “verifyMethod”))
$value.name
#end

#end

Please apply the sample code to your template.

By the way, if you do not need to show "NA" text, you may update the default empty value at the Report Wizard dialog.
displayemptytext.png


Best regards,
Sarawut

Re: Multiple Verify Methods

PostPosted: Wed Jun 13, 2018 6:47 am
by keenwpatrick@gmail.com
Hi Sarawut,

Yes, I understand that I need to add the code into the report template but I am not sure how to do that. I created a macro for the project and pasted the code you provided in it but that did not work. Could you provide me with simple steps on how to accomplish this? Thank you for all of your help.

Best wishes,

Patrick

EDIT: Hi Sarawut, I realize now that I need to add the code to the report template but I think it is maybe too advanced for me to create a new template from scratch. Could you possibly tell/show me how to edit the source code for the built-in requirements report to add this? From there, I think I can probably figure out how to have elements display values of interest in the report as I asked you about in another thread. Thank you again for all of the help!

Re: Multiple Verify Methods

PostPosted: Wed Jun 13, 2018 8:55 pm
by sarawut_w
Hello,

At first, you need to learn basic of Velocity language that is needed for creating a template.
This is the online documentation for guiding how to create a template for MagicDraw 18.5 version:
https://docs.nomagic.com/display/MD185/ ... rc=sidebar

We, Magic Report plugin, provide features and functions for generating report from your template.
This is the online documentation for showing functions of Magic Report that provide you ways to create a template for MagicDraw 18.5:
https://docs.nomagic.com/display/MD185/ ... rc=sidebar

You may start to have your own template by customizing the built-in template.
You could open the Report Wizard dialog, and select the built-in template.
Then, click "Open" button.
opentemplate.png

Now, you could see the code of the template. You may start to find the table that you need to customize it for multiple verifyMethod values.
When finishing customize the code, you may save it as a new template file, and add it as a new template file in to Report Wizard by clicking the "Add" button.

Best regards,
Sarawut

Re: Multiple Verify Methods

PostPosted: Thu Jun 14, 2018 6:23 am
by keenwpatrick@gmail.com
Thank you for all of the help, Sarawut!

Best wishes,

Patrick

EDIT: The code you provided me for the verifyMethod worked perfectly once I was able to go into the source template for the report, so, thanks again!