English | 简体中文
Project excitations use the same typed declaration approach; see Project excitation references.
Configuration fields directly use com.opentest.dashboard.api.config.ProjectTriggerRef. It stores only an ID, and JSON remains a scalar:
import com.opentest.dashboard.api.config.CollectConfig;
import com.opentest.dashboard.api.config.DashboardConfig;
import com.opentest.dashboard.api.config.ProjectTriggerRef;
public record MeterConfig(CollectConfig collectConfig, GateConfig gate) implements DashboardConfig { }
public record GateConfig(String mode, ProjectTriggerRef triggerConfigId) { }Register the measurement with MeterConfig.class as the configuration type in MeasureProviderRegistration. The corresponding JSON adds no wrapper object:
{"gate":{"mode":"SIGNAL_TRIGGER","triggerConfigId":123}}Nested objects, List<ProjectTriggerRef>, Map<String, ProjectTriggerRef>, and nested containers with explicit generic types are recognized. Numbers inside Map<String,Object> are not guessed to be references. Reference paths need no additional registration in compatibility JSON, result catalogs, or annotations. Import replaces only IDs corresponding to these typed fields while preserving unknown configuration extensions.
Execution obtains the capability for this execution through ExecutionContext.service(ProjectTriggers.class), then decides whether to resolve a reference according to its business mode:
import com.opentest.dashboard.api.capability.ProjectTriggers;
var triggers = execution.service(ProjectTriggers.class);
if ("SIGNAL_TRIGGER".equals(configuration.gate().mode())) {
var definition = triggers.require(configuration.gate().triggerConfigId(), "gate.triggerConfigId");
// definition.channelId(), referenceLevel(), slope(), etc. are frozen facts for this execution.
}find(reference) is a permissive read returning Optional<TriggerConfig>. Empty, deleted, and other-project references produce no definition. require(reference, field) validates active references for formal execution and reports a field error when missing. When saving configuration, plugins clear inactive IDs themselves and retain active but invalid IDs for continued editing. Do not call require during saving.
To prepare additional trigger input channels, use InputInterpretation declaration and binding callbacks that receive ProjectTriggers. Declaration may use find to obtain channels. Formal execution should require an active gate before acquiring device resources. Ordinary channel interpreters retain the original single-argument declaration and two-argument binding constructors.
Host acquisition start/stop uses the same reference type, but the host retains its active-mode and acquisition behavior. Plugin gate rules must not change host acquisition rules.
During preparation, ProjectTriggerFacts.capture(...) recognizes references through the registered configuration type and validates project ownership. ProjectTriggerFacts.definitions(...) then binds this execution's ProjectTriggers for input declaration and formal execution. For host acquisition, prepareCollection(...) places active start/stop definitions in collectConfig.startTriggerConfig and collectConfig.stopTriggerConfig within the execution configuration.
Historical recalculation uses ProjectTriggerFacts.legacy(...) to read the saved configuration, decoding embedded definitions only from fields explicitly declared as TriggerConfig in the registered type. Missing facts are not filled from the current project. ProjectTriggerRef stores only an ID; it neither persists a complete historical definition nor creates a separate triggerDefinitions snapshot field. Legacy complete-definition fields retained in the software development kit (SDK) support historical reading without filling current plugin configuration.
Both numeric and string IDs can bind, and ProjectTriggerRef serializes as an integer scalar. Project import edits raw JSON while preserving the original numeric or string ID representation. The Java field signature has changed, so plugins must be rebuilt.
If the corresponding plugin is absent or effectively disabled in the current session, import skips its Measure dashboard, configuration, results, graphics, history, snapshots, and exclusive files and returns a warning. Other dashboards, shared project data, and host Sequence continue importing. Enable and disable requests pending restart do not change this current-session decision.
For new exports, the host automatically records the actual plugin owning each Provider; plugin authors supply no extra declaration. Provider names need not match plugin namespaces. For old packages without ownership records, the decision uses whether the Provider is currently registered and available, with a combined missing-or-disabled message. A declared owner that is installed and enabled must still report Provider incompatibility as an error. Configuration-binding failures are not converted into skips.