Context Specific Predicates
If your custom state transition predicate is only applicable in a specific context, e.g. only for trackers/items of a specific type, then the implementing class should declare an additional predicate/method annotated with @PredicateApplicable. E.g.
package com.intland.codebeamer.example.predicates;
import com.intland.codebeamer.manager.workflow.TransitionPredicate;
import com.intland.codebeamer.manager.workflow.PredicateApplicable;
import com.intland.codebeamer.persistence.dto.TrackerDto;
import com.intland.codebeamer.persistence.dto.TrackerTypeDto;
@TransitionPredicate("customPredicate")
public classCustomPredicate {
@PredicateApplicable
public boolean isApplicable(TrackerDto tracker) {
return tracker.isA(TackerTypeDto.REQUIREMENT, TrackerTypeDto.USERSTORY);
}
}
Methods annotated with @PredicateApplicable must be
• Public
• Return boolean true if the predicate is applicable in the specified context, false otherwise.
The method must declare parameters for all required context information, that it needs to make it's decision.
The following context information is available:
• ProjectDto is the project, where to configure state transitions
• TrackerDto is the tracker, where to configure state transitions
• TrackerTypeDto is the type of the tracker, where to configure state transitions
• TrackerTypeDto.Kind is the kind of tracker, where to configure state transitions
◦ Tracker for work items.
◦ Category for configuration items.
◦ Repository for source code commits or pushs.