In order to develop the SysML representation of the template, a SysML editor will be used, and so a tool specific development file for this template will need to be generated.
This file will be managed along with the other template specific information in SourceForge.
This development file will have to include sufficient package structure to locate the template within the SysML development environment when it is used in the development of other templates. This basically means that we need to ensure the structure of <<Context>>/Templates/<<Template>> is maintained for all templates in each context.
So as to maintain independance from a particular toolset, XMI is used as the underlying representation for the data. This makes use of xmi:id and xmi:uuid attributes to identify if things are the same or different. In order to keep the structure compatable, we have an index file that holds the upper structure (See Create the SysML index for the Context) which we will use to create our new template package. Once we have created the template package we can save that as a separate file under the source control system.
The basic tool independent procedure is as follows:
plcslib\data\contexts\<<Context>>\index.xmi
plcslib\data\contexts\<<Context>>\dvlp\
This basically defines the publicly visible properties of the template and any constraints between those properties. The public properties with lower multiplicities > 0 are the mandatory properties required to instantiate the template.
The public view of the template is given in a SysML Block Definition Diagram called "Template". This should be created using the following generic procedure:
The properties of a template are either "Reference properties", "Part properties" or "Value properties".
The properties must have a type specification and a multiplicity defined. To support the type specifications the PLCS PSM must be included into the template development file.
If some of the properties are usages of other templates, defined in either this or another context, then the tool specific template file for those templates should also be included at this stage to allow their use as the types of the public properties.
The main constraints that will be used in developing templates are Uniqueness constraints. These are to be specified in OCL 2.0 as follows:
context <<Template>> inv <<UniqueId>>: <<Template>>::allInstances()->isUnique(<<propertyName>> or Sequence{<<propertyName>>, <<propertyName>>})
To ensure some consistency the following presentation guidelines should be followed:
Save an image of the public view of the Template (SysML Block Definition Diagram) in PNG format to <<Template>>\Template.png
When a template is instantiated a number of internal components are instantiated to support the information requirements. These internal components can either be low level PLCS PSM data elements or other templates defined in this or another context.
These internal components are created as SysML private properties of the template block, i.e. properties as described above, but this time marked as private and not exposed in the public view. The public and private properties are related through assignments defined using a SysML binding connector.
Only part and reference properties can be defined as private within PLCSlib templates, this is to ensure that all public properties are eventually mapped to PLCS PSM data elements and not stored as simple values within a Template.
All public properties shall be connected via a binding connector to one, or more, private properties.
All private properties shall include a type specification and define their multiplicity. The multiplicity defines which of the internal components are created when the template is instantiated.
Occasionally it is not possible to directly assign a public property directly to a private property, this could be because it has to be combined with some other data or otherwise manipulated. To support this functional capability constraint blocks can be used to define the function that has to be performed. In this case binding connectors are attached to the input parameters of the usage of the constraint block within the parametric diagram and the output parameter connected to the relevant private property.
Flow ports are added to the template in order to provide access a subset of the private properties. These SysML Flow ports should be defined with a flow OUT direction and connected to the private properties with binding connectors. The flow ports should be have public visibility, have a meaningful name and include type and multiplicity information.
To ensure some consistency the following presentation guidelines should be followed:
Save an image of the internal view of the Template (SysML Parametric Diagram) in PNG format to <<Template>>\ <<Template>>.png
Instances may be used for either default values inside the template or to reflect values expected by constraints.
Constraint may be defined for use within the template or to support the usage of the template within other templates.
{output = function of inputs}
Once the template is complete, the SysML definition will need to be output as canonical
XMI, a tool
independent neutral format for the information contained in the SysML model.
As the majority of SysML tools currently do not fully support and export to canonical
XMI, a set of
ruby scripts are used to convert the specific tool output to the standard form.
These ruby scripts are found in the plcslib\etc\
directory, under a directory named after
the tool they are linked with (i.e. Magicdraw).
Detailed instructions on how to produce the canonical XMI are contained in the guidelines section for the specific tool you are using (see Guidelines).
The following links provide detailed information on how to develop and update OASIS PLCS SysML templates using specific tools: