Topic
7 replies Latest Post - ‏2013-05-07T08:49:37Z by Tony_Goodman
EHcnck
EHcnck
67 Posts
ACCEPTED ANSWER

Pinned topic Accept() + saving views

‏2013-05-02T03:40:03Z |

Hello,

Is it possible to save the following dxl script as a view so that I can use it within a RPE template?

{code}

//<
/*
Generate Inventory of Softdeleted Requirements
*/
pragma runLim, 0
noError

Module m = current
Object o = null

showDeletedObjects(true)

filtering off
sorting off

/************************************
    hasLinks
*************************************/
bool hasLinks(Object& o) {
    Link l = null
    for l in all(o->"*") do {
        if(name(module(l)) == "child2parent"    ||
           name(module(l)) == "parent2child"    ||
           name(module(l)) == "SDM"                ||
           name(module(l)) == "See also") continue
        return(true)
    }
    return(false)
}

for o in entire m do {
    if(hasLinks(o) && isDeleted(o)) {accept o}
    else {reject o}
}

filtering on
refresh current

{code}

 

Updated on 2013-05-02T03:42:10Z at 2013-05-02T03:42:10Z by EHcnck
  • Tony_Goodman
    Tony_Goodman
    270 Posts
    ACCEPTED ANSWER

    Re: Accept() + saving views

    ‏2013-05-02T12:22:52Z  in response to EHcnck

    The results of accept() and reject() cannot be saved in a view.

     

    I would suggest creating a DXL attribute that contains some value determined by the same rules you use for accept and reject.

    The DXL attribute can then be used to apply a filter which can be saved in a view.

     

    EDIT: Having looked at your code I see that you are displaying soft deleted objects, so DXL attributes will not work.

    You will have to use a layout DXL column instead which can also be used to create a filter.

     

    Updated on 2013-05-02T12:25:26Z at 2013-05-02T12:25:26Z by Tony_Goodman
    • llandale
      llandale
      2939 Posts
      ACCEPTED ANSWER

      Re: Accept() + saving views

      ‏2013-05-02T15:31:01Z  in response to Tony_Goodman

      I emphasize that attr-DXL and Layout cannot do this: if (whatever) then reject(obj) else accept(obj)

      v9200 and v9201 had a bug where attr-DXL could not set values of deleted objects.  It was fixed in v9202; so your attr-DXL suggestion will work, except for those versions.

      All my Attr-DXL has this:

      • if (null obj or null attrDXLName)    then halt
      •                    // Bug in these versions:
      • if (isDeleted(obj)     and
      •     length(doorsInfo(infoVersion)) >=7   and
      •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.1") or
      •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.0"))))  then halt

      I don't think you can filter on a layout column.

      -Louie
       

      -Louie

      • Pekka_Makinen
        Pekka_Makinen
        15 Posts
        ACCEPTED ANSWER

        Re: Accept() + saving views

        ‏2013-05-03T07:14:01Z  in response to llandale

        Filtering on Layout DXL column is possible - it is the "Columns" filtering in DOORS GUI or in DXL "FIlter column".

        • llandale
          llandale
          2939 Posts
          ACCEPTED ANSWER

          Re: Accept() + saving views

          ‏2013-05-03T15:08:48Z  in response to Pekka_Makinen

          Golly.  After all these years maybe I should start using the GUI...

          • nm3210
            nm3210
            7 Posts
            ACCEPTED ANSWER

            Re: Accept() + saving views

            ‏2013-05-03T18:13:52Z  in response to llandale

            Seems a lot of it is just made in DXL anyway....

            • llandale
              llandale
              2939 Posts
              ACCEPTED ANSWER

              Re: Accept() + saving views

              ‏2013-05-03T18:21:06Z  in response to nm3210

              More than "a lot".  I hear tell the "Module" and "Explorer" are mostly non-DXL; but just about everthing else is; including the buttons on those windows.

              • Tony_Goodman
                Tony_Goodman
                270 Posts
                ACCEPTED ANSWER

                Re: Accept() + saving views

                ‏2013-05-07T08:49:37Z  in response to llandale

                The Formal Module window is indeed mostly non-DXL except for the menus.

                The Database Explorer Window is 100% DXL.

                All dialogs are 100% DXL, except for some rarely seen error messages.