diff --git a/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml b/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml index c85b5a7ef..0696ee81f 100644 --- a/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml +++ b/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml @@ -35,6 +35,11 @@ deactivate Launcher deactivate Launcher Engine --> addon : engineAboutToStart +note right + if required, the order of the calls to the Addons + can be controled by defining + EngineAddonSortingRules in the Addons +end note Engine -> Engine : beforeStart Engine --> addon : engineStarted Engine -> Engine : performStart diff --git a/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc b/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc index 7cfe1c3c3..f665020c8 100644 --- a/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc +++ b/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc @@ -24,3 +24,5 @@ Most notably, the _IEngineAddon_ and _IExecutionEngine_ interfaces that are the image::images/dev/frameworkcommons_api_overview_CD.png["Execution Framework API Interfaces overview"] +TIP: The section <> contains some details and code snippets about how to write an engine addon. + diff --git a/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml b/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml index 672edfff3..cf1aba0ba 100644 --- a/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml +++ b/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml @@ -9,6 +9,7 @@ scale max 1024 width scale max 800 height package xdsmlframework.api.engine_addon { + interface IEngineAddon #beige { void engineAboutToStart(IExecutionEngine engine) void engineStarted(IExecutionEngine executionEngine) @@ -23,7 +24,40 @@ package xdsmlframework.api.engine_addon { void stepExecuted(IExecutionEngine engine, trace.commons.model.trace.Step stepExecuted) void engineStatusChanged(IExecutionEngine engine, EngineStatus.RunStatus newStatus) List validate(List otherAddons) + String getAddonID() + List getTags() + List getAddonSortingRules() } + + class EngineAddonSortingRule { + Priority priority + IEngineAddon owner; + EngineEvent event; + Priority priority; + List addonsWithTags; + } + enum Priority { + BEFORE + AFTER + } + enum EngineEvent { + engineAboutToStart + engineStarted, + engineInitialized + engineAboutToStop, + engineStopped + engineAboutToDispose + aboutToSelectStep + proposedStepsChanged + stepSelected + aboutToExecuteStep + stepExecuted + engineStatusChanged + } + + Priority -[hidden]> EngineAddonSortingRule + EngineEvent -[hidden]> EngineAddonSortingRule + IEngineAddon <-- EngineAddonSortingRule : owner } package xdsmlframework.api.core { diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java index d8c6588d3..4c8b7f194 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java @@ -113,7 +113,7 @@ default public List getTags() { * A given rule indicate when to call the current addon relatively to addons referred by the rule * @return */ - default public List getAddonSortingRules(){ + default public List getAddonSortingRules() { return new ArrayList(); }