Ensure the MagicDraw environment is set up for working on PLCSlib.
plcslib\etc\MagicDraw
has been copied to the data folder for
your MagicDraw installation.
plcslib\data
. If not follow the procedure:
Options -> Environment
Path Variables
Add
PLCSlib.data
plcslib\data
OK
OK
Options -> Environment
General
Save/Load
true
OK
plcs\data\contexts\<<Context>>
index.xmi
with that on the MagicDraw specific index dvlp\index.mdxml
.
If the tool independent master index is later than the MagicDraw specific index,
or the MagicDraw specific index does not exist
plcslib\etc\Magicdraw\genMD.bat index.xmi
index.xmi
file can be dropped on the genMD batch file to execute.
File -> Open Project...
plcslib\data\contexts\<<Context>>\dvlp
plcslib\data\contexts\<<Context>>\dvlp\index.mdxml
Options-> Environment
Select PathVariables
Add a new path
variable named PLCSlib.data
and set the value to your local plcslib\data
folder Exit
MagicDraw WITHOUT saving the project!
Data/<<Context>>/Templates
and select New Element ->
Package
. Name the package <<Template>>
.
<<Template>>
and stereotyped as a Template, to the package named <<Template>>.
(Right click on package just created in Containment tree and select New Element
-> SysML Blocks -> Template
). After adding the stereotyped block MagicDraw will
immediately expect the name of the block to be entered.
<<Template>>
package, named Template and place a block representing your
template on the diagram.
Data/<<Context>>/Templates/<<Package>>
;
New Diagrams->SysML Diagrams->SysML Block Definition
Diagram
<<Template>>
from the
containment tree across to the diagram
"Autosize"
in order to reduce the size of the image.
"Diagram Properties"
"Autosize"
to "true"
File->Export To->Module
Select "OK" in the resulting
dialogue box. (If other dialogue boxes appear select "No".) In the resulting file
chooser, browse to
plcslib\data\contexts\<<Context>>\templates\<<Template>>\dvlp\
and save the new template file as
<<Context>><<Template>>.mdxml
.
plcslib\data\contexts\<<Context>>\dvlp\index.mdxml
plcslib\data\contexts\<<Context>>\dvlp\index.mdxml
)
to replace the absolute module path to the newly created module with a relative module
path using the path variable PLCSlib.data. i.e. replace as shown below:
<mdElement elementClass='FileProperty'> <value>D:\Users\CVSroot\plcslib\data\contexts\<<Context>>\templates\<<Template>>\dvlp</value> <selectionMode xmi:value='0'/> <displayFullPath xmi:value='true'/> <useFilePreviewer xmi:value='false'/> <displayAllFiles xmi:value='true'/> <fileType>FILE_TYPE_ANY</fileType> </mdElement>
<mdElement elementClass='FileProperty'> <value><PLCSlib.data>\contexts\<<Context>>\templates\<<Template>>\dvlp</value> <selectionMode xmi:value='0'/> <displayFullPath xmi:value='true'/> <useFilePreviewer xmi:value='false'/> <displayAllFiles xmi:value='true'/> <fileType>FILE_TYPE_ANY</fileType> </mdElement>
plcslib\data\contexts\<<Context>>\dvlp\index.mdxml
<<Context>>\index.xml
(overwriting the original). File -> Export To -> UML XMI 2.1
plcslib\etc\Magicdraw\stripXMI.bat
<<Context>>\index.xml
plcslib\data\contexts\dvlp\PLCS-profile.mdxml
. plcslib\data\PLCS\psm_model\dvlp\plcs_psm_module.mdxml
When
you press finish you should be offered the opportunity to use Path variables. Select
the
path variable form and press "Use Selected".
plcslib\data\contexts\<<Context>>\templates\<<Template>>\dvlp\<<Context>><<Template>>.mdxml
When you press finish you should be offered the opportunity to use Path variables.
Select the path variable form and press "Use Selected".
These are either "Reference properties", "Part properties" or "Value properties".
Add constraints (named in camel case starting with upper case letter) to the block to handle Uniqueness requirements in the form OCL 2.0 as follows:
<<Template>>::allInstances()->isUnique(<<propertyName>>)
<<Template>>::allInstances()->isUnique(Sequence{<<propertyName1>>, <<propertyName2>>})
Create a SysML Parametric Diagram for the <<Template>>.
An example of the resulting containment structure for the OASIS Requirement template is shown in Figure 1.
Instances are used for either default values inside the template or to reflect values expected by constraints.
Data/<<Context>>/Templates/<<Template>>
Data/<<Context>>/Templates/<<Template>>/Instances
right click and navigate the menu to
Diagrams->SysML Diagrams->SysML Block Definition Diagrams
and create a
"SysML Block Definition Diagram". Name it "Instances"
<<Template>>\Instances.png
An example of the resulting package structure is shown in Figure 2. The Context is "AerospaceAndDefense" and the template is "Task".
Constraint may be defined for use within the template or to support the usage of the template within other templates.
<<outParam>>= - function of <<inParams>>
Assuming the Block or Template in the parameter diagram has a Classifier property which is the be extended in a new template using reference data, the procedure is as follows:
This should result in this sort of structure in the containment tree
This will result in a the display of a connection between the Template object and the ValueType object like this:
File -> Export To -> UML XMI 2.1
plcslib\etc\Magicdraw\stripXMI.bat
<<Template>>\<<Template>>.xml
plcslib\etc\Ruby\updateTemplate.bat
<<Template>>\<<Template>>.xmi