|
@@ -55,19 +55,19 @@ def assign_names(pm_model: pm_as.ProcessModel) -> typing.Dict[pm_as.Element, str
|
|
|
|
|
|
|
|
def write_pm_oml(
|
|
def write_pm_oml(
|
|
|
input_filename: str,
|
|
input_filename: str,
|
|
|
|
|
+ input_page: dio_as.Page,
|
|
|
pm_model: pm_as.ProcessModel,
|
|
pm_model: pm_as.ProcessModel,
|
|
|
pm_names: typing.Dict[pm_as.Element, str],
|
|
pm_names: typing.Dict[pm_as.Element, str],
|
|
|
ostream: io.TextIOBase,
|
|
ostream: io.TextIOBase,
|
|
|
- output_namespace: str = "http://ua.be/sdo2l/description/artifacts/my_pm",
|
|
|
|
|
namespaces=util.DTDESIGN_NAMESPACES):
|
|
namespaces=util.DTDESIGN_NAMESPACES):
|
|
|
"""
|
|
"""
|
|
|
Generate an OML description of a process model.
|
|
Generate an OML description of a process model.
|
|
|
Parameters:
|
|
Parameters:
|
|
|
input_filename: has no precise semantics - only written to the output in a comment
|
|
input_filename: has no precise semantics - only written to the output in a comment
|
|
|
|
|
+ input_page: only used to determine the name of the model
|
|
|
pm_model: the parsed process model to write as an OML description
|
|
pm_model: the parsed process model to write as an OML description
|
|
|
pm_names: mapping from every element in the process model to a unique name
|
|
pm_names: mapping from every element in the process model to a unique name
|
|
|
ostream: stream to write OML output to (e.g., stdout, a file, ...)
|
|
ostream: stream to write OML output to (e.g., stdout, a file, ...)
|
|
|
- output_namespace: namespace for the to-be-generated OML description
|
|
|
|
|
namespaces: namespaces of vocabularies to use
|
|
namespaces: namespaces of vocabularies to use
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
@@ -80,29 +80,30 @@ def write_pm_oml(
|
|
|
for piece in template.generate(
|
|
for piece in template.generate(
|
|
|
model=pm_model,
|
|
model=pm_model,
|
|
|
input_filename=input_filename,
|
|
input_filename=input_filename,
|
|
|
|
|
+ input_page=input_page,
|
|
|
enumerate=enumerate,
|
|
enumerate=enumerate,
|
|
|
concat=util.concat,
|
|
concat=util.concat,
|
|
|
pm_names=pm_names,
|
|
pm_names=pm_names,
|
|
|
types=TYPENAMES,
|
|
types=TYPENAMES,
|
|
|
- output_namespace=output_namespace,
|
|
|
|
|
|
|
+ output_namespace=namespaces['artifacts']+input_page.name+"_pm",
|
|
|
|
|
+ shorthand=input_page.name+"_pm",
|
|
|
namespaces=namespaces):
|
|
namespaces=namespaces):
|
|
|
ostream.write(piece)
|
|
ostream.write(piece)
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_corr_oml(
|
|
def write_corr_oml(
|
|
|
input_filename: str,
|
|
input_filename: str,
|
|
|
|
|
+ input_page: dio_as.Page,
|
|
|
traceability_links: typing.List[trace_as.TraceabilityLink],
|
|
traceability_links: typing.List[trace_as.TraceabilityLink],
|
|
|
drawio_names: typing.Dict[dio_as.Element, str],
|
|
drawio_names: typing.Dict[dio_as.Element, str],
|
|
|
pm_names: typing.Dict[pm_as.Element, str],
|
|
pm_names: typing.Dict[pm_as.Element, str],
|
|
|
ostream: io.TextIOBase,
|
|
ostream: io.TextIOBase,
|
|
|
- drawio_descr_namespace: str= "http://ua.be/sdo2l/description/artifacts/my_drawio",
|
|
|
|
|
- pm_descr_namespace: str= "http://ua.be/sdo2l/description/artifacts/my_pm",
|
|
|
|
|
- output_namespace: str = "http://ua.be/sdo2l/description/artifacts/my_corr",
|
|
|
|
|
namespaces=util.DTDESIGN_NAMESPACES):
|
|
namespaces=util.DTDESIGN_NAMESPACES):
|
|
|
"""
|
|
"""
|
|
|
Generate an OML description of the traceability links between a Drawio-description and a PM-description.
|
|
Generate an OML description of the traceability links between a Drawio-description and a PM-description.
|
|
|
Parameters:
|
|
Parameters:
|
|
|
input_filename: has no precise semantics - only written to the output in a comment
|
|
input_filename: has no precise semantics - only written to the output in a comment
|
|
|
|
|
+ input_page: only used to determine the name of the model
|
|
|
traceability_links: list of traceability links to write as an OML description
|
|
traceability_links: list of traceability links to write as an OML description
|
|
|
ostream: stream to write OML output to (e.g., stdout, a file, ...)
|
|
ostream: stream to write OML output to (e.g., stdout, a file, ...)
|
|
|
output_namespace: namespace for the to-be-generated OML description
|
|
output_namespace: namespace for the to-be-generated OML description
|
|
@@ -118,11 +119,13 @@ def write_corr_oml(
|
|
|
pm_names=pm_names,
|
|
pm_names=pm_names,
|
|
|
drawio_names=drawio_names,
|
|
drawio_names=drawio_names,
|
|
|
input_filename=input_filename,
|
|
input_filename=input_filename,
|
|
|
|
|
+ input_page=input_page,
|
|
|
enumerate=enumerate,
|
|
enumerate=enumerate,
|
|
|
concat=util.concat,
|
|
concat=util.concat,
|
|
|
types=TYPENAMES,
|
|
types=TYPENAMES,
|
|
|
- drawio_descr_namespace=drawio_descr_namespace,
|
|
|
|
|
- pm_descr_namespace=pm_descr_namespace,
|
|
|
|
|
- output_namespace=output_namespace,
|
|
|
|
|
|
|
+ drawio_descr_namespace=namespaces['artifacts']+input_page.name+"_drawio",
|
|
|
|
|
+ pm_descr_namespace=namespaces['artifacts']+input_page.name+"_pm",
|
|
|
|
|
+ output_namespace=namespaces['artifacts']+input_page.name+"_corr",
|
|
|
|
|
+ shorthand=input_page.name+"_corr",
|
|
|
namespaces=namespaces):
|
|
namespaces=namespaces):
|
|
|
ostream.write(piece)
|
|
ostream.write(piece)
|