STEPlib SysML: How To use the IS AP243 Scripts

Warning

../../_images/construction.png

This page is under construction.

To contribute or participate contact support@boost-lab.net

This page explains how to use the Scripts of the STEP architecture to generate the documentation for the IS for AP243. Other pages (in progress) explain the process for other APs which include content for more of the architecture.

The image below shows the models in the STEP Extended Architecture that are used by, and generated for, the International Standard documentation.

../../_images/ht_scpt_is_architecture_AP.png

Figure 124 STEP Extended Architecture showing usage in this set of scripts

Prerequists

Warning

work in progress

DO A SPELL CHECKING BEFORE EXPORTING.

Needs:

  • java (saxon and tagsoup jar provided)

  • Python json.tool (for pretty print of JSON schema)

  • Ruby (for generation of Canonical XMI) and additional Gems:

    Ruby 2.5.3 (using an internet connection without proxy/firewall):

    gem install mini_portile2
    
    gem install systemu
    
    gem install macaddr
    
    gem install uuid
    
    gem install rubyzip
    
    gem install nokogiri
    

    Commands are assuming executingting in cmd window on PC.

Process explained

Attention

The domain model is mapped to the Core model and this is assumed to already be present in the output folders. See STEPlib SysML: How To use the IS Core Model Scripts.

The image below shows the models used and generated by the scripts. It includes a step-by-step view of the scripts where the yellow numbers refer generation of files that are not HTML, and the purple numbers are the HTML files.

../../_images/ht_scpt_is_process.png

Figure 125 IS Document Generation Process

Start. The XHTML files generated externally to this process are copied into the output folders

  1. The diagram images are exported from the SysML tool as png files. In MagicDraw this is done with a macro STEPlib/utils/MagicDraw/exportDiagramsMacro.js;
  2. The tool SysML files are converted into Canonical XMI and DI using a tool dependent script;
  3. The settings for the scripts are contained in ExtractID/VariablesData243.xml and AntPub/VariablesData243.xml. These should be updated or new variants created for other APs or core model. These are input arguments to the scripts.;
  4. ExtractID/CanonicalGenerateIDsXML.xsl: this script generates temporary file (sysml_models_ids.xml) containing basic information on ids and names for all entities in the models. This is used to resolve any external references instead of having to open every the Canonical XMI and DI for all the scripts;
  5. ExtractID/CanonicalExtract_ID.xsl: For each of the models this generates the image html files including the image maps. These are then copied into the appropriate Antpub/output/data folder;
  6. AntImp/CanonicalDomainModel_xmi_to_xsd.xsl: This generates the XSD for the model (note this imports AntPub/FunctionsCanonical.xsl and AntImp/FunctionsCanonical.xsl). The output is then sorted using AntImp/DomainModel_sort_xsd.xsl ;
  7. AntImp/DomainModel_xmi_to_json.xsl: This generates the XSD for the model which is then formatted using python -m json.tool (note the xsl imports AntPub/FunctionsCanonical.xsl);

The HTML documents that are generates with the following steps (see purple numbers in figure above):

  1. The clauses that are not dependent of any other HTML document are generated first as XHTML working files:

    1. AP Clause 4 CanonicalAPClause4_Documentations.xsl
    2. AP Clause 6 (for Uof, CO and CC model) CanonicalConformanceModel_Documentations.xsl or for single table used CanonicalConformanceModelSingle_Documentations.xsl
    3. AP AAM annex CanonicalAAM_Documentations.xsl
    4. DM/Core Clause 4 CanonicalDomainModel_clause4.xsl
    5. DM/Core Clause 5 CanonicalDomainModel_clause5.xsl
    6. Clause 3 TermsDefs.xsl
    7. Clause 2 and Biblography NormRefs_Biblio.xsl
    8. DM/Core Annex BBD list DomainModel_annex_bom_expg
    9. DM/Core Clause 4.3 RD ReferenceData.xsl
    10. DM/Core model index CanonicalDomainModel_index.xsl
  2. All the XHTML files (including those from STEPmod) are read to generate the index that will appear at the end of the table of contents. The script locates all heading tags in each file with class=(index_entry index_entry_type_{xxx}) where {xxx} is used to filter the index. It assumes a format of “{clause.number} {clause title}”, the {clause.number} us used as the text for the hyperlink and the {clause title} is prefixed before adding to the index.

    1. ToC index Canonical_index.xsl
  3. All the XHTML files (including those from STEPmod) are rebuilt and output as working XML with corrected figure numbers; table numbers; note and example numbers. The script locates all tags in each file with class = figure or table that are not inside a tabcontent, and prefixes the figure or table number to the tag with class = figureTitle or tableTitle. . It finds all tags with class = note or example and if more than one between heding tags applies numbering.

    1. renumber_figurestables.xsl
  4. The working XML files are read to generate the home.htm with the ToC, ToF and ToT for both AP and DM (or Core). The script locates all headings to add to the table of contents, all tags with class=”figureTitle” are added to the table of figures and all tags with class=”tableTitle” are added to the table of tables.

    1. CanonicalDomainModel_Home.xsl
  5. All the working XML files are then converted into HTML files

    1. xhtml_to_htm.xsl
  6. The XHTML and XML working files are deleted.

The Script folders are:

ExtractID

  • Functions.xsl (common functions)

  • CanonicalGenerateIDsXML.xsl

    • input xml: ExtractID/VariablesDataXXX.xml this has all the xmi and di filenames
    • imports ExtractID/Functions.xsl
    • generates ExtractID/output/sysml_models_ids.xml. This is copied to AntPub/input/
  • CanonicalExtract_ID/xsl

    • input xml: ExtractID/VariablesDataXXX.xml
    • input param: model_to_generate (AAM, CM, DM, CC, SM, Core)
    • uses ExtractID/output/sysml_models_ids.xml
    • generates ExtractID/output/html/*.htm which should then be moved to AntPub/output/data/{subfolder(s)}/

AntImp

  • FunctionsCanonical.xsl

  • DomainModel_canonicalxmi_to_xsd.xsl

    • input xml: DomainModel.xmi (Canonicial XMI)
    • input param: variablesFileName=../AntPub/VariablesDataXXX.xml
    • reads AntPub/input/sysml_models_ids.xml
    • imports AntPub/FunctionsCanonical.xsl and AntImp/FunctionsCanonical.xsl
    • generates (as > argument) unsorted_DomainModel_from_cxmi.xsd
  • DomainModel_sort_xsd.xsl

    • input xml: unsorted_DomainModel_from_cxmi.xsd
    • generates (as > argument) DomainModel.xsd which should then be moved to AntPub/output/data/domain_models/{APShortName}/
  • DomainModel_canonicalxmi_to_json.xsl (imports AntPub/FunctionsCanonical.xsl)

    • input xml: DomainModel.xmi (Canonicial XMI)
    • input param: variablesFileName=../AntPub/VariablesDataXXX.xml
    • input param: combined (0 or 1) - default 1.
    • input param: fileNamePost. default = 243
    • input param: debuggingMode (0 1)
    • reads AntPub/input/sysml_models_ids.xml
    • imports AntPub/FunctionsCanonical.xsl
    • generates (as > argument) DomainModel_NotPretty{fileNamePost}.json

AntPub

  • FunctionsCanonical.xsl

    • input param: variablesFileName (default AntPut/VariablesData.xml this must always be changed)
    • reads AntPub/input/sysml_models_ids.xml
  • CanonicalFunctionsHTML.xsl

    • input param: model_to_generate (AP, DM, Core)
    • input param: my_model (AAM, CM ,CC, SM, Core) default is model_to_generate
    • includes AntPub/FunctionsCanonical.xsl
  • CanonicalAPClause4_Documentations.xsl

    • input xml Data_planning_model.xmi
    • input param: model_to_generate=AP
    • input param: variablesFileName
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/sys/4_info_reqs.xhtml
  • CanonicalConformanceModel_Documentations.xsl

    • input xml Domain_model_conformance.xmi
    • input param: model_to_generate=AP
    • input param: variablesFileName
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/sys/6_ccs.xhtml
  • CanonicalConformanceModelSingle_Documentations.xsl

    • input xml Domain_model.xmi
    • input param: model_to_generate=AP
    • input param: variablesFileName
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/sys/6_ccs.xhtml
  • CanonicalAAM_Documentations.xsl

    • input xml Activity_model.xmi
    • input param: model_to_generate=AP
    • input param: variablesFileName
    • reads AntPub/input/sysml_models_ids.xml
    • imports AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/sys/annex_aam.xhtml
  • CanonicalDomainModel_clause4.xsl

    • input xml Domain_model.xmi (or Core_model.xmi)
    • input param: model_to_generate=DM (or Core)
    • input param: variablesFileName
    • input param: split4 (default 0 which will ouput all clause 4 in one file. change to 1 for clause 4 split by packages)
    • input param: splitModel (default 0 indicating the all is contained in the input xmi. Set to 1 if multiple xmi (e.g. for core)
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/domain_models/{APShortName}/sys/4_info_reqs_XXX.xhtml
  • CanonicalDomainModel_clause5.xsl

    • input xml Domain_model.xmi (or Core_model.xmi)
    • input param: model_to_generate=DM (or Core)
    • input param: variablesFileName
    • input param: splitModel (default 0 indicating the all is contained in the input xmi. Set to 1 if multiple xmi (e.g. for core)
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/domain_models/{APShortName}/sys/5_main.xhtml
  • TermsDefs.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (AP, DM or Core)
    • input param: termtag (APterms DMterms) - tag containing the terms to use in the input xml
    • input param: variablesFileName
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/{Core, AP or DM}/sys/3_defs.xhtml
  • NormRefs_Biblio.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (AP, DM or Core)
    • input param: nr_or_biblio (nr biblio) - tag containing the terms to use in the input xml
    • input param: variablesFileName
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/{Core, AP or DM}/sys/2_refs.xhtml (filename specified in input xml)
    • generates AntPub/output/data/{Core, AP or DM}/sys/biblio.xhtml (filename specified in input xml)
  • DomainModel_annex_bom_expg.xsl

    • input xml AntPub/input/sysml_models_ids.xml
    • input param: model_to_generate (DM or Core)
    • input param: termtag=DMterms
    • input param: variablesFileName
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/{Core or DM}/sys/annex_bom_expg.xhtml
  • ReferenceData.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (DM or Core)
    • input param: variablesFileName
    • reads all reference data files as specified in input xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/{Core or DM}/sys/4_info_reqs_refdata.xhtml
  • CanonicalDomainModel_index.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (DM or Core)
    • input param: variablesFileName
    • reads AntPub/input/sysml_models_ids.xml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/{Core or DM}/sys/index_domain_model.xhtml
  • Canonical_index.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (AP, DM or Core)
    • input param: variablesFileName
    • reads all the previously generated xhtml
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/index_apdoc.xhtml
    • generates AntPub/output/data/domain_models/{APShortName}/index_bomdoc.xhtml
    • generates AntPub/output/data/core_model/index_bomdoc.xhtml
  • renumber_figurestables.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (AP, DM or Core)
    • reads all *.xhtml (including those manually created)
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates *.xml (as xhtml)
  • CanonicalDomainModel_Home.xsl

    • input xml Domain_model.xmi or Core_model.xmi
    • input param: model_to_generate (DM or Core)
    • input param: variablesFileName
    • reads all output *.xml (from renumber_figurestables.xsl)
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates AntPub/output/data/application_protocols/{APShortName}/home.htm (if model_to_generate=DM)
    • generates AntPub/output/data/domain_models/{APShortName}/home.htm (if model_to_generate=DM)
    • generates AntPub/output/data/core_model/home.htm (if model_to_generate=Core)
  • xhtml_to_htm.xsl

    • input xml AntPub/VariablesDataXXX.xml
    • input param: model_to_generate (AP, DM or Core)
    • reads all *.xml (from renumber_figurestables.xsl)
    • includes AntPub/CanonicalFunctionsHTML.xsl
    • generates *.htm (as html)

The following html classes are used by the scripts (Note all are xhtml) e.g.:

<div class="figure">...</div>

figure and figureTitle:

<div class="figure" align="center" name="{name of figure}" id="{figure id}">
        <img style="overflow: auto; max-height: 90vh;" src="{path to image file}" alt="{alt text}" border="0"></img>
        <br></br>
        <div align="center">
                <b class="figureTitle">{title of figure}</b>
        </div>
</div>

For example:

<div align="center" class="figure" id="figure_1" name="figure_1">
        <img style="overflow: auto; max-height: 90vh;" src="../study_wwwwhw.png" alt="Illustration of Fractal Studies with examples of Systems Engineering Context" border="0"/>
        <br/>
        <div align="center">
                <b class="figureTitle">Illustration of Fractal Studies with examples of Systems Engineering Context</b>
        </div>
</div>

table and tableTitle:

    <div class="table" align="center" name="{name of table}" id="{id of table}">
            <div align="center">
                    <b class="tableTitle">{table title}</b>
            </div>
            <br></br>
            {<img>...</img> or <table>...</table>}
</div>

For example:

<div align="center" class="table" id="Q_table" name="Q_table">
        <div align="center">
                <b class="tableTitle">Business questions and directives concerned with traceability</b>
        </div>
        <br/>
        <table>...</table>
</div>

note:

<p class="note">...</p>

example:

<p class="example">...</p>

index entry:

<{} class="index_entry index_entry_type_{}" name="{name of entry}" id="{id of entry}">{entry clause} {entry text}</{}>

For example:

<a name="ConceptSelect" id="_18_4_1_1xxx" class="index_entry index_entry_type_type">4.2.14.1.1 ConceptSelect</a>

<h3 class="index_entry index_entry_type_term">
        <a id="term_application">3.1.1</a>
        <br/>
        <a>application</a>
</h3>

<tr id="abbrev_AAM" class="index_entry index_entry_type_abbreviation">
        <td>AAM</td>
        <td>
                <defn>application activity model</defn>
        </td>
</tr>

index entry types used so far:

  • index_entry_type_part (e.g. for 4443)
  • index_entry_type_term (Clause 3)
  • index_entry_type_abbreviation(Clause 3)
  • index_entry_type_type (4xxx 4.2.x.1.x)
  • index_entry_type_entity (4xxx 4.2.x.2.x)
  • index_entry_type_constraint (4xxx 5.3)
  • index_entry_type_Activity (2xx AAM annex)
  • index_entry_type_data_planning (2xx 4.1.1.x)
  • index_entry_type_UOF (2xx 6.1.x)
  • index_entry_type_CO (2xx 6.2.x)
  • index_entry_type_CC(2xx 6.3.x)

Other types of index entry may be added, but the script prefixes the entry with text based on assumptions about the clause number, if the entry is another clause than those listed above the entry will be prefixed with red “TBD entry” text.

Generate the Core model

Important

The core model must be generated before running these scripts. See STEPlib SysML: How To use the IS Core Model Scripts.

Export images from MagicDraw

Important

The image output settings must be set to 100%

File/Save as image/Image format/Options

../../_images/ht_scpt_imagesize.png

Figure 126 set Export diagram size to 100%

Assuming a MagicDraw license is available:

  1. In MagicDraw use the STEPlibutilsMagicDrawexportDiagramsMacro.js to generate the diagram images. see Load Macros for how to load and use macros.

    • Open each of the following models in turn and run the macro. This should create the png in the folder that contains the dvlp for the model:

      • Activity_model/dvlp/Activity_model.mdzip
      • Data_planning_model/dvlp/Data_planning_model.mdzip
      • Services_model/dvlp/Services_model.mdzip (if required)
      • Domain_model_conformance/dvlp/Domain_model_conformance.mdzip (if required)
      • Domain_model_TestData/dvlp/Domain_model_TestData.mdzip (if required)
      • Domain_model/dvlp/Domain_model
../../_images/ht_scpt_exphtml_AP.png

Figure 127 Export diagrams to png with macro

If there is no MagicDraw license, then the macros are not available. In this case the process is to export the diagrams using the inbuilt exporter, then generate and run a batch file which will rename the resultant images.

  1. Open each of the models listed above and then select File > Save As Image

  2. Select all the diagrams and save as png to the model folder without dvlp, overwriting existing files:

    ../../_images/ht_scpt_no_macro.png

    Figure 128 Export diagrams to png using out-of-the-box MagicDraw

  3. when executing the scripts, after the CanonicalGenerateIDsXML labeled rename images if not using the macro.

Todo

find out how to use macros with “reader” MagicDraw. Have checked with normal MagicDraw in evaluation model (i.e. no SysML license) and works OK.

Convert the SysML models to Canonical XMI

  1. Convert MagicDraw mdzip into Canonical XMI.

Todo

NOTE: The top level package needs an annotated element that has the Nnumber for the XSD and XMI plus other text.

Either drag and drop the Application_protocols/AP2xx folder onto the STEPlib/utils/MagicDraw/genXMIFromFolder.bat

Or (if the above fails) execute the following calls:

cd STEPlib/utils/MagicDraw

for /D %i in (../../Application_protocols/AP243/*) do (ruby "to_cxmi.rb" mdzip="../../Application_protocols/AP243/%i/dvlp/%~ni.mdzip" ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Application_protocols/AP243/%i/%~ni.xmi" ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Application_protocols/AP243/%i/%~ni.di")

or if that fails hardcode the path:

for /D %i in (C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\*) do (ruby "to_cxmi.rb" mdzip="%i/dvlp/%~ni.mdzip" ruby "..\ExpToXMI\to_cxmi.rb" xmi="%i/%~ni.xmi" ruby "..\ExpToXMI\to_cxmi.rb" xmi="%i/%~ni.di")

or if that fails:

(temp fix as scripts internal relative paths not working)
cd STEPlib/utils/MagicDraw/runFromHereForAP

for /D %i in (../../../Application_protocols/AP243/*) do (ruby "to_cxmi.rb" mdzip="../../../Application_protocols/AP243/%i/dvlp/%~ni.mdzip" ruby "..\..\ExpToXMI\runFromHereForAP\to_cxmi.rb" xmi="../../../Application_protocols/AP243/%i/%~ni.xmi" ruby "..\..\ExpToXMI\runFromHereForAP\to_cxmi.rb" xmi="../../../Application_protocols/AP243/%i/%~ni.di")

.

For some reason the “for /D etc” does or via hard code.

cd STEPlib/utils/MagicDraw

ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\dvlp\Domain_model.mdzip
ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\dvlp\Domain_model_conformance.mdzip
ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\dvlp\Domain_model_TestData.mdzip
ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Concept_model\dvlp\Conceptual_model.mdzip
ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Activity_model\dvlp\Activity_model.mdzip
ruby to_cxmi.rb mdzip=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Services_model\dvlp\Services_model.mdzip
cd ../ExpToXMI
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model_conformance.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model_TestData.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Concept_model\Conceptual_model.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Activity_model\Activity_model.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Services_model\Services_model.xmi
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model.di
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model_conformance.di
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Domain_model\Domain_model_TestData.di
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Concept_model\Conceptual_model.di
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Activity_model\Activity_model.di
ruby to_cxmi.rb xmi=C:\Users\JCROCKFORD1\Documents\Git\ISOBoostGit\ap243branch\STEPlib\Application_protocols\AP243\Services_model\Services_model.di

.

Generate All

Important

The core model must be generated before running these scripts. See STEPlib SysML: How To use the IS Core Model Scripts.

Note

The following assume exporting {243} with a short name {mossec}. These should be changed to values appropriate for the documentation being generated.

Initial steps:

  1. Follow the instructions in Export images from MagicDraw
  2. Edit the data in ExtractID/VariablesData243.xml and AntPub/VariablesData243.xml
  3. The cover.htm and the XHTML files in subfolders of AntPub/input/AP243STEPmod_files are not touched and should be edited manually, they are copied as is into the output/data folder.

Todo

convert this into batch script with arguments e.g. for {mossec} and {243} and hardcoded relative paths {Harmo}

Execute the following calls:

del /q AntPub\output\data\application_protocols\mossec /s
del /q AntPub\output\data\domain_models\mossec /s
mkdir AntPub\output\data\application_protocols\mossec
mkdir AntPub\output\data\application_protocols\mossec\pictures
mkdir AntPub\output\data\application_protocols\mossec\refdata
mkdir AntPub\output\data\application_protocols\mossec\sys
mkdir AntPub\output\data\application_protocols\mossec\sys\script
xcopy AntPub\input\script AntPub\output\data\application_protocols\mossec\sys\script /s /e
mkdir AntPub\output\data\domain_models\mossec
mkdir AntPub\output\data\domain_models\mossec\pictures
mkdir AntPub\output\data\domain_models\mossec\refdata
mkdir AntPub\output\data\domain_models\mossec\sys
mkdir AntPub\output\data\domain_models\mossec\sys\script
xcopy AntPub\input\script AntPub\output\data\domain_models\mossec\sys\script /s /e
del /q Antpub\input\maps\*
powershell Compress-Archive -Path ..\Application_protocols\AP243\Domain_model\*.di, ..\Application_protocols\AP243\Domain_model\*.xmi  -DestinationPath AntPub\output\data\domain_models\mossec\Domain_model_XMI.zip -Force
powershell Compress-Archive -Path ..\Application_protocols\AP243\refdata\*.owl -Update -DestinationPath AntPub\output\data\domain_models\mossec\Domain_model_XMI.zip
powershell Compress-Archive -Path ..\Core_model\refdata\*.owl -Update -DestinationPath AntPub\output\data\domain_models\mossec\Domain_model_XMI.zip
powershell Compress-Archive -Path ..\Application_protocols\AP243\Activity_model\*.di, ..\Application_protocols\AP243\Activity_model\*.xmi  -DestinationPath AntPub\output\data\application_protocols\mossec\Activity_model.zip -Force
powershell Compress-Archive -Path ..\Application_protocols\AP243\Data_planning_model\*.di, ..\Application_protocols\AP243\Data_planning_model\*.xmi  -DestinationPath AntPub\output\data\application_protocols\mossec\Data_planning_model.zip -Force
cd ExtractID
del /q output\html\*
java -jar ../saxon9-8-0-6.jar -t VariablesData243.xml CanonicalGenerateIDsXML.xsl
copy output\sysml_models_ids.xml ..\AntPub\input\. /y

//rename images if not using the macro
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM relativePath=..\..\Application_protocols\AP243\Domain_model ./output/sysml_models_ids.xml CanonicalRenameMDimages.xsl
move output\renameimages.bat ..\..\Application_protocols\AP243\Domain_model\.
..\..\Application_protocols\AP243\Domain_model\renameimages.bat
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AAM relativePath=..\..\Application_protocols\AP243\Activity_model ./output/sysml_models_ids.xml CanonicalRenameMDimages.xsl
move output\renameimages.bat ..\..\Application_protocols\AP243\Activity_model\.
..\..\Application_protocols\AP243\Activity_model\renameimages.bat
java -jar ../saxon9-8-0-6.jar -t model_to_generate=CM relativePath=..\..\Application_protocols\AP243\Data_planning_model ./output/sysml_models_ids.xml CanonicalRenameMDimages.xsl
move output\renameimages.bat ..\..\Application_protocols\AP243\Data_planning_model\.
..\..\Application_protocols\AP243\Data_planning_model\renameimages.bat
java -jar ../saxon9-8-0-6.jar -t model_to_generate=SM relativePath=..\..\Application_protocols\AP243\Services_model ./output/sysml_models_ids.xml CanonicalRenameMDimages.xsl
move output\renameimages.bat ..\..\Application_protocols\AP243\Services_model\.
..\..\Application_protocols\AP243\Services_model\renameimages.bat

//DM
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM VariablesData243.xml CanonicalExtract_ID.xsl
xcopy output\html\* ..\AntPub\input\maps
move output\html\* ..\AntPub\output\data\domain_models\mossec
xcopy ..\..\Application_protocols\AP243\Domain_model\_*.png ..\AntPub\output\data\domain_models\mossec\pictures
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AAM VariablesData243.xml CanonicalExtract_ID.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=CM VariablesData243.xml CanonicalExtract_ID.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=SM VariablesData243.xml CanonicalExtract_ID.xsl
xcopy output\html\* ..\AntPub\input\maps
move output\html\* ..\AntPub\output\data\application_protocols\mossec
xcopy ..\..\Application_protocols\AP243\Activity_model\_*.png ..\AntPub\output\data\application_protocols\mossec\pictures
xcopy ..\..\Application_protocols\AP243\Data_planning_model\_*.png ..\AntPub\output\data\application_protocols\mossec\pictures
xcopy ..\..\Application_protocols\AP243\Services_model\_*.png ..\AntPub\output\data\application_protocols\mossec\pictures
cd ../AntImp
java -jar ../saxon9-8-0-6.jar -t variablesFileName=../AntPub/VariablesData243.xml ../../Application_protocols/AP243/Domain_model/Domain_model.xmi DomainModel_canonicalxmi_to_xsd.xsl > unsorted_DomainModel_from_cxmi.xsd
java -jar ../saxon9-8-0-6.jar -t unsorted_DomainModel_from_cxmi.xsd DomainModel_sort_xsd.xsl > DomainModel.xsd
copy DomainModel.xsd ..\AntPub\output\data\domain_models\mossec /y
java -jar ../saxon9-8-0-6.jar -t debuggingMode=0 variablesFileName=../AntPub/VariablesData243.xml ../../Application_protocols/AP243/Domain_model/Domain_model.xmi DomainModel_canonicalxmi_to_json.xsl
type DomainModel_NotPretty243.json | python -m json.tool > DomainModel.json
copy DomainModel.json ..\AntPub\output\data\domain_models\mossec /y
cd ../AntPub
xcopy .\input\AP243STEPmod_files\* .\output /s /e /y
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml ../../Application_protocols/AP243/Data_planning_model/Data_planning_model.xmi CanonicalAPClause4_Documentations.xsl  --suppressXsltNamespaceCheck:on 2>243_4_error.log
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml  ../../Application_protocols/AP243/Domain_model/Domain_model.xmi CanonicalConformanceModelSingle_Documentations.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml ../../Application_protocols/AP243/Activity_model/Activity_model.xmi CanonicalAAM_Documentations.xsl --suppressXsltNamespaceCheck:on 2>243_AAM_error.log
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml termtag=APterms ./VariablesData243.xml TermsDefs.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml nr_or_biblio=nr ./VariablesData243.xml NormRefs_Biblio.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml nr_or_biblio=biblio ./VariablesData243.xml NormRefs_Biblio.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml ./VariablesData243.xml Canonical_index.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP  ./VariablesData243.xml renumber_figurestables.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM split4=1 variablesFileName=VariablesData243.xml ../../Application_protocols/AP243/Domain_model/Domain_model.xmi CanonicalDomainModel_clause4.xsl --suppressXsltNamespaceCheck:on 2>4443_4_error.log
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM splitModel=1 variablesFileName=VariablesData243.xml ../../Application_protocols/AP243/Domain_model/Domain_model.xmi CanonicalDomainModel_clause5.xsl 2>4443_5_error.log
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM ./input/sysml_models_ids.xml termtag=DMterms variablesFileName=VariablesData243.xml DomainModel_annex_bom_expg.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml termtag=DMterms ./VariablesData243.xml TermsDefs.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml nr_or_biblio=nr ./VariablesData243.xml NormRefs_Biblio.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml nr_or_biblio=biblio ./VariablesData243.xml NormRefs_Biblio.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml ./VariablesData243.xml CanonicalDomainModel_index.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml ./VariablesData243.xml ReferenceData.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml ./VariablesData243.xml Canonical_index.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM  ./VariablesData243.xml renumber_figurestables.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM variablesFileName=VariablesData243.xml ../../Application_protocols/AP243/Domain_model/Domain_model.xmi CanonicalDomainModel_Home.xsl --suppressXsltNamespaceCheck:on
java -jar ../saxon9-8-0-6.jar -t model_to_generate=DM  ./VariablesData243.xml xhtml_to_htm.xsl
java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP  ./VariablesData243.xml xhtml_to_htm.xsl

// delete interim files
del /q output\data\application_protocols\mossec\sys\*.xhtml
del /q output\data\application_protocols\mossec\sys\*.xml
del /q output\data\domain_models\mossec\sys\*.xhtml
del /q output\data\domain_models\mossec\sys\*.xml

//cd ../generate_owl
//java -jar ../saxon9.jar -t ../Domain_model.xml AP243_DomainToOWL.xsl > ../AntPub/input/domain_model.owl
//copy ..\AntPub\input\domain_model.owl ..\AntPub\output\data\application_protocols\mossec\refdata\ap243_RDL-en-v1-0.owl /y

// clause 6 using the Domain_model_conformance.xmi
//java -jar ../saxon9-8-0-6.jar -t model_to_generate=AP variablesFileName=VariablesData243.xml  ../../Application_protocols/AP243/Domain_model_conformance/Domain_model_conformance.xmi CanonicalConformanceModel_Documentations.xsl --suppressXsltNamespaceCheck:on 2>243_6_error.log
// clause 6 - single cc using Domain_model.xmi

Section author: Judith Crockford (AP243)