diff --git a/src/main/jastadd/flatter/transforms/ServiceChannelTransforms.jadd b/src/main/jastadd/flatter/transforms/ServiceChannelTransforms.jadd index 4f99a82b294beacf659e49ecf0613a266c6b934b..10253045a9b3bba5e52a4b28e56d500a5b6ca25a 100644 --- a/src/main/jastadd/flatter/transforms/ServiceChannelTransforms.jadd +++ b/src/main/jastadd/flatter/transforms/ServiceChannelTransforms.jadd @@ -4,14 +4,51 @@ aspect ServiceChannelTransforms { return this.getStaticTransitionInformation().isServiceTransitionInformation(); } - syn Page Page.transformServiceElement() { + syn Page DinerosTransition.transformServiceElement() { Page res = new Page(); - - - - + System.out.println("Transforming service transition: " + this.getId()); + ServiceTransitionInformation sti = this.getStaticTransitionInformation().asServiceTransitionInformation(); + res.setId(TemplateConstants.CHANNEL_SERVICE_PAGE_PREFIX + "-" + sti.getServiceName()); + + // apply rule S1 + int sc = 0; + for(ServiceChannel clientChannel: sti.getClientChannels()){ + Map<String, Node> clientMap = new HashMap<>(); + clientMap.put(TemplateConstants.SERVICE_CAN_CALL_REF_PLACE + "-" + sti.getServiceName() + "-" + sc, petriNet().getPlaceById(clientChannel.getRequestPlaceId())); + clientMap.put(TemplateConstants.SERVICE_CAN_RESP_REF_PLACE + "-" + sti.getServiceName() + "-" + sc, petriNet().getPlaceById(clientChannel.getRequestPlaceId())); + PetriNet clientNet = ServiceTemplates.getServiceConnectionTemplate(sti.getServiceName() + "-" + sc); + TransformationUtils.includeTemplateInstance(res, petriNet(), clientNet, clientMap); + sc++; + } + + // apply rule S3 + for(int i = 0; i < sti.getServerChannel().getCapacity(); i++){ + Page instancePage = petriNet().getPlaceById(sti.getServerChannel().getRequestPlaceId()).ContainingPage(); + PetriNet serviceInterfaceNet = ServiceTemplates.getServiceServerInterfaceTemplate(sti.getServiceName() + "-" + i); + TransformationUtils.includeTemplateInstance(instancePage, petriNet(), serviceInterfaceNet); + + // apply rule S2 + int sc2 = 0; + for(ServiceChannel clientChannel: sti.getClientChannels()){ + Map<String, Node> multiplexerMap = new HashMap<>(); + multiplexerMap.put(TemplateConstants.SERVICE_CALL_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(TemplateConstants.SERVICE_CON_CLIENT_CALL_PLACE + "-" + sc2)); + multiplexerMap.put(TemplateConstants.SERVICE_RESP_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(TemplateConstants.SERVICE_CON_CLIENT_RESP_PLACE + "-" + sc2)); + multiplexerMap.put(TemplateConstants.SERVICE_ACTIVE_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(TemplateConstants.SERVICE_ACTIVE_PLACE + "-" + i)); + multiplexerMap.put(TemplateConstants.SERVICE_INACTIVE_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(TemplateConstants.SERVICE_INACTIVE_PLACE + "-" + i)); + multiplexerMap.put(TemplateConstants.SERVICE_ENTRY_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(sti.getServerChannel().getRequestPlaceId())); + multiplexerMap.put(TemplateConstants.SERVICE_EXIT_M_REF_PLACE + + "-" + sti.getServiceName() + "-" + sc2, petriNet().getPlaceById(sti.getServerChannel().getResponsePlaceId())); + PetriNet multiplexerNet = ServiceTemplates.getServiceMultiplexerTemplate(sti.getServiceName() + "-" + i + "-" + sc2); + TransformationUtils.includeTemplateInstance(res, petriNet(), multiplexerNet, multiplexerMap); + sc2++; + } + } return res; } - } \ No newline at end of file diff --git a/src/main/jastadd/flatter/transforms/ServicePrototypeTransforms.jadd b/src/main/jastadd/flatter/transforms/ServicePrototypeTransforms.jadd index e9e0f4c5493a578915742835f7a039ca5f15843f..36ad739df466307c87a918ef22ddf2944d967bb4 100644 --- a/src/main/jastadd/flatter/transforms/ServicePrototypeTransforms.jadd +++ b/src/main/jastadd/flatter/transforms/ServicePrototypeTransforms.jadd @@ -8,7 +8,7 @@ aspect ServicePrototypeTransforms { && (!getId().endsWith(PnmlConstants.PAGE_SERVER_INSTANCE_SUFFIX))); } - // apply rule S3 + // apply rule S4 syn Page Page.transformPrototypePage() { int serverCapacity = 0; diff --git a/src/main/jastadd/flatter/transforms/TopicTransforms.jadd b/src/main/jastadd/flatter/transforms/TopicTransforms.jadd index 493a3948c711739dc15a020ed18651a7c96c6e85..7fad60e2b29f92d81b6a4c74bab6af4ef86a2a3b 100644 --- a/src/main/jastadd/flatter/transforms/TopicTransforms.jadd +++ b/src/main/jastadd/flatter/transforms/TopicTransforms.jadd @@ -20,8 +20,8 @@ aspect TopicTransforms { pTopic.setId(TemplateConstants.CHANNEL_TOPIC_PLACE + "-" + tti.getTopic()); PlaceInformation pi = new PlaceInformation(); - pi.setSubNet("channel"); - pi.setNode("channel"); + pi.setSubNet(PnmlConstants.CHANNEL); + pi.setNode(PnmlConstants.CHANNEL); pTopic.setMutablePlaceInformation(pi); pTopic.getInitialMarking().setText(0); Name pName = new Name(); @@ -33,8 +33,8 @@ aspect TopicTransforms { tTopic.setId(TemplateConstants.CHANNEL_TOPIC_TRANSITION + "-" + tti.getTopic()); SignalTransitionInformation sti = new SignalTransitionInformation(); - sti.setSubNet("channel"); - sti.setNode("channel"); + sti.setSubNet(PnmlConstants.CHANNEL); + sti.setNode(PnmlConstants.CHANNEL); Name tName = new Name(); tName.setText(TemplateConstants.CHANNEL_TOPIC_TRANSITION + "-" + tti.getTopic()); tTopic.setName(tName); @@ -49,7 +49,7 @@ aspect TopicTransforms { pubMap.put(TemplateConstants.PLACE_TOPIC_PUBLISHER_REF + "-" + tti.getTopic() + "-" + i, petriNet().getPlaceById(pp.getPlaceId())); pubMap.put(TemplateConstants.PLACE_TOPIC_PUBLISHER_CHANNEL_REF + "-" + tti.getTopic() + "-" + i, pTopic); PetriNet pubNet = TopicTemplates.getTopicPublisherPetriNet(tti.getTopic() + "-" + i, pp.getLimit()); - TransformationUtils.includeTemplateInstance(res, petriNet(), pubNet, "channel", "channel", pubMap); + TransformationUtils.includeTemplateInstance(res, petriNet(), pubNet, pubMap); i++; } @@ -73,7 +73,7 @@ aspect TopicTransforms { dispatchMap.put(TemplateConstants.TRANSITION_TOPIC_DISPATCHER_CHANNEL_REF + "-" + tti.getTopic() + "-" + j, tTopic); // TODO: make capacity configurable PetriNet dispatchNet = TopicTemplates.getTopicDispatcherPetriNet(tti.getTopic() + "-" + j, 16); - Map<String, PnObject> addedObjects = TransformationUtils.includeTemplateInstance(res, petriNet(), dispatchNet, "channel", "channel", dispatchMap); + Map<String, PnObject> addedObjects = TransformationUtils.includeTemplateInstance(res, petriNet(), dispatchNet, dispatchMap); // apply rule T4 int k = 0; @@ -83,7 +83,7 @@ aspect TopicTransforms { subMap.put(TemplateConstants.TRANSITION_TOPIC_CALLBACK_INPUT_REF + "-" + tti.getTopic() + "-" + j + "-" + k, addedObjects.get(TemplateConstants.DISPATCHER_OUTPUT_TRANSITION + "-" + tti.getTopic() + "-" + j).asNode()); PetriNet callbackNet = TopicTemplates.getTopicCallbackQueuePetriNet(tti.getTopic() + "-" + j + "-" + k, sp.getLimit()); - TransformationUtils.includeTemplateInstance(res, petriNet(), callbackNet, "channel", "channel", subMap); + TransformationUtils.includeTemplateInstance(res, petriNet(), callbackNet, subMap); k++; } j++; diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java index 3cdc3b8da1fca1bf5b9e80f663f75825c9513a25..e6ce7a4a1343a5eea1597446865a5e3e1d8ec25c 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java @@ -3,7 +3,6 @@ package de.tudresden.inf.st.pnml.flatter; import de.tudresden.inf.st.jastadd.dumpAst.ast.DumpBuilder; import de.tudresden.inf.st.jastadd.dumpAst.ast.Dumper; import de.tudresden.inf.st.jastadd.dumpAst.ast.SkinParamBooleanSetting; -import de.tudresden.inf.st.jastadd.dumpAst.ast.TransformationException; import de.tudresden.inf.st.pnml.flatter.config.ConfigReader; import de.tudresden.inf.st.pnml.flatter.tina.KtzioProxy; import de.tudresden.inf.st.pnml.flatter.tina.SiftProxy; @@ -25,7 +24,7 @@ import java.util.UUID; public class Main { - public static void main(String[] args) throws IOException, InvalidIDException, TransformationException { + public static void main(String[] args) throws InvalidIDException { String configPath = (args.length > 1) ? args[1] : null; String pnmlPath = (args.length > 0) ? args[0] : null; @@ -58,7 +57,17 @@ public class Main { } // [STAGE 3] Transform service transitions - // TODO + for(DinerosTransition dt : petriNet.allDinerosTransitions()){ + if(dt.canTransformServiceTransition()){ + Page serviceTransformedPage = dt.transformServiceElement(); + for ( int i = 0; i < dt.ContainingPage().getNumObject(); i++ ){ + if(dt.ContainingPage().getObject(i).getId().equals(dt.getId())){ + dt.ContainingPage().setObject(serviceTransformedPage, i); + } + } + petriNet.flushTreeCache(); + } + } // [STAGE 4] Transform signals // TODO diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/ServiceTemplates.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/ServiceTemplates.java index 6a77a7ce7a6988c6a8844269f6d5967af85f08a3..21f9fbe756b8d9e271967c1242025037b1848762 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/ServiceTemplates.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/ServiceTemplates.java @@ -1,33 +1,30 @@ package de.tudresden.inf.st.pnml.flatter.template; -import de.tudresden.inf.st.pnml.jastadd.model.Name; import de.tudresden.inf.st.pnml.jastadd.model.PetriNet; import de.tudresden.inf.st.pnml.jastadd.model.PnObject; import de.tudresden.inf.st.pnml.jastadd.model.PnmlParser; +import org.jetbrains.annotations.NotNull; public class ServiceTemplates extends PnmlTemplate{ public static PetriNet getServiceConnectionTemplate(String idSuffix){ + return getPetriNetTemplate(idSuffix, "/src/main/resources/templates/ServiceConnectionTemplate.pnml"); + } - PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + "/src/main/resources/templates/ServiceConnectionTemplate.pnml").get(0); - - for(PnObject po : templateNet.allObjects()){ - if(!po.getId().equals(TemplateConstants.SERVICE_TEMPLATE_PAGE)){ - updatePnObjectIdAndName(po, idSuffix); - } - } - - return templateNet; + public static PetriNet getServiceMultiplexerTemplate(String idSuffix){ + return getPetriNetTemplate(idSuffix, "/src/main/resources/templates/ServiceMultiplexerTemplate.pnml"); } - public static PetriNet getQueueConnectionTemplate(String idSuffix){ + public static PetriNet getServiceServerInterfaceTemplate(String idSuffix){ + return getPetriNetTemplate(idSuffix, "/src/main/resources/templates/ServiceServerInterfaceTemplate.pnml"); + } - PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + "/src/main/resources/templates/ServiceQueueTemplate.pnml").get(0); + @NotNull + private static PetriNet getPetriNetTemplate(String idSuffix, String netPath) { + PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + netPath).get(0); - for(PnObject po : templateNet.allObjects()){ - if(!po.getId().equals(TemplateConstants.SERVICE_QUEUE_TEMPLATE_PAGE)){ - updatePnObjectIdAndName(po, idSuffix); - } + for (PnObject po : templateNet.allObjects()) { + updatePnObjectIdAndName(po, idSuffix); } return templateNet; diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java index b7f30d5c779b978a5f39ef54e0ad923e81868c30..d3d2a77dcd54e3fa9a71ded64fa009b2557a83db 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java @@ -38,6 +38,7 @@ public final class TemplateConstants { public static final String CHANNEL_TOPIC_PLACE = "ChannelConnectorPlace"; public static final String CHANNEL_TOPIC_TRANSITION = "ChannelConnectorTransition"; public static final String CHANNEL_TOPIC_PAGE_PREFIX = "ChannelTopicPage"; + public static final String CHANNEL_SERVICE_PAGE_PREFIX = "ChannelServicePage"; // signal elements public static final String INPUT_SIGNAL_TEMPLATE_PAGE = "InputSignalTemplatePage"; @@ -54,20 +55,31 @@ public final class TemplateConstants { public static final String ARC_TRUE_TO_T_INACTIVE = "DINEROS-ArcTrueToTInactive"; // services - public static final String SERVICE_THREAD_PLACE = "ServiceThreadPlace"; - public static final String SERVICE_CLIENT_INPUT_TRANSITION = "ServiceClientInputTransition"; - public static final String SERVICE_CLIENT_OUTPUT_TRANSITION = "ServiceClientOutputTransition"; - public static final String SERVICE_SERVER_INPUT_TRANSITION = "ServiceServerInputTransition"; - public static final String SERVICE_SERVER_OUTPUT_TRANSITION = "ServiceServerOutputTransition"; - public static final String SERVICE_QUEUE_INPUT_PLACE = "ServiceQueueInputPlace"; - public static final String SERVICE_CLIENT_CONNECTOR_TRANSITION = "ServiceClientConnectorTransition"; - public static final String SERVICE_QUEUE_OUTPUT_PLACE = "ServiceQueueOutputPlace"; - public static final String SERVICE_QUEUE_CAPACITY_PLACE = "ServiceQueueCapacityPlace"; - public static final String SERVICE_FEEDBACK_PLACE = "ServiceFeedbackPlace"; + // S3 + public static final String SERVICE_ACTIVE_PLACE = "ServiceCallMultiActivePlace"; + public static final String SERVICE_INACTIVE_PLACE = "ServiceCallMultiInactivePlace"; + // S2 + public static final String SERVICE_FLAG_PLACE = "ServiceCallMultiFlagPlace"; + public static final String SERVICE_CALL_ENTRY_TRANS = "ServiceCallMultiEntryTransition"; + public static final String SERVICE_CALL_EXIT_TRANS = "ServiceCallMultiExitTransition"; + public static final String SERVICE_CALL_M_REF_PLACE = "ServiceCallMultiCallRefPlace"; + public static final String SERVICE_RESP_M_REF_PLACE = "ServiceCallMultiRespRefPlace"; + public static final String SERVICE_INACTIVE_M_REF_PLACE = "ServiceCallMultiInactiveRefPlace"; + public static final String SERVICE_ACTIVE_M_REF_PLACE = "ServiceCallMultiActiveRefPlace"; + public static final String SERVICE_ENTRY_M_REF_PLACE = "ServiceCallMultiEntryRefPlace"; + public static final String SERVICE_EXIT_M_REF_PLACE = "ServiceCallMultiExitRefPlace"; + // S1 + public static final String SERVICE_CON_TOGGLE_PLACE = "ServiceTogglePlace"; + public static final String SERVICE_CON_CLIENT_CALL_CON_PLACE = "ServiceClientCallConnectPlace"; + public static final String SERVICE_CON_CLIENT_RESP_CON_PLACE = "ServiceClientRespConnectPlace"; + public static final String SERVICE_CON_CLIENT_CALL_PLACE = "ServiceClientCallPlace"; + public static final String SERVICE_CON_CLIENT_RESP_PLACE = "ServiceClientRespPlace"; + public static final String SERVICE_CON_CALL_CON_TRANS = "ServiceClientCallConnectTransition"; + public static final String SERVICE_CON_RESP_CON_TRANS = "ServiceClientRespConnectTransition"; + public static final String SERVICE_CON_CALL_TRANS = "ServiceClientCallTransition"; + public static final String SERVICE_CON_RESP_TRANS = "ServiceClientRespTransition"; + public static final String SERVICE_CAN_CALL_REF_PLACE = "ServiceCallRefPlace"; + public static final String SERVICE_CAN_RESP_REF_PLACE = "ServiceRespRefPlace"; - public static final String SERVICE_QUEUE_TO_SERVER_PLACE = "ServiceQueueToServerPlace"; - public static final String SERVICE_TO_QUEUE_PLACE = "ServiceToQueuePlace"; - public static final String SERVICE_QUEUE_CONNECTOR_TRANSITION = "ServiceQueueConnectorTransition"; - public static final String SERVICE_QUEUE_OVERFLOW_TRANSITION = "ServiceQueueOverflowTransition"; } diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java index cbf962e4cb482e7d0f5f96a5a90e1c83dbf0bad4..ca234416f4238a69371498a1034c501dff0e845e 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java @@ -40,6 +40,20 @@ public class TransformationUtils { return a; } + public static Map<String, PnObject> includeTemplateInstance(Page page, PetriNet petriNet, PetriNet templateInstance, Map<String, Node> refs) { + return includeTemplateInstance(page, petriNet, templateInstance, "channel", "channel", refs); + } + + public static Map<String, PnObject> includeTemplateInstance(Page page, PetriNet petriNet, PetriNet templateInstance) { + Map<String, Node> refs = new HashMap<>(); + return includeTemplateInstance(page, petriNet, templateInstance, "channel", "channel", refs); + } + + public static Map<String, PnObject> includeTemplateInstance(Page page, PetriNet petriNet, PetriNet templateInstance, String subnet, String node) { + Map<String, Node> refs = new HashMap<>(); + return includeTemplateInstance(page, petriNet, templateInstance, subnet, node, refs); + } + public static Map<String, PnObject> includeTemplateInstance(Page page, PetriNet petriNet, PetriNet templateInstance, String subnet, String node, Map<String, Node> refs) { Map<String, PnObject> addedObjects = new HashMap<>(); diff --git a/src/main/resources/templates/ServiceMultiPlexerTemplate.pnml b/src/main/resources/templates/ServiceMultiPlexerTemplate.pnml new file mode 100644 index 0000000000000000000000000000000000000000..b928541abb666078c711004c923a2628ed624234 --- /dev/null +++ b/src/main/resources/templates/ServiceMultiPlexerTemplate.pnml @@ -0,0 +1,187 @@ +<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> + <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> + <name> + <text>DinerosTemplate</text> + </name> + <page id="DinerosTemplatePage"> + <place id="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>ServiceCallMultiFlagPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <transition id="ServiceCallMultiEntryTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>ServiceCallMultiEntryTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="ServiceCallMultiExitTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>ServiceCallMultiExitTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiCallRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiCallRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiRespRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiRespRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiInactiveRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiInactiveRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiActiveRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiActiveRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiEntryRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiEntryRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="ServiceCallMultiExitRefPlace" ref="ServiceCallMultiFlagPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>ServiceCallMultiExitRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + + <arc id="arc-1" source="ServiceCallMultiCallRefPlace" target="ServiceCallMultiInTransition"> + </arc> + <arc id="arc-2" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiActiveRefPlace"> + </arc> + <arc id="arc-3" source="ServiceCallMultiActiveRefPlace" target="ServiceCallMultiExitTransition"> + </arc> + <arc id="arc-4" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiFlagPlace"> + </arc> + <arc id="arc-5" source="ServiceCallMultiFlagPlace" target="ServiceCallMultiExitTransition"> + </arc> + <arc id="arc-6" source="ServiceCallMultiExitTransition" target="ServiceCallMultiInactiveRefPlace"> + </arc> + <arc id="arc-7" source="ServiceCallMultiInactiveRefPlace" target="ServiceCallMultiEntryTransition"> + </arc> + <arc id="arc-8" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiEntryRefPlace"> + </arc> + <arc id="arc-9" source="ServiceCallMultiExitRefPlace" target="ServiceCallMultiExitTransition"> + </arc> + <arc id="arc-10" source="ServiceCallMultiExitTransition" target="ServiceCallMultiRespRefPlace"> + </arc> + </page> + </net> +</pnml> \ No newline at end of file diff --git a/src/main/resources/templates/ServiceQueueTemplate.pnml b/src/main/resources/templates/ServiceQueueTemplate.pnml deleted file mode 100644 index d81b46e72cc81239549276b79236458e30340a5b..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/ServiceQueueTemplate.pnml +++ /dev/null @@ -1,130 +0,0 @@ -<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> - <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> - <name> - <text>DinerosTemplate</text> - </name> - <page id="ServiceQueueTemplatePage"> - <place id="ServiceQueueCapacityPlace"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <location>none</location> - <subnet>none</subnet> - <type>discretePlaceType</type> - <outputsignalbindings> - </outputsignalbindings> - </toolspecific> - <name> - <text>ServiceQueueCapacityPlace</text> - <graphics> - <offset x="0" y="0" /> - </graphics> - </name> - <initialMarking> - <text>16</text> - </initialMarking> - <graphics> - <position x="0" y="0"/> - </graphics> - </place> - - <place id="ServiceQueueOutputPlace"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <location>none</location> - <subnet>none</subnet> - <type>discretePlaceType</type> - <outputsignalbindings> - </outputsignalbindings> - </toolspecific> - <name> - <text>ServiceQueueOutputPlace</text> - <graphics> - <offset x="0" y="0" /> - </graphics> - </name> - <initialMarking> - <text>0</text> - </initialMarking> - <graphics> - <position x="0" y="0"/> - </graphics> - </place> - - <place id="ServiceQueueInputPlace"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <location>none</location> - <subnet>none</subnet> - <type>discretePlaceType</type> - <outputsignalbindings> - </outputsignalbindings> - </toolspecific> - <name> - <text>ServiceQueueInputPlace</text> - <graphics> - <offset x="0" y="0" /> - </graphics> - </name> - <initialMarking> - <text>0</text> - </initialMarking> - <graphics> - <position x="0" y="0"/> - </graphics> - </place> - - <transition id="ServiceQueueInputTransition"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <location>none</location> - <subnet>none</subnet> - <type>discreteTransitionType</type> - <inputsignalbindings> - </inputsignalbindings> - <inputsignalclause></inputsignalclause> - </toolspecific> - <name> - <text>ServiceQueueInputTransition</text> - <graphics> - <offset x="0" y="0" /> - </graphics> - </name> - <graphics> - <position x="0" y="0"/> - </graphics> - </transition> - - <transition id="ServiceQueueOverflowTransition"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <location>none</location> - <subnet>none</subnet> - <type>discreteTransitionType</type> - <inputsignalbindings> - </inputsignalbindings> - <inputsignalclause></inputsignalclause> - </toolspecific> - <name> - <text>ServiceQueueOverflowTransition</text> - <graphics> - <offset x="0" y="0" /> - </graphics> - </name> - <graphics> - <position x="0" y="0"/> - </graphics> - </transition> - - <arc id="arc-sqt-1" source="ServiceQueueCapacityPlace" target="ServiceQueueOverflowTransition"> - <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> - <type>inhibitor</type> - </toolspecific> - </arc> - <arc id="arc-sqt-2" source="ServiceQueueCapacityPlace" target="ServiceQueueInputTransition"> - </arc> - <arc id="arc-sqt-3" source="ServiceQueueInputTransition" target="ServiceQueueOutputPlace"> - </arc> - <arc id="arc-sqt-4" source="ServiceQueueInputPlace" target="ServiceQueueInputTransition"> - </arc> - <arc id="arc-sqt-5" source="ServiceQueueInputPlace" target="ServiceQueueOverflowTransition"> - </arc> - <arc id="arc-sqt-6" source="ServiceQueueOutputPlace" target="ServiceQueueOverflowTransition"> - </arc> - </page> - </net> -</pnml> \ No newline at end of file diff --git a/src/main/resources/templates/ServiceServerInterfaceTemplate.pnml b/src/main/resources/templates/ServiceServerInterfaceTemplate.pnml new file mode 100644 index 0000000000000000000000000000000000000000..b40f02e15b5235eee7e9ab4e99dc9c5277660242 --- /dev/null +++ b/src/main/resources/templates/ServiceServerInterfaceTemplate.pnml @@ -0,0 +1,51 @@ +<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> + <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> + <name> + <text>DinerosTemplate</text> + </name> + <page id="DinerosTemplatePage"> + <place id="ServiceCallMultiActivePlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>ServiceCallMultiActivePlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + <place id="ServiceCallMultiInactivePlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>ServiceCallMultiInactivePlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>1</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + </page> + </net> +</pnml> \ No newline at end of file