Permalink
Browse files

SAVARA-330 - define interface details when deriving local and global …

…protocols from scenarios
  • Loading branch information...
1 parent 24bb05d commit ab84f94f6caaed27f6cd104c71cf7cc4dec6c28b objectiser committed May 16, 2012
Showing with 129 additions and 0 deletions.
  1. +24 −0 bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/Annotation.java
  2. +24 −0 ...savara.protocol/src/main/java/org/savara/protocol/internal/aggregator/ProtocolAggregatorImpl.java
  3. +4 −0 bundles/org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/global/Purchasing.spr
  4. +4 −0 bundles/org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/global/Purchasing2.spr
  5. +2 −0 ...org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing2@Buyer.spr
  6. +1 −0 ...ara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing2@CreditAgency.spr
  7. +1 −0 ...savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing2@Logistics.spr
  8. +3 −0 ...org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing2@Store.spr
  9. +2 −0 .../org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing@Buyer.spr
  10. +1 −0 ...vara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing@CreditAgency.spr
  11. +1 −0 ....savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing@Logistics.spr
  12. +3 −0 .../org.savara.protocol/src/test/resources/testmodels/protocol/aggregator/local/Purchasing@Store.spr
  13. +2 −0 ...ara.protocol/src/test/resources/testmodels/protocol/aggregator/scenario/CustomerUnknown@Buyer.spr
  14. +1 −0 ...tocol/src/test/resources/testmodels/protocol/aggregator/scenario/CustomerUnknown@CreditAgency.spr
  15. +2 −0 ...ara.protocol/src/test/resources/testmodels/protocol/aggregator/scenario/CustomerUnknown@Store.spr
  16. +2 −0 ....protocol/src/test/resources/testmodels/protocol/aggregator/scenario/InsufficientCredit@Buyer.spr
  17. +1 −0 ...ol/src/test/resources/testmodels/protocol/aggregator/scenario/InsufficientCredit@CreditAgency.spr
  18. +2 −0 ....protocol/src/test/resources/testmodels/protocol/aggregator/scenario/InsufficientCredit@Store.spr
  19. +2 −0 ....protocol/src/test/resources/testmodels/protocol/aggregator/scenario/SuccessfulPurchase@Buyer.spr
  20. +1 −0 ...ol/src/test/resources/testmodels/protocol/aggregator/scenario/SuccessfulPurchase@CreditAgency.spr
  21. +1 −0 ...tocol/src/test/resources/testmodels/protocol/aggregator/scenario/SuccessfulPurchase@Logistics.spr
  22. +3 −0 ....protocol/src/test/resources/testmodels/protocol/aggregator/scenario/SuccessfulPurchase@Store.spr
  23. +25 −0 ...vara.scenario/src/main/java/org/savara/scenario/internal/protocol/ProtocolModelGeneratorImpl.java
  24. +2 −0 bundles/org.savara.scenario/src/test/resources/protocols/CustomerUnknown@Buyer.spr
  25. +1 −0 bundles/org.savara.scenario/src/test/resources/protocols/CustomerUnknown@CreditAgency.spr
  26. +2 −0 bundles/org.savara.scenario/src/test/resources/protocols/CustomerUnknown@Store.spr
  27. +2 −0 bundles/org.savara.scenario/src/test/resources/protocols/InsufficientCredit@Buyer.spr
  28. +1 −0 bundles/org.savara.scenario/src/test/resources/protocols/InsufficientCredit@CreditAgency.spr
  29. +2 −0 bundles/org.savara.scenario/src/test/resources/protocols/InsufficientCredit@Store.spr
  30. +2 −0 bundles/org.savara.scenario/src/test/resources/protocols/SuccessfulPurchase@Buyer.spr
  31. +1 −0 bundles/org.savara.scenario/src/test/resources/protocols/SuccessfulPurchase@CreditAgency.spr
  32. +1 −0 bundles/org.savara.scenario/src/test/resources/protocols/SuccessfulPurchase@Logistics.spr
  33. +3 −0 bundles/org.savara.scenario/src/test/resources/protocols/SuccessfulPurchase@Store.spr
@@ -98,6 +98,30 @@ protected void setName(String name) {
return(m_properties);
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+
+ if (obj instanceof Annotation) {
+ Annotation other=(Annotation)obj;
+
+ if (getName().equals(other.getName()) &&
+ getProperties().equals(other.getProperties())) {
+ return (true);
+ }
+ }
+
+ return (false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ return(getName().hashCode());
+ }
+
public String toString() {
StringBuffer buf=new StringBuffer();
@@ -23,6 +23,7 @@
import org.savara.common.logging.FeedbackHandler;
import org.savara.protocol.aggregator.ProtocolAggregator;
import org.savara.protocol.internal.aggregator.LocalProtocolUnit.ActivityCursor;
+import org.scribble.common.model.Annotation;
import org.scribble.protocol.model.Activity;
import org.scribble.protocol.model.Block;
import org.scribble.protocol.model.Choice;
@@ -69,6 +70,11 @@ public ProtocolModel aggregateGlobalModel(java.util.Collection<ProtocolModel> lo
GlobalProtocolUnit gpu=new GlobalProtocolUnit(ret);
for (ProtocolModel local : locals) {
+
+ // Merge annotations
+ mergeAnnotations(ret.getProtocol().getAnnotations(),
+ local.getProtocol().getAnnotations(), handler);
+
if (protocol.getName() == null) {
protocol.setName(local.getProtocol().getName());
} else if (!protocol.getName().equals(local.getProtocol().getName())) {
@@ -221,6 +227,11 @@ public ProtocolModel aggregateLocalModel(String protocolName,
String introducingRole=null;
for (ProtocolModel lm : locals) {
+
+ // Merge annotations
+ mergeAnnotations(ret.getProtocol().getAnnotations(),
+ lm.getProtocol().getAnnotations(), handler);
+
if (role == null) {
role = lm.getProtocol().getLocatedRole();
} else if (!role.equals(lm.getProtocol().getLocatedRole())) {
@@ -327,6 +338,19 @@ protected void mergeImports(ProtocolModel aggregated, java.util.Collection<Proto
}
}
+ protected void mergeAnnotations(java.util.Collection<Annotation> main,
+ java.util.Collection<Annotation> source, FeedbackHandler handler) {
+
+ for (Annotation ann : source) {
+ if (ann instanceof org.savara.common.model.annotation.Annotation) {
+ if (!main.contains(ann)) {
+ main.add(new org.savara.common.model.annotation.Annotation(
+ (org.savara.common.model.annotation.Annotation)ann));
+ }
+ }
+ }
+ }
+
protected void mergePaths(java.util.List<Block> sourcePaths, Block targetPath,
FeedbackHandler handler) {
if (sourcePaths.size() == 0) {
@@ -7,6 +7,10 @@ import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditR
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing(role Buyer) {
Buyer introduces Store;
Store introduces CreditAgency;
@@ -7,6 +7,10 @@ import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditR
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing(role Buyer) {
Buyer introduces Store;
Store introduces CreditAgency;
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol Purchasing at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,6 +1,7 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol Purchasing at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing at Logistics(role Store) {
[[ Correlation(request=deliver) ]]
deliver(DeliveryRequest) from Store;
@@ -7,6 +7,9 @@ import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol Purchasing at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,6 +1,7 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol Purchasing at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing at Logistics(role Store) {
[[ Correlation(request=deliver) ]]
deliver(DeliveryRequest) from Store;
@@ -7,6 +7,9 @@ import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol Purchasing at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol CustomerUnknown at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol CustomerUnknown at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol CustomerUnknown at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol InsufficientCredit at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol InsufficientCredit at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol InsufficientCredit at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol SuccessfulPurchase at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol SuccessfulPurchase at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol SuccessfulPurchase at Logistics(role Store) {
[[ Correlation(request=deliver) ]]
deliver(DeliveryRequest) from Store;
@@ -4,6 +4,9 @@ import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditR
import xsd "{http://www.jboss.org/examples/logistics}DeliveryRequest" as DeliveryRequest;
import xsd "{http://www.jboss.org/examples/logistics}DeliveryConfirmed" as DeliveryConfirmed;
import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
+[[ Interface(name=LogisticsInterface,role=Logistics,namespace=http://namespace/Logistics) ]]
protocol SuccessfulPurchase at Store(role Buyer) {
Store introduces CreditAgency, Logistics;
[[ Correlation(request=buy) ]]
@@ -56,6 +56,9 @@
*/
public class ProtocolModelGeneratorImpl implements ProtocolModelGenerator {
+ private static final String NAMESPACE_PREFIX = "http://namespace/";
+ private static final String INTERFACE_SUFFIX = "Interface";
+
/**
* {@inheritDoc}
*/
@@ -213,6 +216,8 @@ protected ProtocolModel getProtocolModel(MessageEvent event,
ret.getProtocol().setLocatedRole(new org.scribble.protocol.model.Role(role));
ret.getProtocol().setBlock(new Block());
+ createInterface(ret.getProtocol(), role);
+
if (event instanceof ReceiveEvent) {
// Need to find send event's role
for (Link link : scenario.getLink()) {
@@ -254,6 +259,8 @@ protected ProtocolModel getProtocolModel(MessageEvent event,
if (intro.getIntroducedRole(otherRole) == null) {
intro.getIntroducedRoles().add(new org.scribble.protocol.model.Role(otherRole));
+
+ createInterface(ret.getProtocol(), otherRole);
}
}
@@ -266,6 +273,24 @@ protected ProtocolModel getProtocolModel(MessageEvent event,
}
/**
+ * This method creates an interface annotation for the supplied role
+ * on the supplied protocol.
+ *
+ * @param p The protocol
+ * @param role The role
+ */
+ protected void createInterface(Protocol p, String role) {
+ Annotation annotation=new Annotation(AnnotationDefinitions.INTERFACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAMESPACE_PROPERTY,
+ NAMESPACE_PREFIX+role);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
+ role+INTERFACE_SUFFIX);
+ annotation.getProperties().put(AnnotationDefinitions.ROLE_PROPERTY,
+ role);
+ p.getAnnotations().add(annotation);
+ }
+
+ /**
* This method determines if this message event relates to a request.
*
* @param me The message event
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol CustomerUnknown at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol CustomerUnknown at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CustomerUnknown" as CustomerUnknown;
import xsd "{http://www.jboss.org/examples/store}AccountNotFound" as AccountNotFound;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol CustomerUnknown at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol InsufficientCredit at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol InsufficientCredit at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
@@ -2,6 +2,8 @@ import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
import xsd "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed;
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol InsufficientCredit at Store(role Buyer) {
Store introduces CreditAgency;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,7 @@
import xsd "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest;
import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed;
+[[ Interface(name=BuyerInterface,role=Buyer,namespace=http://namespace/Buyer) ]]
+[[ Interface(name=StoreInterface,role=Store,namespace=http://namespace/Store) ]]
protocol SuccessfulPurchase at Buyer {
Buyer introduces Store;
[[ Correlation(request=buy) ]]
@@ -1,5 +1,6 @@
import xsd "{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" as CreditCheckRequest;
import xsd "{http://www.jboss.org/examples/creditAgency}CreditRating" as CreditRating;
+[[ Interface(name=CreditAgencyInterface,role=CreditAgency,namespace=http://namespace/CreditAgency) ]]
protocol SuccessfulPurchase at CreditAgency(role Store) {
[[ Correlation(request=checkCredit) ]]
checkCredit(CreditCheckRequest) from Store;
Oops, something went wrong.

0 comments on commit ab84f94

Please sign in to comment.