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

fixed processor, updated test nets

parent d23ef604
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,14 @@ public class Main {
public static void main(String[] args) {
/* String inputPath = (args.length > 0) ? args[0] : null;
String inputPath = (args.length > 0) ? args[0] : null;
if (inputPath == null) {
logger.error("No model found on given input path.");
return;
}*/
}
List<PetriNet> petriNets = PnmlParser.parsePnml("/home/sebastian/git/dineros-v2/dineros/pnml-relast-tools/pnml-relast-splitter/src/main/nets/TestNet1.pnml");
// List<PetriNet> petriNets = PnmlParser.parsePnml(inputPath);
List<PetriNet> petriNets = PnmlParser.parsePnml(inputPath);
List<List<PetriNet>> disconnectedPetriNets = new ArrayList<>();
GlobalToLocalNetsPostProcessor processor = new GlobalToLocalNetsPostProcessor();
......
......@@ -300,7 +300,13 @@ public class GlobalToLocalNetsPostProcessor implements PostProcessor<PetriNet> {
private void buildPlaceInfoListPart(Document doc, Element ports, Map<String, List<DinerosPlace>> map, String placeType) {
for (Map.Entry<String, List<DinerosPlace>> entry : map.entrySet()) {
System.out.println("- " + entry.getKey());
for (DinerosPlace dp : entry.getValue()) {
System.out.println("- - - " + dp.getId());
Element port = doc.createElement(PnmlConstants.CHANNEL_PORT_KEY);
port.appendChild(doc.createTextNode(dp.getId()));
......@@ -362,6 +368,7 @@ public class GlobalToLocalNetsPostProcessor implements PostProcessor<PetriNet> {
buildPlaceInfoListServerPart(doc, ports, serviceServerReqPlaces, PnmlConstants.CHANNEL_PLACE_TYPE_SERVER_REQ_KEY);
buildPlaceInfoListServerPart(doc, ports, serviceServerResPlaces, PnmlConstants.CHANNEL_PLACE_TYPE_SERVER_RES_KEY);
if(ci.getCommunicatorMapping().keySet().size() > 0) {
Element coms = doc.createElement(PnmlConstants.COMMUNICATORS);
for (String s : ci.getCommunicatorMapping().keySet()) {
......@@ -378,6 +385,8 @@ public class GlobalToLocalNetsPostProcessor implements PostProcessor<PetriNet> {
}
rootElement.appendChild(coms);
}
rootElement.appendChild(ports);
TransformerFactory tf = TransformerFactory.newInstance();
......
......@@ -25,7 +25,7 @@
</page>
<transition id="sampleTopic">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>topic</type>
<type>topicTransitionType</type>
<topicName>sampleTopic</topicName>
<publishers>
<publisher>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment