### Create REC/RPL Test Case Example Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Write-Junit Example of a test case for creating REC (Requirement) and RPL (Recommendation) elements in Capella. ```java public class CreateRPL_SimpleCase extends RecRplTestCase { ``` -------------------------------- ### CreateElement Test Example Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Write-Junit An example of a semantic test case for creating elements in the Project Explorer. It demonstrates how to access the session, editing domain, and resource set to perform modifications and assertions. ```APIDOC ## CreateElement Test Example ### Description This example demonstrates a semantic test case for creating elements within Capella. It shows how to obtain the current session, access the `TransactionalEditingDomain` for executing commands, and interact with the `ResourceSet` to manage loaded models. ### Endpoint N/A (This is a code example for a test case) ### Methods Used - **getSession()**: Retrieves the current Capella session. - **getRequiredTestModels()**: Specifies models to load before the test. - **test()**: Contains the test logic, including element creation and assertion. ### Request Example (Conceptual) ```java // Accessing session and editing domain Session session = getSession(); TransactionalEditingDomain editingDomain = session.getTransactionalEditingDomain(); ResourceSet resourceSet = session.getSemanticResources().get(0).getResourceSet(); // Example of executing a command to create an element (details depend on specific Capella API) // editingDomain.getCommandStack().execute(CreateElementCommand.create(...)); // Asserting the result // assertTrue(elementWasCreatedSuccessfully()); ``` ### Response Example (Conceptual) N/A (This is a test case, not an API endpoint with a direct response) ### Further Information Refer to the Capella wiki for details on [Edit an element](https://capella.wiki.}/Edit#edit-an-element). ``` -------------------------------- ### Get Diagrams by Name Pattern Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/12. Model Analysis/12.5.2 Acceleo 2 Queries.html Selects diagrams whose names start with a specific pattern, like 'Logical Data Flow Blank'. ```AQL aql: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors->select(x | x.description.name.startsWith('Logical Data Flow Blank')) ``` -------------------------------- ### Drag and Drop Test Example Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Write-Junit Example demonstrating a Drag and Drop operation within Capella tests. ```java public class DnDComponentAndPart extends BasicTestCase { ``` -------------------------------- ### Install Feature from Update Site Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/Installation Guide/How to install Capella and Addons.html Use this command to install a specific feature from an update site. Replace {repository} with the update site URL or path and {featureName} with the desired feature's identifier. ```bash capellac.exe -repository {repository} -installIU {featureName} -application org.eclipse.equinox.p2.director ``` -------------------------------- ### Get All Diagrams Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/12. Model Analysis/12.5.2 Acceleo 2 Queries.html Retrieves all diagrams present in the analysis. ```AQL aql: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors ``` -------------------------------- ### Capella 1.3.x Property Tester Example Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.2.x_to_1.3.x.html Example of a semantic property tester in Capella 1.3.x. Graphical property testers from 1.2.x are now merged into these. ```java org.polarsys.capella.core.platform.sirius.ui.actionMode ``` -------------------------------- ### Get Current Element Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/12. Model Analysis/12.5.2 Acceleo 2 Queries.html Retrieves the current element in the workbench selection. ```AQL aql:self ``` -------------------------------- ### Launch Capella with User Context Configuration Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/Installation Guide/How to install Capella and Addons.html Use this command-line parameter to launch Capella with a user-specific .ini file, applying the predefined addons for that context. ```bash --launcher.ini path/to/contextX.ini ``` -------------------------------- ### Launch Capella with Admin Context Configuration Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/Installation Guide/How to install Capella and Addons.html Use this command-line parameter to launch Capella with an administrator-specific .ini file, enabling context-specific addon installations. ```bash --launcher.ini contextX_admin.ini ``` -------------------------------- ### CreateElement Test Case - Get Required Models Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Write-Junit Example of specifying the list of models required for a test case. This method is called before the test execution. ```java public List getRequiredTestModels() ``` -------------------------------- ### Get Component Nature Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Adds a service to get the nature of a component. ```Java org.polarsys.capella.core.sirius.analysis.PhysicalServices.getComponentNature(DSemanticDecorator) ``` -------------------------------- ### Create Eclipse Application Run Configuration Source: https://github.com/eclipse-capella/capella/wiki/Development-Environment Instructions for creating a new 'Eclipse Application' run configuration to launch Capella from your development environment. ```text Run > Run Configurations ``` -------------------------------- ### Build Capella from Source with Maven Source: https://context7.com/eclipse-capella/capella/llms.txt Build the Capella project from source using Maven and Tycho. Ensure JDK 17+ is installed. Use profiles like '-Dfull' for a complete build or '-DskipTests' for faster builds. ```bash # Clone the repository git clone https://github.com/eclipse-capella/capella.git cd capella # Build with Maven (requires JDK 17+) mvn clean verify -Dfull # Build specific modules mvn clean verify -pl core/plugins -am # Run tests mvn verify -Dfull -DrunTests=true # Build without tests (faster) mvn clean verify -Dfull -DskipTests # Generate update site mvn clean verify -Dfull -P full # Key build profiles: # -Dfull : Build all modules including samples and tests # -DskipTests : Skip test execution ``` -------------------------------- ### Get Tool Create Function Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Removes a service to get a tool for creating a function. ```Java org.polarsys.capella.core.sirius.analysis.helpers.ToolProviderHelper.getToolCreateFunction(DDiagram) ``` -------------------------------- ### Get Deployed Components Service (Part) Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Removes a service to get deployed components for a Part. ```Java org.polarsys.capella.core.sirius.analysis.PhysicalServices.getDeployedComponents(Part) ``` -------------------------------- ### Get Deployed Components Service (PhysicalComponent) Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Removes a service to get deployed components for a PhysicalComponent. ```Java org.polarsys.capella.core.sirius.analysis.PhysicalServices.getDeployedComponents(PhysicalComponent) ``` -------------------------------- ### Dropin Addon Structure Example Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.ui.doc/html/Installation Guide/How to install Capella and Addons.html Illustrates the expected directory structure for an addon to be recognized as a dropin. Note the 'eclipse' subfolder containing 'plugins' and 'features'. ```text addonName\eclipse\plugins\* addonName\eclipse\features\* ``` -------------------------------- ### Get ESScope Insert Actors Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Adds a service to get actors for ESScope insertion. ```Java org.polarsys.capella.core.sirius.analysis.InteractionServices.getESScopeInsertActors(Scenario) ``` -------------------------------- ### Get ESScope Insert Components Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Adds a service to get components for ESScope insertion. ```Java org.polarsys.capella.core.sirius.analysis.InteractionServices.getESScopeInsertComponents(Scenario) ``` -------------------------------- ### Transition Actions and Commands Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Details on transition actions and commands for scenario projection. ```APIDOC ## Transition Actions and Commands ### Description Classes and commands related to transitions between different scenario types. #### Actions - `ESFToESBAction`: Action for ESF to ESB transition. - `ESToESAction`: Action for ES to ES transition. - `ESToISAction`: Action for ES to IS transition. #### Commands - `ESFtoESBCommand`: - `ESFtoESBCommand(Collection)`: Constructor. - `ESFtoESBCommand(Collection, IProgressMonitor)`: Constructor with progress monitor. - `getName()`: Returns the name of the command. - `ESToISCommand`: - `ESToISCommand(Collection)`: Constructor. - `ESToISCommand(Collection, IProgressMonitor)`: Constructor with progress monitor. - `getName()`: Returns the name of the command. - `EStoESCommand`: - `EStoESCommand(Collection)`: Constructor. ``` -------------------------------- ### Migrate Project with Backup and Export Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.commandline.doc/html/19. Command Line Support/19.1. Core Mechanism and Applications.html Use this command to migrate a project from a zip file, back it up, and export the migrated project as a new zip. Ensure the workspace path is correctly specified. ```bash /capellac.exe -nosplash -application org.polarsys.capella.core.commandline.core -appid org.polarsys.capella.migration -data -import D:/Projects/EOLE_AF.zip -input /all -exportZip EOLE_AF -outputfolder /MigratedProject/output -backup ``` -------------------------------- ### Get Deployed Components Service (EObject) Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Adds a service to get deployed components for a generic EObject. ```Java org.polarsys.capella.core.sirius.analysis.PhysicalServices.getDeployedComponents(EObject) ``` -------------------------------- ### Get Tool Create Functional Exchange Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Removes a service to get a tool for creating a functional exchange. ```Java org.polarsys.capella.core.sirius.analysis.helpers.ToolProviderHelper.getToolCreateFunctionalExchange(DDiagram) ``` -------------------------------- ### org.polarsys.capella.core.transition.system.topdown.ui Updates Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Details on changes to the UI command helper for transitions. ```APIDOC ## Changes in org.polarsys.capella.core.transition.system.topdown.ui ### Description This section details changes to the `TransitionUICommandHelper` class, specifically regarding the `executeCommand` method signature. ### Methods - **commands.TransitionUICommandHelper.executeCommand(String, Collection)** - Method: Removed - Type: Public - **commands.TransitionUICommandHelper.executeCommand(String, Collection)** - Method: Added - Type: Public ``` -------------------------------- ### Get OESScope Insert Entities Roles Service Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.3.x_to_1.4.x.html Adds a service to get entities and roles for OESScope insertion. ```Java org.polarsys.capella.core.sirius.analysis.OAServices.getOESScopeInsertEntitiesRoles(Scenario) ``` -------------------------------- ### Migrate Multiple Projects with Dependency Sequencing Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.commandline.doc/html/19. Command Line Support/19.1. Core Mechanism and Applications.html This command migrates multiple projects and their libraries, respecting dependency order. Use the '|' separator for multiple imports. A log file is generated at the specified path. ```bash /capellac.exe -nosplash -application org.polarsys.capella.core.commandline.core -appid org.polarsys.capella.migration -import "D:/Projects/Library3 | D:/Projects/Library1 | D:/Projects/Library2 | D:/Projects/Project1" -input /all -data -logfile D:/CommandLineLog/log.html ``` -------------------------------- ### Example Involved Functions Source: https://github.com/eclipse-capella/capella/wiki/Node-scripts An example JSON array representing functions involved in a functional chain, each with an ID and a name. ```json [ { id: '6ab4adaf-53bf-4c8d-b2d1-88d87529542a', name: 'Watch Video on Cabin Screen' }, { id: '698fef45-16d0-4166-98a9-797776442880', name: 'Play Airline-Imposed Videos' } ] ``` -------------------------------- ### Create ESF to ESB Command with Collection and Progress Monitor Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.4.x_to_5.x.html Constructor for the ESFtoESBCommand, taking a collection of EObjects and a progress monitor. ```Java public ESFtoESBCommand(Collection eObjectCollection, IProgressMonitor progressMonitor) ``` -------------------------------- ### Create New Viewpoint DSL Project Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Viewpoint-Development Use these commands in Eclipse to initiate the creation of a new Viewpoint DSL Project. Ensure Capella is selected as the target. ```text File/New…/Project – Viewpoint DSL Project ``` -------------------------------- ### AbstractCapabilityPkgExt Methods Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.2.x_to_1.3.x.html Details new methods added to the AbstractCapabilityPkgExt class for creating abstract capabilities. ```APIDOC ## AbstractCapabilityPkgExt ### Description Provides utility methods for AbstractCapabilityPkg elements. ### Methods #### `createAbstractCapability(AbstractCapabilityPkg)` - **Description**: Creates a new abstract capability within a given package. - **Type**: Added ``` -------------------------------- ### Capella 1.2.x Property Tester Example Source: https://github.com/eclipse-capella/capella/blob/master/doc/plugins/org.polarsys.capella.doc/html/Release note/API_1.2.x_to_1.3.x.html Example of a graphical property tester in Capella 1.2.x. These are now deprecated and merged into semantic property testers in Capella 1.3.x. ```java org.polarsys.capella.core.platform.sirius.ui.graphicalActionMode ``` -------------------------------- ### Registering a Custom Command Line Extension Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Command-Line Define a custom command line extension by specifying the Java class and a unique identifier in the plugin.xml file. ```xml ``` -------------------------------- ### Example Involved Exchanges Source: https://github.com/eclipse-capella/capella/wiki/Node-scripts An example JSON array representing exchanges within a functional chain, detailing their ID, name, source ID, and target ID. ```json [ { id: '10eaa967-ff31-4dd1-910a-92a7da7135de', name: 'Displayed Video', sourceId: 'a7a779f2-d033-4014-8d19-aecdc216b988', targetId: '6ab4adaf-53bf-4c8d-b2d1-88d87529542a' }, { id: '0f357449-ad6e-482b-982f-1b10c68406f6', name: 'Audio Stream', sourceId: 'a7a779f2-d033-4014-8d19-aecdc216b988', targetId: '322b800c-9c38-4d32-8b9a-bc34fa5c972d' } ] ``` -------------------------------- ### Aird Representation Descriptor Example Source: https://github.com/eclipse-capella/capella/wiki/FilesFormat Example XML snippet showing a Representation Descriptor within the DAnalysis section of an .aird file, defining a diagram's properties. ```xml ``` -------------------------------- ### Add UI Extensions for Commands and Menus Source: https://github.com/eclipse-capella/capella/wiki/tutorials/Create-Addons Configure plugin.xml to add 'org.eclipse.ui.commands' and 'org.eclipse.ui.menus' extensions. Ensure dependencies are added when prompted. ```xml ``` -------------------------------- ### Aird Graphical Representation Storage Example Source: https://github.com/eclipse-capella/capella/wiki/FilesFormat Example XML snippet illustrating how graphical representations, including element coordinates and visual states, are stored within the xmi section of an .aird file. ```xml ... ... ```