跳到主要内容

Component allocation

Physical Products are created, composed of Components. Functions from above levels of specifications are allocated to the components. Transcription Functions converts functional flows and real flows.

CREATE A PHYSICAL PRODUCT

In the overview, go to the "Component" Tab, click on the Project then on "New Physical Product"

new_physical_product

Choose name of the product, then click Ok:

physical_product_created

CREATE COMPONENTS

Open the Physical_Product Structure, and the "New Component" Button:

button_new_component

Name the Component instance in the Product, and the Component Type:

popup_component

After clicking Ok, an instance of the Component is added to the Product:

component_in_structure

And a ComponentType is created with a Structure:

component_overview

ALLOCATE FUNCTIONS TO COMPONENTS

Open ComponentType Structure, and click on "New Function" button :

button_new_function

Select Functions to allocate to the Component:

popup_allocate_function

After clicking "OK" the function is allocated:

structure_new_allocated_function

CREATE TRANSCRIPTION FUNCTIONS

Open ComponentType Structure, and click on "New Transcription Function" button :

button_new_function

Choose a name and a Category :

  • Real to functional for inputs of the Component
  • Function to Real for outputs of the Component
popup_new_transcription_function

After clicking "OK", a transcription function is added to the component:

structure_new_allocated_function

CREATE SEQUENCE DIAGRAMS TO ALLOCATE FLOWS

Click on "Create New Mapping UserStory":

overview_new_TF

Name the sequence diagram :

popup_new_SD

Open the sequence diagram :

new_SD

Click on "Lifeline" then select the function and the transcription function:

lifelines

After clicking OK:

new_lifelines_on_SD

Add messages between lifelines to allocate the flows :

SD_with_flows

The structure of the component is updated :

structure_updated

GENERATE CODE

Setting up of the Deployment Plan

Before generating our code, we must first create a Deployment Plan to ensure optimal deployment, compatibility, and prevent integration issues.

In the Model Explorer :

  • Go to <<ComponentsPackage>>Components -> <<ComponentPackage>> ComponentType.
  • Right click on <<ComponentPackage>> -> new child -> Package.
ComponentPackage

  • In the Properties view :
    • Fill in the name (e.g Deployment).
  • In the Profile's tag of the Properties view :
    • Add the DeploymentPlan stereotype in Applied stereotypes.
    • Expand DeploymentPlan :
      In chain: M2MTrafoChain [0..1], add ComponentChain.
m2m

deployment

Setting up the Main

The main is the first level of your code. Here we want to generate the Component code .

  • Right click on <<DeploymentPlan>> DeploymentName -> new child -> InstanceSpecification.
Setting_up_main

  • In the properties view :
    • Fill in the name: main
    • Define the classifier : <<ComponentClass>> ClassName
exampleType

Code generation

  • In the Overview, select the project and click on [Code] Generate.
  • Click on All Available Deployment Plans and select the newly created Deployment Plan.
Code generation


  • In the Toolchains, select Cygwin, then press Finish.