The Team Blog

Home » DOORS, Word » Creating a Custom DOORS Importer in 5 Minutes

Creating a Custom DOORS Importer in 5 Minutes

2012-01-13 Posted by tcapelle under DOORS, Word
No Comments

DOORS provides a generic importer for MS Word. This importer is good for plain text documents, but doesn’t work well when the Word document is structured.

For example, my customer formats his requirements like this:

[001] Instrument length must be less than 30 cm
Attributes  

Revision

Owner

Severity

1

E

A

Category Physical
Description The length of the instrument must be less than 30 cm so that it can fit into the carrying case.

 

[002] Instrument width must be between 5 mm and 1.5 mm
Attributes  

Revision

Owner

Severity

2

E

A

Category Physical
Description The total width of the instrument must be greater than 5 mm, but less than 1.5 mm for ease of use.

 

[003] Instrument build cost must be less than 0.05 USD
Attributes  

Revision

Owner

Severity

1

A

B

Category Cost
Description The total cost of production for the instrument must be less than 5 cents.

Using the DOORS Exporter in Word, DOORS produces this formal module:

DOORS Export in Word

DOORS Export from Word

The information is contained in this formal module, but hardly in the way that my customer would have liked!

The structure of the Word document is :

[ID] Object Short Text value
Attributes  

Attribute Name 1

Attribute Name 2

Attribute Name 3

Attribute Value 1

Attribute Value 2

Attribute Value 3

Category Object attribute “Category” value
Description Object Text value

Therefore each Word table corresponds to 1 DOORS Object, with the other table values used to fill-in attribute values on that Object.

For example, this Word table:

[001] Instrument length must be less than 30 cm
Attributes  

Revision

Owner

Severity

1

E

A

Category Physical
Description The length of the instrument must be less than 30 cm so that it can fit into the carrying case.

should produce this in DOORS:

So how do we solve this problem?

We’ll use the MDWorkbench and its DOORS and Word connectors to map the values into the desired Object structure.

First we need understand how the data is structured in Word so we can know how to get the values out of the document.

MDWorkbench has a Model Viewer that shows us Word document structure.

We can see that the Word document has some tables in it, which contain rows, which themselves contain cells.

We can also look at the structure of the DOORS formal module that we’d like to create.

By looking at the underlying DOORS representation of the Object created for the requirement in Word, we can see that we need to set the objectShortText, objectText, and some instantiatedAttributes.

Now we can write the rules that take the information from Word and create this structure in DOORS.

Creating the Import Rules

The first thing to do is to create a new ruleset in MDWorkbench, and to set the input and output models that we are going to use.

Then I usually start by pulling the information from my source, in this case Word.

Once I have figured out how to get the values out of Word, I set the values in DOORS. At this point, I start to break the logic into subrules for functions like creating a formal module and creating attributes on the objects.


And then I define the missing subrules:


(Here is the ruleset code: WordTableImporter.mqr)

And then I execute:

The resulting DOORS module is what I want:

Now I deploy, and add as an Add-In in Word.

Here is the full project zip file: DOORSWordTableImporter.zip

 

Tags: custom doors, Description, description object, doors, module, Owner, plain text documents, structure, value attributes, word table

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Design Interoperability Solutions for Defense Architecture Frameworks »

Go to Sodius

Search this blog
Categories
  • Defense Architecture Frameworks
  • DOORS
  • Excel
  • Jazz
  • MagicDraw
  • MDAccess
  • Rational Team Concert
  • Rhapsody
  • RSA
  • System Architect
  • Word
Tags
Architect architectural decisions breakpoint code navigation com completion code development doors drop dxl Editor File format xls gt models IBM ibm rational software information Interoperability jazz server logical architecture Magic MagicDraw MDWorkbench metamodel model model elements module ms office tools Open open perspective project wizard purchasing training Rational rational software architect rational system requirement requirements management site specific activity suitable tool syntax highlight system architect width workbook entry workspace
Back to top
Go to Sodius