IBM Support

How to change the scope of an existing DOORS trigger

Question & Answer


Question

How do you change the scope of an existing IBM Rational DOORS trigger?

Cause

The DXL Reference Manual covers this, but this manual's intended audience is programmers, which can make it difficult to understand for readers that do not have a programming background.

Answer

Before you can change the scope of the existing IBM Rational DOORS trigger, you need:

  • The original trigger code

  • An understanding of the changes you want to make

To understand how to change the trigger, you need to refer to the Triggers chapter of the DXL Reference Manual for your DOORS version. You can find this publication in your DOORS Information Center or in your DOORS client's Help.

The Triggers chapter explains trigger scope levels, level modifiers, event types, and what kind of events can be linked to triggers. It also shows you how to define a trigger -- you will need this information to interpret your existing trigger.

The following example shows how to change the scope of a trigger from module level -- where the trigger only impacts the named module -- to project level. Changing the scope to project level will result in the trigger impacting all modules in the project, even new ones that get created after the trigger is applied.

Existing code (applies to a single module):



    string message = "ack(\"Hello world!\")"
    Trigger myTrigger
    myTrigger = trigger("myTrigger", module->"My Test Module", post, open, 10, message)

To change the trigger's scope, you need to change the myTrigger line in the code above. Specifically, you need to change the second parameter to the trigger command (module->"My Test Module") -- this is the parameter that sets the scope.

The DXL Reference Manual explains the trigger command in detail. The above trigger command:

  • Sets the trigger name to be "myTrigger"

  • Sets the scope of the trigger to be the "My Test Module" module

  • Configures the trigger to run after the module is opened

  • Configures the trigger to run the DXL in the message line

To change the scope so the trigger applies to all modules in a specific project, instead of a single module, you need to change the trigger line as follows:
myTrigger = trigger("myTrigger", project->"project_name"->module->all, post, open, 10, message)


This trigger command configures the trigger to apply to all modules in the specified project. If you only want the trigger to apply to formal modules, use this version:
myTrigger = trigger("myTrigger", project->"project_name"->module->all->formal, post, open, 10, message)


Modified code (applies to all modules in the specified project):
myTrigger = trigger("myTrigger", project->"project_name"->module->all->formal, post, open, 10, message) string message = "ack(\"Hello world!\")"
Trigger myTrigger
myTrigger = trigger("myTrigger", project->"project_name"->module->all, post, open, 10, message)

[{"Product":{"code":"SSKR2T","label":"IBM Engineering Requirements Management DOORS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.3;9.3.0.1;9.3.0.2;9.3.0.3;9.3.0.4;9.3.0.5;9.3.0.6;9.3.0.7;9.4;9.4.0.1;9.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
01 May 2020

UID

swg21623022