Create "search module"

Hi, all:

I'm trying to create something like a "virtual module" that contains no objects of its own, but only the results of a a simple keyword search. Every time I open this module, I'd like to display objects in other modules that contain this keyword. I'm still pretty new to DXL, and I'm not sure how best to go about this. I've been toying around with attribute DXL and I have the basic search functionality working (really quite simple), but if I do it with attributes it seems to me I'll have to create a new set of objects in the virtual module every time I open it, which I'd rather not do.

Does anyone have any ideas about how i could implement this idea? Any pointers would be greatly appreciated. Thanks!

-Stephen


spcraft - Wed Aug 07 13:32:39 EDT 2013

Re: Create "search module"
adevicq - Thu Aug 08 03:11:48 EDT 2013

Hi,

If, when you open this "virtual" module you see "lines" displaying, it means that your "virtual" module will have as many objects as lines displaying.

Therefore you assumption "that contains no objects of its own" cannot be realized.

What do you want to do with your "virtual" module? Simply display results? But generally if you display a search result it is of another objective (displaying a result is not an objective...).

When I do such operations I display a list in a dialog box with info on the object on each row and when I click on one row I open the module and display the corresponding object and do whatever I need.

Regards,

Alain

Re: Create "search module"
spcraft - Thu Aug 08 10:35:15 EDT 2013

adevicq - Thu Aug 08 03:11:48 EDT 2013

Hi,

If, when you open this "virtual" module you see "lines" displaying, it means that your "virtual" module will have as many objects as lines displaying.

Therefore you assumption "that contains no objects of its own" cannot be realized.

What do you want to do with your "virtual" module? Simply display results? But generally if you display a search result it is of another objective (displaying a result is not an objective...).

When I do such operations I display a list in a dialog box with info on the object on each row and when I click on one row I open the module and display the corresponding object and do whatever I need.

Regards,

Alain

During my doodling around yesterday I kind of gathered that creating a module with no objects wouldn't work. But I think creating a module with some arbitrarily large number of blank objects is an acceptable workaround. I have some prototype DXL that populates those blank objects with other modules' objects' properties, which is kind of what I'm shooting for.

To answer your question, yes, the search result actually is the objective. I was hoping to create a kind of permanent search, a module that accumulates objects (from other modules) that contain certain keywords. It's a way to restructure DOORS for ease of use (by management) without undoing the work we administrators have done to structure it for our own purposes. The key idea is ease of use; the global search tool is certainly able to do the find, but most of our managers won't be comfortable loading and running DXL scripts. They'd be much better off just opening a module and seeing the results, so that's what I'm trying to build. 

Does that make sense? I've made a little progress on my own, but the closest I've gotten is creating new objects that copy properties from the old ones. That might work, but I suspect it's going to create problems when I start trying to do traceability analysis.

Re: Create "search module"
llandale - Thu Aug 08 16:48:23 EDT 2013

I know I'd just have a DXL that generates the MS-Word report with the info they want to see.

So lets say you want a module that finds all requirements that are "Critical" when it is opened for Edit.  When opened Read it shows the previous results.

  • Post-module-open Trigger does the work.
  • Objects in this module are all level 1
  •  
  • showDeletions true
  • oPrev = null
  • oCurr = null
  • while not done
  • {  oCrit = search other Requirement Modules and find the next "Critical" requirement
  •    if (null oCrit) then break
  •              // [1] here oCurr points to the PREVIOUS object populated
  •    if (null oCurr)
  •    {  oCurr = top mod    // 1st time through loop
  •       if (null oCurr)  then oCurr = create first mod
  •    }
  •    else
  •    {  if (null next oCurr) //
  •       then oCurr = create after oCurr
  •       else oCurr = next oCurr
  •    }
  •            // [2] here oCurr points to the new object we WANT to populate
  •    if (isDeleted(oCurr)) undelete(oCurr)
  •    populate oCurr's attributes with the info you want from oCrit
  • }
  •               // Less Critical Requirements than before?  Delete residual objects..
  • oNext = next oCurr
  • while not null oNext
  • {  if (not isDeleted(oNext)) then softDelete(oNext)
  •    oNext = next oNext
  • }
  • showDeletions false
  • save(mod)

I'm thinking if you have a small finite number of search criteria it would be realistic to have a module for each one.  Otherwise you'll need to prompt for search and have the problem of two managers trying to see different criteria at the same time.

-Louie

Re: Create "search module"
spcraft - Thu Aug 29 16:17:43 EDT 2013

llandale - Thu Aug 08 16:48:23 EDT 2013

I know I'd just have a DXL that generates the MS-Word report with the info they want to see.

So lets say you want a module that finds all requirements that are "Critical" when it is opened for Edit.  When opened Read it shows the previous results.

  • Post-module-open Trigger does the work.
  • Objects in this module are all level 1
  •  
  • showDeletions true
  • oPrev = null
  • oCurr = null
  • while not done
  • {  oCrit = search other Requirement Modules and find the next "Critical" requirement
  •    if (null oCrit) then break
  •              // [1] here oCurr points to the PREVIOUS object populated
  •    if (null oCurr)
  •    {  oCurr = top mod    // 1st time through loop
  •       if (null oCurr)  then oCurr = create first mod
  •    }
  •    else
  •    {  if (null next oCurr) //
  •       then oCurr = create after oCurr
  •       else oCurr = next oCurr
  •    }
  •            // [2] here oCurr points to the new object we WANT to populate
  •    if (isDeleted(oCurr)) undelete(oCurr)
  •    populate oCurr's attributes with the info you want from oCrit
  • }
  •               // Less Critical Requirements than before?  Delete residual objects..
  • oNext = next oCurr
  • while not null oNext
  • {  if (not isDeleted(oNext)) then softDelete(oNext)
  •    oNext = next oNext
  • }
  • showDeletions false
  • save(mod)

I'm thinking if you have a small finite number of search criteria it would be realistic to have a module for each one.  Otherwise you'll need to prompt for search and have the problem of two managers trying to see different criteria at the same time.

-Louie

Hi, guys:

I've been working on this sporadically over the last couple of weeks, and I have something that (mostly) works. I abandoned the idea of creating these modules inside DOORS, and instead wrote an attribute DXL that climbs through the database finding objects along the way that match certain keywords, and exports the results to a Word file. The user can just open the module (which contains one object, whose only attribute is the DXL), and the Word doc is generated out on the network. That much works great.

However, I'd rather export to Excel--the ability to order and filter would make this whole thing much more useful. My problem now is that many of my requirements contain line breaks, mostly in the form of bulleted lists:

The system shall contain the following kinds of crap:

  1. Crap number one
  2. Crap number two
  3. Crap number three

When I output to Word, it doesn't matter that each of these is on its own line. But when I output to Excel, the requirement, 1, 2, and 3 are all in their own cells. Is there a way to force all four lines into one cell, while keeping them on their own lines (like soft line breaks in Excel)? I'm pushing all the attributes I want to capture into a buffer, then dumping the buffer into a file.

Thanks again. Slow going, but I'm learning. :)

Re: Create "search module"
spcraft - Fri Sep 06 17:25:40 EDT 2013

llandale - Thu Aug 08 16:48:23 EDT 2013

I know I'd just have a DXL that generates the MS-Word report with the info they want to see.

So lets say you want a module that finds all requirements that are "Critical" when it is opened for Edit.  When opened Read it shows the previous results.

  • Post-module-open Trigger does the work.
  • Objects in this module are all level 1
  •  
  • showDeletions true
  • oPrev = null
  • oCurr = null
  • while not done
  • {  oCrit = search other Requirement Modules and find the next "Critical" requirement
  •    if (null oCrit) then break
  •              // [1] here oCurr points to the PREVIOUS object populated
  •    if (null oCurr)
  •    {  oCurr = top mod    // 1st time through loop
  •       if (null oCurr)  then oCurr = create first mod
  •    }
  •    else
  •    {  if (null next oCurr) //
  •       then oCurr = create after oCurr
  •       else oCurr = next oCurr
  •    }
  •            // [2] here oCurr points to the new object we WANT to populate
  •    if (isDeleted(oCurr)) undelete(oCurr)
  •    populate oCurr's attributes with the info you want from oCrit
  • }
  •               // Less Critical Requirements than before?  Delete residual objects..
  • oNext = next oCurr
  • while not null oNext
  • {  if (not isDeleted(oNext)) then softDelete(oNext)
  •    oNext = next oNext
  • }
  • showDeletions false
  • save(mod)

I'm thinking if you have a small finite number of search criteria it would be realistic to have a module for each one.  Otherwise you'll need to prompt for search and have the problem of two managers trying to see different criteria at the same time.

-Louie

Louie, I eventually found your advice on CSV output here, and it helped immensely. Sorry I didn't find it earlier; the forum search tool leaves something to be desired. Anyway I think I have my jury-rig working. Thanks again!