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

fixed name conversion

parent 5567cc83
No related branches found
No related tags found
No related merge requests found
...@@ -32,9 +32,9 @@ public class Main { ...@@ -32,9 +32,9 @@ public class Main {
} }
// parse the global not flatted petri net // parse the global not flatted petri net
// pnmlPath = "../pnml-relast-nets/src/main/resources/signalFlatteningTestNets/inputsignal-simple-3.pnml"; // pnmlPath = "/home/sebastian/git/dineros/pnml-relast-tools/pnml-relast-nets/src/main/resources/useCaseNets/RoboticUseCase-TopLayer.pnml";
//String pnmlPath = "../pnml-relast-nets/src/main/resources/serviceTestNets/structureTestNets/service-structure-correct.pnml"; //String pnmlPath = "../pnml-relast-nets/src/main/resources/serviceTestNets/structureTestNets/service-structure-correct.pnml";
//String configPath = "src/main/config/config.json"; configPath = "src/main/config/config.json";
PetriNet petriNet = PnmlParser.parsePnml(pnmlPath).get(0); PetriNet petriNet = PnmlParser.parsePnml(pnmlPath).get(0);
// read config for analyzer from file // read config for analyzer from file
...@@ -80,7 +80,7 @@ public class Main { ...@@ -80,7 +80,7 @@ public class Main {
logger.error("[FLATTER] Converting to net format."); logger.error("[FLATTER] Converting to net format.");
NdrioProxy ndrioProxy = new NdrioProxy(); NdrioProxy ndrioProxy = new NdrioProxy();
String homeDirectory = System.getProperty("user.dir"); String homeDirectory = System.getProperty("user.dir");
String ndrioTargetPath = homeDirectory + "/temp/net/" + UUID.randomUUID().toString() + "flatted-" + exportId + ".net"; String ndrioTargetPath = homeDirectory + "/temp/net/" + UUID.randomUUID() + "flatted-" + exportId + ".net";
ndrioProxy.pnml2net(pnmlExportPath, ndrioTargetPath); ndrioProxy.pnml2net(pnmlExportPath, ndrioTargetPath);
// insert into tina // insert into tina
......
...@@ -25,6 +25,8 @@ public class ChannelFlatter { ...@@ -25,6 +25,8 @@ public class ChannelFlatter {
// construct signal-id to transition mapping // construct signal-id to transition mapping
for (Transition t : petriNet.allTransitions()) { for (Transition t : petriNet.allTransitions()) {
if(t.asInputSignalTransition().getStaticInputSignalBindingList() != null) {
for (InputSignalBinding isb : t.asInputSignalTransition().getStaticInputSignalBindingList()) { for (InputSignalBinding isb : t.asInputSignalTransition().getStaticInputSignalBindingList()) {
if (signalMap.containsKey(isb.getInputSignalID())) { if (signalMap.containsKey(isb.getInputSignalID())) {
...@@ -36,6 +38,7 @@ public class ChannelFlatter { ...@@ -36,6 +38,7 @@ public class ChannelFlatter {
} }
} }
} }
}
// build clauses // build clauses
int signalCount = 0; int signalCount = 0;
...@@ -453,7 +456,14 @@ public class ChannelFlatter { ...@@ -453,7 +456,14 @@ public class ChannelFlatter {
newTi.setType(PnmlConstants.TRANSITION_TYPE_DISCRETE); newTi.setType(PnmlConstants.TRANSITION_TYPE_DISCRETE);
channelTransition.setMutualTransitionInformation(newTi); channelTransition.setMutualTransitionInformation(newTi);
Name nChannelPlace = new Name();
nChannelPlace.setText(TemplateConstants.CHANNEL_CONNECTOR_PLACE + "-" + channelCount);
channelPlace.setName(nChannelPlace);
channelPlace.setId(TemplateConstants.CHANNEL_CONNECTOR_PLACE + "-" + channelCount); channelPlace.setId(TemplateConstants.CHANNEL_CONNECTOR_PLACE + "-" + channelCount);
Name nChannelTransition = new Name();
nChannelTransition.setText(TemplateConstants.CHANNEL_CONNECTOR_TRANSITION + "-" + channelCount);
channelTransition.setName(nChannelTransition);
channelTransition.setId(TemplateConstants.CHANNEL_CONNECTOR_TRANSITION + "-" + channelCount); channelTransition.setId(TemplateConstants.CHANNEL_CONNECTOR_TRANSITION + "-" + channelCount);
Page topPage = petriNet.getPage(0); Page topPage = petriNet.getPage(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment