Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

ReqCycle / developer resources / Traceability / Visitor

Traceability Visitor

This section will describe steps for registering new traceability visitors in ReqCycle

Register a visitor

Traceability visitors and Visitable resoures can be defined separately. To define a tracceability visitor the first step is defining an Eclipse extension :

<extension point="org.polarsys.reqcycle.traceability.builder.traceabilityAnalyser">

  <Analyser
     description="description text displayed in ReqCycle configuration"
     label="Label displayed in ReqCycle configuration"
     visitor="YourVisitor">
  </Analyser>

</extension>

the visitor shall implement the interface : org.polarsys.reqcycle.uri.visitors.IVisitor

Note : a traceability visitor is a standard reachable object visitor

Implement a visitor

Process description

During a traceability build process from a reachable object all the visitors will be called the algorithm is described bellow :

for each reachable object o

for each visitor v registered through analyser extension point 
  call void start(IAdaptable) method
for each element e visited in o 
  for each kept visitor v registered through analyser extension point 
    call boolean visit(Object, IAdaptable)
    if result equals to false remove v from kept visitor list
for each visitor v registered through analyser extension point 
  call void end(IAdaptable) method

Traceability Creation

for traceability purposes, the IAdaptable object is currently adaptable in one type (other types could be proposed later) :

→ org.polarsys.reqcycle.traceability.builder.ITraceabilityBuilder.IBuilderCallBack

Once the method boolean visit (Object, IAdaptable) is called, it is visitor responsability to determine :

  • if it desires to continue to visit. If NO the visitor shall return FALSE
  • if the given object can help for traceability identification

If a traceability link is detected the visitor shall call the newUpwardRelationShip method from IBuilderCallBack

Example of traceability link creation : ((IBuilderCallBack)(adaptable.getAdapter(IBuilderCallBack)).newUpwardRelation(traceability, container, source, Collections.singletonList(target), type);

  • traceability is an object which indentifies the traceability link
  • container is an object which "contains" the traceability link it is generally the resource containing the traceability link or currently build
  • source is the source of an upward traceability relationship
  • target is the target of an upward traceability relationship
  • type is an instance of org.polarsys.reqcycle.traceability.model.TType which define the type of the relationship

Note : in newUpwardRelation method objects are passed as arguments, ReqCycle will transform them to Reachables during the traceability analysis. Take care that your objects will be recognized

Back to the top