|
@@ -19,16 +19,24 @@ def parse(parent: dio_as.Cell) -> (ftg_as.FTG, List[trace_as.TraceabilityLink]):
|
|
|
|
|
|
|
|
for cell in parent.children:
|
|
for cell in parent.children:
|
|
|
if cell.properties["pmRole"] == "transformation":
|
|
if cell.properties["pmRole"] == "transformation":
|
|
|
- t = ftg_as.Transformation(
|
|
|
|
|
- name=cell.properties["name"],
|
|
|
|
|
- ctrl_in=[port.properties["portname"] for port in cell.children if port.properties["pmRole"] == "ctrl_in"],
|
|
|
|
|
- ctrl_out=[port.properties["portname"] for port in cell.children if port.properties["pmRole"] == "ctrl_out"],
|
|
|
|
|
- data_in=[(port.properties["portname"], name_to_formalism[port.incoming[0].source.properties["name"]]) for port in cell.children if port.properties["pmRole"] == "data_in"],
|
|
|
|
|
- data_out=[(port.properties["portname"], name_to_formalism[port.outgoing[0].target.properties["name"]]) for port in cell.children if port.properties["pmRole"] == "data_out"],
|
|
|
|
|
- automated="automated" in cell.properties and cell.properties["automated"]=="true")
|
|
|
|
|
|
|
+ properties = {
|
|
|
|
|
+ "name": cell.properties["name"],
|
|
|
|
|
+ "ctrl_in": [port.properties["portname"] for port in cell.children if port.properties["pmRole"] == "ctrl_in"],
|
|
|
|
|
+ "ctrl_out": [port.properties["portname"] for port in cell.children if port.properties["pmRole"] == "ctrl_out"],
|
|
|
|
|
+ "data_in": [(port.properties["portname"], name_to_formalism[port.incoming[0].source.properties["name"]]) for port in cell.children if port.properties["pmRole"] == "data_in"],
|
|
|
|
|
+ "data_out": [(port.properties["portname"], name_to_formalism[port.outgoing[0].target.properties["name"]]) for port in cell.children if port.properties["pmRole"] == "data_out"],
|
|
|
|
|
+ }
|
|
|
|
|
+ if "automated" in cell.properties and cell.properties["automated"]=="true":
|
|
|
|
|
+ t = ftg_as.AutomatedTransformation(
|
|
|
|
|
+ **properties,
|
|
|
|
|
+ service_endpoint=cell.properties["serviceEndpoint"],
|
|
|
|
|
+ )
|
|
|
|
|
+ else:
|
|
|
|
|
+ t = ftg_as.Transformation(**properties)
|
|
|
transformations.append(t)
|
|
transformations.append(t)
|
|
|
tracelinks.append(trace_as.TraceabilityLink(dio=cell, ftg=t))
|
|
tracelinks.append(trace_as.TraceabilityLink(dio=cell, ftg=t))
|
|
|
|
|
|
|
|
return (ftg_as.FTG(
|
|
return (ftg_as.FTG(
|
|
|
formalisms=formalisms,
|
|
formalisms=formalisms,
|
|
|
- transformations=transformations), tracelinks)
|
|
|
|
|
|
|
+ transformations=transformations),
|
|
|
|
|
+ tracelinks)
|