Skip to content
Snippets Groups Projects
Commit 74db660d authored by Sebastian Ebert's avatar Sebastian Ebert
Browse files

extended export, added flattener test nets

parent 545e9d48
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,8 @@ aspect ComplexElementsConverter{ ...@@ -50,7 +50,8 @@ aspect ComplexElementsConverter{
} }
for (int i = 0; i < petriNet.getNumToolspecific(); i++) { for (int i = 0; i < petriNet.getNumToolspecific(); i++) {
if (petriNet.getToolspecific(i).getFormattedXMLBuffer().indexOf("</toolspecific>") > -1) { if (petriNet.getToolspecific(i).getFormattedXMLBuffer() != null &&
petriNet.getToolspecific(i).getFormattedXMLBuffer().indexOf("</toolspecific>") > -1) {
pn.addToolspecificsHLAPI(new ToolInfoHLAPI(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(), pn.addToolspecificsHLAPI(new ToolInfoHLAPI(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
clipToolSpecificsFormattedXmlBuffer(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(), clipToolSpecificsFormattedXmlBuffer(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
......
...@@ -158,6 +158,11 @@ aspect ToolSpecificsParser{ ...@@ -158,6 +158,11 @@ aspect ToolSpecificsParser{
try { try {
Document doc = parseToolSpecifics(toolInfos); Document doc = parseToolSpecifics(toolInfos);
if(doc == null){
return inputSignalDefs;
}
org.w3c.dom.NodeList sDefList = doc.getElementsByTagName(PnmlConstants.INPUT_SIGNALS_DEF); org.w3c.dom.NodeList sDefList = doc.getElementsByTagName(PnmlConstants.INPUT_SIGNALS_DEF);
if (sDefList.getLength() > 0 && sDefList.item(0) != null) { if (sDefList.getLength() > 0 && sDefList.item(0) != null) {
...@@ -496,6 +501,10 @@ aspect ToolSpecificsParser{ ...@@ -496,6 +501,10 @@ aspect ToolSpecificsParser{
private static Document parseToolSpecifics(JastAddList<ToolInfo> toolInfos) throws ParserConfigurationException, SAXException, IOException { private static Document parseToolSpecifics(JastAddList<ToolInfo> toolInfos) throws ParserConfigurationException, SAXException, IOException {
if (toolInfos == null || toolInfos.getNumChild() == 0 || toolInfos.getChild(0).getFormattedXMLBuffer() == null) {
return null;
}
ToolInfo ti = null; ToolInfo ti = null;
for (ToolInfo toolInfo : toolInfos) { for (ToolInfo toolInfo : toolInfos) {
......
...@@ -6,16 +6,6 @@ ...@@ -6,16 +6,6 @@
<text>ServiceNet</text> <text>ServiceNet</text>
</name> </name>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<!-- <communicators>
<communicator>
<cType>serviceClient</cType>
<cSubnet>s1</cSubnet>
</communicator>
<communicator>
<cType>serviceServer</cType>
<cSubnet>s2</cSubnet>
</communicator>
</communicators>-->
</toolspecific> </toolspecific>
<page id="top"> <page id="top">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
...@@ -62,7 +52,7 @@ ...@@ -62,7 +52,7 @@
<serviceName>sampleService</serviceName> <serviceName>sampleService</serviceName>
<serverInput>serverIn</serverInput> <serverInput>serverIn</serverInput>
<serverOutput>serverOut</serverOutput> <serverOutput>serverOut</serverOutput>
<serverCapacity>16</serverCapacity> <serverCapacity>1</serverCapacity>
<channels> <channels>
<channel> <channel>
<cid>c1</cid> <cid>c1</cid>
......
<?xml version="1.0" encoding="UTF-8"?>
<pnml
xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="n-E2D0-BCF46-0" type="http://www.pnml.org/version-2009/grammar/ptnet">
<name>
<text>ServiceNet</text>
</name>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
</toolspecific>
<page id="top">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>dinerosPage</type>
</toolspecific>
<page id="sourcePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>serverPrototype</type>
<serviceName>sampleService0</serviceName>
</toolspecific>
<place id="serverIn0">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n2</node>
<subnet>s2</subnet>
</toolspecific>
<name>
<text>serverIn0</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="serverOut0">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n2</node>
<subnet>s2</subnet>
</toolspecific>
<name>
<text>serverOut0</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="req0">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
</toolspecific>
<name>
<text>req0</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="res0">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
</toolspecific>
<name>
<text>res0</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
</page>
<transition id="serviceTransition0">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>serviceTransitionType</type>
<serviceName>sampleService0</serviceName>
<serverInput>serverIn0</serverInput>
<serverOutput>serverOut0</serverOutput>
<serverCapacity>1</serverCapacity>
<channels>
<channel>
<cid>c1</cid>
<request>req1</request>
<response>res1</response>
</channel>
</channels>
</toolspecific>
<name>
<text>serviceTransition0</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</transition>
<transition id="serviceTransition1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>serviceTransitionType</type>
<serviceName>sampleService1</serviceName>
<serverInput>serverIn1</serverInput>
<serverOutput>serverOut1</serverOutput>
<serverCapacity>1</serverCapacity>
<channels>
<channel>
<cid>c1</cid>
<request>req0</request>
<response>res0</response>
</channel>
</channels>
</toolspecific>
<name>
<text>serviceTransition1</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</transition>
<page id="targetPage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>serverPrototype</type>
<serviceName>sampleService1</serviceName>
</toolspecific>
<place id="serverIn1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n2</node>
<subnet>s2</subnet>
</toolspecific>
<name>
<text>serverIn1</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="serverOut1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n2</node>
<subnet>s2</subnet>
</toolspecific>
<name>
<text>serverOut1</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="req1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
</toolspecific>
<name>
<text>req1</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
<place id="res1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
</toolspecific>
<name>
<text>res1</text>
<graphics>
<offset x="0" y="0" />
</graphics>
</name>
<graphics>
<position x="0" y="0" />
</graphics>
</place>
</page>
</page>
</net>
</pnml>
...@@ -16,6 +16,14 @@ ...@@ -16,6 +16,14 @@
<inputsignalID>is2</inputsignalID> <inputsignalID>is2</inputsignalID>
<initialvalue>false</initialvalue> <initialvalue>false</initialvalue>
</inputsignal> </inputsignal>
<inputsignal>
<inputsignalID>is3</inputsignalID>
<initialvalue>true</initialvalue>
</inputsignal>
<inputsignal>
<inputsignalID>is4</inputsignalID>
<initialvalue>false</initialvalue>
</inputsignal>
</inputsignals> </inputsignals>
</toolspecific> </toolspecific>
<page id="top"> <page id="top">
...@@ -24,7 +32,7 @@ ...@@ -24,7 +32,7 @@
<node>n1</node> <node>n1</node>
<subnet>s1</subnet> <subnet>s1</subnet>
<type>discreteTransitionType</type> <type>discreteTransitionType</type>
<inputsignalclause>(is1 OR NOT is2) AND (is1 OR is2)</inputsignalclause> <inputsignalclause>(is1 OR NOT is2) AND (is3 OR is4)</inputsignalclause>
</toolspecific> </toolspecific>
<name> <name>
<text>transition</text> <text>transition</text>
......
<?xml version="1.0" encoding="UTF-8"?>
<pnml
xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="n-E2D0-BCF46-0" type="http://www.pnml.org/version-2009/grammar/ptnet">
<name>
<text>SignalNet</text>
</name>
<!-- read via attribute -->
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<inputsignals>
<inputsignal>
<inputsignalID>is1</inputsignalID>
<initialvalue>true</initialvalue>
</inputsignal>
</inputsignals>
</toolspecific>
<page id="top">
<transition id="t1">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
<type>discreteTransitionType</type>
<inputsignalclause>(is1)</inputsignalclause>
</toolspecific>
<name>
<text>t1</text>
</name>
</transition>
<transition id="t2">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>n1</node>
<subnet>s1</subnet>
<type>discreteTransitionType</type>
<inputsignalclause>(is1)</inputsignalclause>
</toolspecific>
<name>
<text>t2</text>
</name>
</transition>
</page>
</net>
</pnml>
...@@ -6,24 +6,6 @@ ...@@ -6,24 +6,6 @@
<text>ServiceNet2</text> <text>ServiceNet2</text>
</name> </name>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<!-- <communicators>
<communicator>
<cType>serviceClient</cType>
<cSubnet>s1</cSubnet>
</communicator>
<communicator>
<cType>serviceClient</cType>
<cSubnet>s2</cSubnet>
</communicator>
<communicator>
<cType>serviceServer</cType>
<cSubnet>s2</cSubnet>
</communicator>
<communicator>
<cType>serviceServer</cType>
<cSubnet>s3</cSubnet>
</communicator>
</communicators>-->
</toolspecific> </toolspecific>
<page id="top"> <page id="top">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment