Author: objectiser
Date: 2011-01-05 11:17:24 -0500 (Wed, 05 Jan 2011)
New Revision: 533
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.spr
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpelex
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpelOLD
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileParserRule.java
Removed:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.scv
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/generator/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/OnMessageGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceGenerationRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileGenerationRule.java
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/parser/ParserTest.java
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Broker.spr
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Buyer.spr
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/TypeReferenceUtil.java
Log:
Changed parser rules to be packaged under the parser, rather than the generator, as this
was confusing. Also sorted out the third parser test.
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -20,8 +20,9 @@
package org.savara.bpel.parser;
import org.savara.bpel.BPELDefinitions;
-import org.savara.bpel.generator.protocol.DefaultConversionContext;
+import org.savara.bpel.model.TPartnerLink;
import org.savara.bpel.model.TProcess;
+import org.savara.bpel.parser.rules.DefaultConversionContext;
import org.savara.bpel.util.BPELModelUtil;
import org.scribble.common.resource.ResourceLocator;
import org.scribble.common.logging.Journal;
@@ -59,6 +60,17 @@
//String convType=getConversationType();
String role=null;
+ // Search the partner links to see if a 'myRole' has been defined
+ if (process.getPartnerLinks() != null) {
+ for (TPartnerLink pl : process.getPartnerLinks().getPartnerLink()) {
+ if (pl.getMyRole() != null && pl.getMyRole().trim().length() > 0) {
+ role = pl.getMyRole();
+ protocol.setRole(new Role(role));
+ break;
+ }
+ }
+ }
+
// Convert the process contents
DefaultConversionContext context=new DefaultConversionContext(role, process, locator);
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol)
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ConversionContext.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import org.savara.bpel.model.TProcess;
-import org.savara.bpel.model.TScope;
-import org.savara.bpel.model.TVariable;
-import org.scribble.common.resource.ResourceLocator;
-import org.scribble.protocol.model.Activity;
-
-public interface ConversionContext {
-
- /**
- * This method applies the conversion process to the supplied component.
- *
- * @param component The domain component
- * @param activities The list of protocol activities to place the conversion results
- */
- public void convert(Object component, java.util.List<Activity> activities);
-
- /**
- * This method returns a reference to the resource locator.
- *
- * @return The resource locator
- */
- public ResourceLocator getResourceLocator();
-
- /**
- * This method returns the process.
- *
- * @return The process
- */
- public TProcess getProcess();
-
- /**
- * This method returns the role associated with the
- * endpoint being converted.
- *
- *@return The role
- */
- public String getRole();
-
- /**
- * This method returns the variable associated with the
- * supplied name.
- *
- * @param name The name
- * @return The variable, or null if not found
- */
- public TVariable getVariable(String name);
-
- /**
- * This method adds a variable to the context.
- *
- * @param var The variable
- */
- public void addVariable(TVariable var);
-
- /**
- * This method removes a variable from the context.
- *
- * @param var The variable
- */
- public void removeVariable(TVariable var);
-
- /**
- * This method pushes the supplied scope on the stack.
- *
- * @param scope The scope
- */
- public void pushScope(TScope scope);
-
- /**
- * This method pops the top scope from the stack.
- *
- */
- public void popScope();
-
- /**
- * This method returns the current scope.
- *
- * @return The scope, or null if not within a scope
- */
- public TScope getScope();
-
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java
(from rev 531,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ConversionContext.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ConversionContext.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.model.TScope;
+import org.savara.bpel.model.TVariable;
+import org.scribble.common.logging.Journal;
+import org.scribble.common.resource.ResourceLocator;
+import org.scribble.protocol.model.Activity;
+
+public interface ConversionContext {
+
+ /**
+ * This method applies the conversion process to the supplied component.
+ *
+ * @param component The domain component
+ * @param activities The list of protocol activities to place the conversion results
+ */
+ public void convert(Object component, java.util.List<Activity> activities, Journal
journal);
+
+ /**
+ * This method returns a reference to the resource locator.
+ *
+ * @return The resource locator
+ */
+ public ResourceLocator getResourceLocator();
+
+ /**
+ * This method returns the process.
+ *
+ * @return The process
+ */
+ public TProcess getProcess();
+
+ /**
+ * This method returns the role associated with the
+ * endpoint being converted.
+ *
+ *@return The role
+ */
+ public String getRole();
+
+ /**
+ * This method returns the variable associated with the
+ * supplied name.
+ *
+ * @param name The name
+ * @return The variable, or null if not found
+ */
+ public TVariable getVariable(String name);
+
+ /**
+ * This method adds a variable to the context.
+ *
+ * @param var The variable
+ */
+ public void addVariable(TVariable var);
+
+ /**
+ * This method removes a variable from the context.
+ *
+ * @param var The variable
+ */
+ public void removeVariable(TVariable var);
+
+ /**
+ * This method pushes the supplied scope on the stack.
+ *
+ * @param scope The scope
+ */
+ public void pushScope(TScope scope);
+
+ /**
+ * This method pops the top scope from the stack.
+ *
+ */
+ public void popScope();
+
+ /**
+ * This method returns the current scope.
+ *
+ * @return The scope, or null if not within a scope
+ */
+ public TScope getScope();
+
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/DefaultConversionContext.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,174 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import org.savara.bpel.model.TProcess;
-import org.savara.bpel.model.TScope;
-import org.savara.bpel.model.TVariable;
-import org.scribble.common.resource.ResourceLocator;
-import org.scribble.protocol.model.Activity;
-
-/**
- * This class provides a default implementation of the conversation
- * context.
- */
-public class DefaultConversionContext implements ConversionContext {
-
- private String m_role=null;
- private TProcess m_process=null;
- private ResourceLocator m_resourceLocator=null;
- private java.util.Map<String,TVariable> m_variables=
- new java.util.HashMap<String,TVariable>();
- private java.util.Stack<TScope> m_scopeStack=new java.util.Stack<TScope>();
-
- private static java.util.List<ProtocolGenerationRule> m_rules=
- new java.util.Vector<ProtocolGenerationRule>();
-
- static {
- m_rules.add(new ElseGenerationRule());
- m_rules.add(new ElseifGenerationRule());
- m_rules.add(new FlowGenerationRule());
- m_rules.add(new IfGenerationRule());
- m_rules.add(new InvokeGenerationRule());
- m_rules.add(new OnMessageGenerationRule());
- m_rules.add(new PickGenerationRule());
- m_rules.add(new ProcessGenerationRule());
- m_rules.add(new ReceiveGenerationRule());
- m_rules.add(new ReplyGenerationRule());
- m_rules.add(new ScopeGenerationRule());
- m_rules.add(new SequenceGenerationRule());
- m_rules.add(new WhileGenerationRule());
- }
-
- /**
- * This is the constructor for the conversion context, initialised
- * with the role being played by the converted BPEL process.
- *
- * @param role The role
- * @param proc The process
- * @param locator The resource locator
- */
- public DefaultConversionContext(String role, TProcess proc, ResourceLocator locator) {
- m_role = role;
- m_process = proc;
- m_resourceLocator = locator;
- }
-
- /**
- * This method applies the conversion process to the supplied component.
- *
- * @param component The domain component
- * @param activities The list of protocol activities to place the conversion results
- */
- public void convert(Object component, java.util.List<Activity> activities) {
- ProtocolGenerationRule rule=null;
-
- for (int i=0; rule == null && i < m_rules.size(); i++) {
- if (m_rules.get(i).isSupported(component)) {
- rule = m_rules.get(i);
- }
- }
-
- if (rule != null) {
- rule.convert(this, component, activities);
- }
- }
-
- /**
- * This method returns a reference to the environment context.
- *
- * @return The environment context
- */
- public ResourceLocator getResourceLocator() {
- return(m_resourceLocator);
- }
-
- /**
- * This method returns the process.
- *
- * @return The process
- */
- public TProcess getProcess() {
- return(m_process);
- }
-
- /**
- * This method returns the role associated with the
- * endpoint being converted.
- *
- *@return The role
- */
- public String getRole() {
- return(m_role);
- }
-
- /**
- * This method returns the variable associated with the
- * supplied name.
- *
- * @param name The name
- * @return The variable, or null if not found
- */
- public TVariable getVariable(String name) {
- return(m_variables.get(name));
- }
-
- /**
- * This method adds a variable to the context.
- *
- * @param var The variable
- */
- public void addVariable(TVariable var) {
- m_variables.put(var.getName(), var);
- }
-
- /**
- * This method removes a variable from the context.
- *
- * @param var The variable
- */
- public void removeVariable(TVariable var) {
- m_variables.remove(var.getName());
- }
-
- /**
- * This method pushes the supplied scope on the stack.
- *
- * @param scope The scope
- */
- public void pushScope(TScope scope) {
- m_scopeStack.push(scope);
- }
-
- /**
- * This method pops the top scope from the stack.
- *
- */
- public void popScope() {
- m_scopeStack.pop();
- }
-
- /**
- * This method returns the current scope.
- *
- * @return The scope, or null if not within a scope
- */
- public TScope getScope() {
- return(m_scopeStack.peek());
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java
(from rev 531,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/DefaultConversionContext.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/DefaultConversionContext.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.model.TScope;
+import org.savara.bpel.model.TVariable;
+import org.scribble.common.logging.Journal;
+import org.scribble.common.resource.ResourceLocator;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class provides a default implementation of the conversation
+ * context.
+ */
+public class DefaultConversionContext implements ConversionContext {
+
+ private String m_role=null;
+ private TProcess m_process=null;
+ private ResourceLocator m_resourceLocator=null;
+ private java.util.Map<String,TVariable> m_variables=
+ new java.util.HashMap<String,TVariable>();
+ private java.util.Stack<TScope> m_scopeStack=new java.util.Stack<TScope>();
+
+ private static java.util.List<ProtocolParserRule> m_rules=
+ new java.util.Vector<ProtocolParserRule>();
+
+ static {
+ m_rules.add(new ElseParserRule());
+ m_rules.add(new ElseifParserRule());
+ m_rules.add(new FlowParserRule());
+ m_rules.add(new IfParserRule());
+ m_rules.add(new InvokeParserRule());
+ //m_rules.add(new OnMessageGenerationRule());
+ m_rules.add(new PickParserRule());
+ m_rules.add(new ProcessParserRule());
+ m_rules.add(new ReceiveParserRule());
+ m_rules.add(new ReplyParserRule());
+ m_rules.add(new ScopeParserRule());
+ m_rules.add(new SequenceParserRule());
+ m_rules.add(new WhileParserRule());
+ }
+
+ /**
+ * This is the constructor for the conversion context, initialised
+ * with the role being played by the converted BPEL process.
+ *
+ * @param role The role
+ * @param proc The process
+ * @param locator The resource locator
+ */
+ public DefaultConversionContext(String role, TProcess proc, ResourceLocator locator) {
+ m_role = role;
+ m_process = proc;
+ m_resourceLocator = locator;
+ }
+
+ /**
+ * This method applies the conversion process to the supplied component.
+ *
+ * @param component The domain component
+ * @param activities The list of protocol activities to place the conversion results
+ */
+ public void convert(Object component, java.util.List<Activity> activities, Journal
journal) {
+ ProtocolParserRule rule=null;
+
+ for (int i=0; rule == null && i < m_rules.size(); i++) {
+ if (m_rules.get(i).isSupported(component)) {
+ rule = m_rules.get(i);
+ }
+ }
+
+ if (rule != null) {
+ rule.convert(this, component, activities, journal);
+ }
+ }
+
+ /**
+ * This method returns a reference to the environment context.
+ *
+ * @return The environment context
+ */
+ public ResourceLocator getResourceLocator() {
+ return(m_resourceLocator);
+ }
+
+ /**
+ * This method returns the process.
+ *
+ * @return The process
+ */
+ public TProcess getProcess() {
+ return(m_process);
+ }
+
+ /**
+ * This method returns the role associated with the
+ * endpoint being converted.
+ *
+ *@return The role
+ */
+ public String getRole() {
+ return(m_role);
+ }
+
+ /**
+ * This method returns the variable associated with the
+ * supplied name.
+ *
+ * @param name The name
+ * @return The variable, or null if not found
+ */
+ public TVariable getVariable(String name) {
+ return(m_variables.get(name));
+ }
+
+ /**
+ * This method adds a variable to the context.
+ *
+ * @param var The variable
+ */
+ public void addVariable(TVariable var) {
+ m_variables.put(var.getName(), var);
+ }
+
+ /**
+ * This method removes a variable from the context.
+ *
+ * @param var The variable
+ */
+ public void removeVariable(TVariable var) {
+ m_variables.remove(var.getName());
+ }
+
+ /**
+ * This method pushes the supplied scope on the stack.
+ *
+ * @param scope The scope
+ */
+ public void pushScope(TScope scope) {
+ m_scopeStack.push(scope);
+ }
+
+ /**
+ * This method pops the top scope from the stack.
+ *
+ */
+ public void popScope() {
+ m_scopeStack.pop();
+ }
+
+ /**
+ * This method returns the current scope.
+ *
+ * @return The scope, or null if not within a scope
+ */
+ public TScope getScope() {
+ return(m_scopeStack.size() > 0 ? m_scopeStack.peek() : null);
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ElseGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TActivityContainer;
-import org.savara.bpel.util.ActivityUtil;
-import org.scribble.protocol.model.Activity;
-
-/**
- * This class represents the 'else' construct contained
- * within the 'if' activity.
- */
-public class ElseGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TActivityContainer);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TActivityContainer container=(TActivityContainer)component;
-
- TActivity act=ActivityUtil.getActivity(container);
-
- if (act != null) {
- context.convert(act, activities);
- }
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ElseGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TActivityContainer;
+import org.savara.bpel.util.ActivityUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'else' construct contained
+ * within the 'if' activity.
+ */
+public class ElseParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TActivityContainer);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TActivityContainer container=(TActivityContainer)component;
+
+ TActivity act=ActivityUtil.getActivity(container);
+
+ if (act != null) {
+ context.convert(act, activities, journal);
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ElseifGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TElseif;
-import org.savara.bpel.util.ActivityUtil;
-import org.scribble.protocol.model.Activity;
-
-/**
- * This class represents the 'elseif' construct contained
- * within the 'if' activity.
- */
-public class ElseifGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TElseif);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TElseif container=(TElseif)component;
-
- TActivity act=ActivityUtil.getActivity(container);
-
- if (act != null) {
- context.convert(act, activities);
- }
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ElseifGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ElseifParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TElseif;
+import org.savara.bpel.util.ActivityUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'elseif' construct contained
+ * within the 'if' activity.
+ */
+public class ElseifParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TElseif);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TElseif container=(TElseif)component;
+
+ TActivity act=ActivityUtil.getActivity(container);
+
+ if (act != null) {
+ context.convert(act, activities, journal);
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/FlowGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TFlow;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a flow grouping activity.
- *
- */
-public class FlowGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TFlow);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TFlow elem=(TFlow)component;
-
- //getSource().setComponentURI(getURI());
-
- // If links have been defined, represent them as boolean
- // variables that can be tested using a 'when' clause
-
- /* TODO: Basis for source link mechanism - but no variables
- * supported yet
- *
- if (getLinks().size() > 0) {
- org.scribble.conversation.model.VariableList vl=
- new org.scribble.conversation.model.VariableList();
-
- org.scribble.protocol.model.TypeReference tref=
- new org.scribble.protocol.model.TypeReference();
- tref.setName("boolean");
-
- vl.setType(tref);
-
- for (int i=0; i < getLinks().size(); i++) {
- Link l=getLinks().get(i);
-
- org.scribble.conversation.model.Variable var=
- new org.scribble.conversation.model.Variable();
-
- var.setName(l.getName());
-
- vl.getVariables().add(var);
- }
-
- activities.add(vl);
- }
- */
-
- org.scribble.protocol.model.Parallel parallel=
- new org.scribble.protocol.model.Parallel();
-
- for (int i=0; i < elem.getActivity().size(); i++) {
- Block b=new Block();
-
- context.convert(elem.getActivity().get(i), b.getContents());
-
- parallel.getBlocks().add(b);
- }
-
- activities.add(parallel);
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/FlowGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/FlowParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TFlow;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a flow grouping activity.
+ *
+ */
+public class FlowParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TFlow);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TFlow elem=(TFlow)component;
+
+ //getSource().setComponentURI(getURI());
+
+ // If links have been defined, represent them as boolean
+ // variables that can be tested using a 'when' clause
+
+ /* TODO: Basis for source link mechanism - but no variables
+ * supported yet
+ *
+ if (getLinks().size() > 0) {
+ org.scribble.conversation.model.VariableList vl=
+ new org.scribble.conversation.model.VariableList();
+
+ org.scribble.protocol.model.TypeReference tref=
+ new org.scribble.protocol.model.TypeReference();
+ tref.setName("boolean");
+
+ vl.setType(tref);
+
+ for (int i=0; i < getLinks().size(); i++) {
+ Link l=getLinks().get(i);
+
+ org.scribble.conversation.model.Variable var=
+ new org.scribble.conversation.model.Variable();
+
+ var.setName(l.getName());
+
+ vl.getVariables().add(var);
+ }
+
+ activities.add(vl);
+ }
+ */
+
+ org.scribble.protocol.model.Parallel parallel=
+ new org.scribble.protocol.model.Parallel();
+
+ for (int i=0; i < elem.getActivity().size(); i++) {
+ Block b=new Block();
+
+ context.convert(elem.getActivity().get(i), b.getContents(), journal);
+
+ parallel.getBlocks().add(b);
+ }
+
+ activities.add(parallel);
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/IfGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TElseif;
-import org.savara.bpel.model.TIf;
-import org.savara.bpel.util.ActivityUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents an 'if' grouping construct.
- *
- */
-public class IfGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TIf);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TIf bpelElem=(TIf)component;
-
- //getSource().setComponentURI(getURI());
-
- org.scribble.protocol.model.Choice elem=
- new org.scribble.protocol.model.Choice();
-
- When cb=new When();
-
- // TODO: Convert the conditional expression
-
- TActivity act=ActivityUtil.getActivity(bpelElem);
-
- if (act != null) {
- context.convert(act, cb.getBlock().getContents());
- }
-
- elem.getWhens().add(cb);
-
- // Convert 'else if' paths
- for (int i=0; i < bpelElem.getElseif().size(); i++) {
- TElseif elseIfElem=bpelElem.getElseif().get(i);
-
- cb = new When();
-
- context.convert(elseIfElem, cb.getBlock().getContents());
-
- elem.getWhens().add(cb);
- }
-
- // Convert 'else' path
- if (bpelElem.getElse() != null) {
- cb = new When();
-
- context.convert(bpelElem.getElse(), cb.getBlock().getContents());
-
- elem.getWhens().add(cb);
- }
-
- activities.add(elem);
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/IfGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/IfParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TElseif;
+import org.savara.bpel.model.TIf;
+import org.savara.bpel.util.ActivityUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents an 'if' grouping construct.
+ *
+ */
+public class IfParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TIf);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TIf bpelElem=(TIf)component;
+
+ //getSource().setComponentURI(getURI());
+
+ org.scribble.protocol.model.Choice elem=
+ new org.scribble.protocol.model.Choice();
+
+ When cb=new When();
+
+ // TODO: Convert the conditional expression
+
+ TActivity act=ActivityUtil.getActivity(bpelElem);
+
+ if (act != null) {
+ context.convert(act, cb.getBlock().getContents(), journal);
+
+ // Check if first activity is interaction
+ if (cb.getBlock().getContents().size() > 0 &&
+ cb.getBlock().getContents().get(0) instanceof Interaction) {
+ Interaction interaction=(Interaction)cb.getBlock().getContents().get(0);
+
+ cb.getBlock().getContents().remove(0);
+
+ cb.derivedFrom(interaction);
+
+ cb.setMessageSignature(interaction.getMessageSignature());
+
+ elem.setFromRole(interaction.getFromRole());
+
+ if (interaction.getToRoles().size() > 0) {
+ elem.setToRole(interaction.getToRoles().get(0));
+ }
+ } else {
+ journal.error("Main block of if does not contain an initial interaction",
null);
+ }
+ }
+
+ elem.getWhens().add(cb);
+
+ // Convert 'else if' paths
+ for (int i=0; i < bpelElem.getElseif().size(); i++) {
+ TElseif elseIfElem=bpelElem.getElseif().get(i);
+
+ cb = new When();
+
+ context.convert(elseIfElem, cb.getBlock().getContents(), journal);
+
+ setupWhenMs(elem, cb, journal);
+
+ elem.getWhens().add(cb);
+ }
+
+ // Convert 'else' path
+ if (bpelElem.getElse() != null) {
+ cb = new When();
+
+ context.convert(bpelElem.getElse(), cb.getBlock().getContents(), journal);
+
+ setupWhenMs(elem, cb, journal);
+
+ elem.getWhens().add(cb);
+ }
+
+ activities.add(elem);
+ }
+
+ protected void setupWhenMs(Choice elem, When cb, Journal journal) {
+
+ // Check if first activity is interaction
+ if (cb.getBlock().getContents().size() > 0 &&
+ cb.getBlock().getContents().get(0) instanceof Interaction) {
+ Interaction interaction=(Interaction)cb.getBlock().getContents().get(0);
+
+ cb.getBlock().getContents().remove(0);
+
+ cb.derivedFrom(interaction);
+
+ cb.setMessageSignature(interaction.getMessageSignature());
+
+ // Verify from/to roles
+ if (elem.getFromRole() != null) {
+ if (interaction.getFromRole() != null) {
+ if (elem.getFromRole().equals(interaction.getFromRole()) == false) {
+ journal.error("ElseIf path has interaction with incompatible 'from'
role", null);
+ }
+ } else {
+ journal.error("ElseIf path does not contain a required 'from'
role", null);
+ }
+ }
+ elem.setFromRole(interaction.getFromRole());
+
+ if (elem.getToRole() != null) {
+ if (interaction.getToRoles().size() > 0) {
+ if (elem.getToRole().equals(interaction.getToRoles().get(0)) == false) {
+ journal.error("ElseIf path has interaction with incompatible 'to'
role", null);
+ }
+ } else {
+ journal.error("ElseIf path does not contain a required 'to' role",
null);
+ }
+ }
+ } else {
+ journal.error("Main block of if does not contain an initial interaction",
null);
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/InvokeGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,229 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.savara.bpel.model.TCatch;
-import org.savara.bpel.model.TInvoke;
-import org.savara.bpel.model.TScope;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
-import org.savara.bpel.util.PartnerLinkUtil;
-import org.savara.bpel.util.TypeReferenceUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents an unsupported (or custom) action within
- * the conversation based ESB service descriptor.
- *
- */
-public class InvokeGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TInvoke);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TInvoke invoke=(TInvoke)component;
-
- //getSource().setComponentURI(getURI());
-
- convertRequest(invoke, activities, context);
-
- // Check if invoke is contained within a scope that defines
- // fault handlers. If so, then generate choice to throw
- // fault exceptions.
- TScope scope=context.getScope();
-
- if (scope != null && scope.getFaultHandlers() != null &&
- (scope.getFaultHandlers().getCatch().size() > 0 ||
- scope.getFaultHandlers().getCatchAll() != null)) {
- org.scribble.protocol.model.Choice te=
- new org.scribble.protocol.model.Choice();
- //te.derivedFrom(this);
-
- activities.add(te);
-
- org.scribble.protocol.model.When when=
- new org.scribble.protocol.model.When();
- te.getWhens().add(when);
-
- activities = when.getBlock().getContents();
-
- for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
- TCatch catchBlock=scope.getFaultHandlers().getCatch().get(i);
-
- org.scribble.protocol.model.When fcb=
- new org.scribble.protocol.model.When();
-
- QName mesgType=catchBlock.getFaultMessageType();
-
- if (mesgType == null) {
- mesgType = catchBlock.getFaultElement();
- }
-
- TVariable faultVar=null;
-
- if (catchBlock.getFaultVariable() != null) {
- faultVar = new TVariable();
- faultVar.setName(catchBlock.getFaultVariable());
- faultVar.setMessageType(catchBlock.getFaultMessageType());
- faultVar.setElement(catchBlock.getFaultElement());
- context.addVariable(faultVar);
- }
-
- convertFaultResponse(invoke, fcb.getBlock().getContents(),
catchBlock.getFaultVariable(),
- mesgType, context);
-
- org.scribble.protocol.model.Raise raise=
- new org.scribble.protocol.model.Raise();
-
- TypeReference tref=new TypeReference();
- tref.setName(catchBlock.getFaultName().getLocalPart());
- raise.setType(tref);
-
- fcb.getBlock().add(raise);
-
- te.getWhens().add(fcb);
-
- if (faultVar != null) {
- context.removeVariable(faultVar);
- }
- }
- }
-
- if (invoke.getOutputVariable() != null) {
-
- convertResponse(invoke, activities, context);
- }
- }
-
- protected static void convertRequest(TInvoke invoke, java.util.List<Activity>
activities,
- ConversionContext context) {
- // Create interaction for request
- Interaction interaction=new Interaction();
- //interaction.derivedFrom(this);
-
- TVariable var=context.getVariable(invoke.getInputVariable());
-
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
-
- MessageSignature ms=new MessageSignature();
- ms.setOperation(invoke.getOperation());
- ms.getTypeReferences().add(tref);
-
- if (context.getRole() != null) {
- interaction.setFromRole(new Role(context.getRole()));
- }
-
- String toRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
-
- if (toRole != null) {
- interaction.getToRoles().add(new Role(toRole));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
- }
-
- protected static void convertResponse(TInvoke invoke, java.util.List<Activity>
activities,
- ConversionContext context) {
-
- // Create interaction for request
- Interaction interaction=new Interaction();
- //interaction.derivedFrom(this);
-
- TVariable var=context.getVariable(invoke.getOutputVariable());
-
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
-
- MessageSignature ms=new MessageSignature();
- ms.setOperation(invoke.getOperation());
- ms.getTypeReferences().add(tref);
-
- String fromRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
-
- if (fromRole != null) {
- interaction.setFromRole(new Role(fromRole));
- }
-
- if (context.getRole() != null) {
- interaction.getToRoles().add(new Role(context.getRole()));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
- }
-
- protected static void convertFaultResponse(TInvoke invoke,
java.util.List<Activity> activities,
- String faultVar, QName faultMesgType, ConversionContext context) {
-
- // Create interaction for request
- Interaction interaction=new Interaction();
- //interaction.derivedFrom(this);
-
- TypeReference tref=null;
-
- // TODO: Not sure if fault variable is supposed to be declared
- // in catch scope, or reused from outer scope?? If declared,
- // then without the message type/element, may be difficult to
- // define the message signature.
-
- TVariable var=context.getVariable(faultVar);
-
- if (var != null) {
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- tref = TypeReferenceUtil.createTypeReference(xmlType, context);
- //tref.setLocalpart(var.getMessageType());
- } else if (faultMesgType != null) {
- tref = TypeReferenceUtil.createTypeReference(faultMesgType.getLocalPart(), context);
- //tref.setLocalpart(faultMesgType);
- }
-
- MessageSignature ms=new MessageSignature();
- ms.setOperation(invoke.getOperation());
- ms.getTypeReferences().add(tref);
-
- String fromRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
-
- if (fromRole != null) {
- interaction.setFromRole(new Role(fromRole));
- }
-
- if (context.getRole() != null) {
- interaction.getToRoles().add(new Role(context.getRole()));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/InvokeGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,231 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.TCatch;
+import org.savara.bpel.model.TInvoke;
+import org.savara.bpel.model.TScope;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.PartnerLinkUtil;
+import org.savara.bpel.util.TypeReferenceUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ */
+public class InvokeParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TInvoke);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TInvoke invoke=(TInvoke)component;
+
+ //getSource().setComponentURI(getURI());
+
+ convertRequest(invoke, activities, context);
+
+ // Check if invoke is contained within a scope that defines
+ // fault handlers. If so, then generate choice to throw
+ // fault exceptions.
+ TScope scope=context.getScope();
+
+ if (scope != null && scope.getFaultHandlers() != null &&
+ (scope.getFaultHandlers().getCatch().size() > 0 ||
+ scope.getFaultHandlers().getCatchAll() != null)) {
+ org.scribble.protocol.model.Choice te=
+ new org.scribble.protocol.model.Choice();
+ //te.derivedFrom(this);
+
+ activities.add(te);
+
+ org.scribble.protocol.model.When when=
+ new org.scribble.protocol.model.When();
+ te.getWhens().add(when);
+
+ activities = when.getBlock().getContents();
+
+ for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
+ TCatch catchBlock=scope.getFaultHandlers().getCatch().get(i);
+
+ org.scribble.protocol.model.When fcb=
+ new org.scribble.protocol.model.When();
+
+ QName mesgType=catchBlock.getFaultMessageType();
+
+ if (mesgType == null) {
+ mesgType = catchBlock.getFaultElement();
+ }
+
+ TVariable faultVar=null;
+
+ if (catchBlock.getFaultVariable() != null) {
+ faultVar = new TVariable();
+ faultVar.setName(catchBlock.getFaultVariable());
+ faultVar.setMessageType(catchBlock.getFaultMessageType());
+ faultVar.setElement(catchBlock.getFaultElement());
+ context.addVariable(faultVar);
+ }
+
+ convertFaultResponse(invoke, fcb.getBlock().getContents(),
catchBlock.getFaultVariable(),
+ mesgType, context);
+
+ org.scribble.protocol.model.Raise raise=
+ new org.scribble.protocol.model.Raise();
+
+ TypeReference tref=new TypeReference();
+ tref.setName(catchBlock.getFaultName().getLocalPart());
+ raise.setType(tref);
+
+ fcb.getBlock().add(raise);
+
+ te.getWhens().add(fcb);
+
+ if (faultVar != null) {
+ context.removeVariable(faultVar);
+ }
+ }
+ }
+
+ if (invoke.getOutputVariable() != null) {
+
+ convertResponse(invoke, activities, context);
+ }
+ }
+
+ protected static void convertRequest(TInvoke invoke, java.util.List<Activity>
activities,
+ ConversionContext context) {
+ // Create interaction for request
+ Interaction interaction=new Interaction();
+ //interaction.derivedFrom(this);
+
+ TVariable var=context.getVariable(invoke.getInputVariable());
+
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+
+ MessageSignature ms=new MessageSignature();
+ ms.setOperation(invoke.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ //if (context.getRole() != null) {
+ // interaction.setFromRole(new Role(context.getRole()));
+ //}
+
+ String toRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
+
+ if (toRole != null) {
+ interaction.getToRoles().add(new Role(toRole));
+ }
+
+ interaction.setMessageSignature(ms);
+
+ activities.add(interaction);
+ }
+
+ protected static void convertResponse(TInvoke invoke, java.util.List<Activity>
activities,
+ ConversionContext context) {
+
+ // Create interaction for request
+ Interaction interaction=new Interaction();
+ //interaction.derivedFrom(this);
+
+ TVariable var=context.getVariable(invoke.getOutputVariable());
+
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+
+ MessageSignature ms=new MessageSignature();
+ ms.setOperation(invoke.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ String fromRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
+
+ if (fromRole != null) {
+ interaction.setFromRole(new Role(fromRole));
+ }
+
+ //if (context.getRole() != null) {
+ // interaction.getToRoles().add(new Role(context.getRole()));
+ //}
+
+ interaction.setMessageSignature(ms);
+
+ activities.add(interaction);
+ }
+
+ protected static void convertFaultResponse(TInvoke invoke,
java.util.List<Activity> activities,
+ String faultVar, QName faultMesgType, ConversionContext context) {
+
+ // Create interaction for request
+ Interaction interaction=new Interaction();
+ //interaction.derivedFrom(this);
+
+ TypeReference tref=null;
+
+ // TODO: Not sure if fault variable is supposed to be declared
+ // in catch scope, or reused from outer scope?? If declared,
+ // then without the message type/element, may be difficult to
+ // define the message signature.
+
+ TVariable var=context.getVariable(faultVar);
+
+ if (var != null) {
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ tref = TypeReferenceUtil.createTypeReference(xmlType, context);
+ //tref.setLocalpart(var.getMessageType());
+ } else if (faultMesgType != null) {
+ tref = TypeReferenceUtil.createTypeReference(faultMesgType.getLocalPart(), context);
+ //tref.setLocalpart(faultMesgType);
+ }
+
+ MessageSignature ms=new MessageSignature();
+ ms.setOperation(invoke.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ String fromRole=PartnerLinkUtil.getClientPartnerRole(invoke.getPartnerLink());
+
+ if (fromRole != null) {
+ interaction.setFromRole(new Role(fromRole));
+ }
+
+ //if (context.getRole() != null) {
+ // interaction.getToRoles().add(new Role(context.getRole()));
+ //}
+
+ interaction.setMessageSignature(ms);
+
+ activities.add(interaction);
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/OnMessageGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/OnMessageGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/OnMessageGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TOnMessage;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
-import org.savara.bpel.util.PartnerLinkUtil;
-import org.savara.bpel.util.TypeReferenceUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents the 'onMessage' construct contained
- * within the 'pick' activity.
- */
-public class OnMessageGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TOnMessage);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TOnMessage elem=(TOnMessage)component;
-
- Interaction interaction=new Interaction();
-
- TVariable var=context.getVariable(elem.getVariable());
-
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
-
- MessageSignature ms=new MessageSignature();
- ms.setOperation(elem.getOperation());
- ms.getTypeReferences().add(tref);
-
- String fromRole=PartnerLinkUtil.getServerPartnerRole(elem.getPartnerLink());
-
- if (fromRole != null) {
- interaction.setFromRole(new Role(fromRole));
- }
-
- if (context.getRole() != null) {
- interaction.getToRoles().add(new Role(context.getRole()));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
-
- TActivity act=ActivityUtil.getActivity(elem);
-
- if (act != null) {
- context.convert(act, activities);
- }
- }
-}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/PickGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TOnMessage;
-import org.savara.bpel.model.TPick;
-import org.savara.bpel.model.TReply;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a pick grouping activity.
- *
- * @author gary
- */
-public class PickGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TReply);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TPick pick=(TPick)component;
-
- //getSource().setComponentURI(getURI());
-
- org.scribble.protocol.model.Choice elem=
- new org.scribble.protocol.model.Choice();
-
- // Convert 'onMessage' paths
- for (int i=0; i < pick.getOnMessage().size(); i++) {
- TOnMessage onMessageElem=pick.getOnMessage().get(i);
-
- When cb = new When();
-
- context.convert(onMessageElem, cb.getBlock().getContents());
-
- elem.getWhens().add(cb);
- }
-
- // TODO: If alarms defined, then model these using a
- // try/catch with interrupt?
-
- activities.add(elem);
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/PickGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TOnMessage;
+import org.savara.bpel.model.TPick;
+import org.savara.bpel.model.TReply;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.ActivityUtil;
+import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.PartnerLinkUtil;
+import org.savara.bpel.util.TypeReferenceUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a pick grouping activity.
+ *
+ * @author gary
+ */
+public class PickParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TPick);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TPick pick=(TPick)component;
+
+ //getSource().setComponentURI(getURI());
+
+ org.scribble.protocol.model.Choice elem=
+ new org.scribble.protocol.model.Choice();
+
+ Role fromRole=null;
+
+ // Convert 'onMessage' paths
+ for (int i=0; i < pick.getOnMessage().size(); i++) {
+ TOnMessage onMessageElem=pick.getOnMessage().get(i);
+
+ When cb = new When();
+
+ context.convert(onMessageElem, cb.getBlock().getContents(), journal);
+
+ String
fromRoleName=PartnerLinkUtil.getServerPartnerRole(onMessageElem.getPartnerLink());
+
+ if (i == 0) {
+ // Obtain from/to roles
+ if (fromRoleName != null) {
+ fromRole = new Role(fromRoleName);
+ }
+ } else {
+ // TODO: Check 'from role' for other paths
+ if (fromRoleName != null &&
+ fromRole != null &&
+ fromRoleName.equals(fromRole.getName()) == false) {
+ journal.error("Pick path has different from roles", null);
+ }
+ }
+
+ elem.setFromRole(fromRole);
+
+ TVariable var=context.getVariable(onMessageElem.getVariable());
+
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+
+ MessageSignature ms=new MessageSignature();
+ ms.setOperation(onMessageElem.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ cb.setMessageSignature(ms);
+
+ // Process the contained activities
+ TActivity act=ActivityUtil.getActivity(onMessageElem);
+
+ if (act != null) {
+ context.convert(act, cb.getBlock().getContents(), journal);
+ }
+
+ elem.getWhens().add(cb);
+ }
+
+ // TODO: If alarms defined, then model these using a
+ // try/catch with interrupt?
+
+ activities.add(elem);
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ProcessGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,190 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TCatch;
-import org.savara.bpel.model.TInvoke;
-import org.savara.bpel.model.TProcess;
-import org.savara.bpel.model.TSequence;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a BPEL process.
- *
- * @author gary
- */
-public class ProcessGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TProcess);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TProcess process=(TProcess)component;
-
- // Add variables to the context
- for (int i=0; i < process.getVariables().getVariable().size(); i++) {
- context.addVariable(process.getVariables().getVariable().get(i));
- }
-
- // Count number of invoke activities
- int invokeCount=InteractionUtil.countInvokes(process);
-
- // Check whether scope has been defined to represent
- // an interaction with one or more fault responses and
- // no event handlers
- TInvoke invoke=null;
- TActivity act=ActivityUtil.getActivity(process);
-
- if (invokeCount == 1 &&
- process.getFaultHandlers() != null &&
(process.getFaultHandlers().getCatch().size() > 0 ||
- process.getFaultHandlers().getCatchAll() != null) &&
- (process.getEventHandlers() == null ||
(process.getEventHandlers().getOnEvent().size() == 0 &&
- process.getEventHandlers().getOnAlarm().size() == 0)) &&
- (invoke = InteractionUtil.getInvoke(act)) != null) {
-
- InvokeGenerationRule.convertRequest(invoke, activities, context);
-
- // Create choice with normal response and fault paths
- org.scribble.protocol.model.Choice choice=new org.scribble.protocol.model.Choice();
-
- When cb=new When();
-
- InvokeGenerationRule.convertResponse(invoke, cb.getBlock().getContents(), context);
-
- // Include remaining activities
- if (act instanceof TSequence) {
- for (int i=1; i < ((TSequence)act).getActivity().size(); i++) {
- context.convert(((TSequence)act).getActivity().get(i),
cb.getBlock().getContents());
- }
- }
-
- choice.getWhens().add(cb);
-
- // Process fault handlers
- for (int i=0; i < process.getFaultHandlers().getCatch().size(); i++) {
- TCatch catchBlock=process.getFaultHandlers().getCatch().get(i);
-
- When fcb=new When();
-
- QName mesgType=catchBlock.getFaultMessageType();
-
- if (mesgType == null) {
- mesgType = catchBlock.getFaultElement();
- }
-
- TVariable faultVar=null;
-
- if (catchBlock.getFaultVariable() != null) {
- faultVar = new TVariable();
- faultVar.setName(catchBlock.getFaultVariable());
- faultVar.setMessageType(catchBlock.getFaultMessageType());
- faultVar.setElement(catchBlock.getFaultElement());
- context.addVariable(faultVar);
- }
-
- InvokeGenerationRule.convertFaultResponse(invoke,
- fcb.getBlock().getContents(), catchBlock.getFaultVariable(),
- mesgType, context);
-
- TActivity cbact=ActivityUtil.getActivity(catchBlock);
-
- if (cbact != null) {
- context.convert(cbact, fcb.getBlock().getContents());
- }
-
- choice.getWhens().add(fcb);
-
- if (faultVar != null) {
- context.removeVariable(faultVar);
- }
- }
-
- activities.add(choice);
- } else {
- // Store in local var, in case try/catch block needs to be
- // added
- java.util.List<Activity> acts=activities;
-
- // Check if try/catch block is required
- if (process.getFaultHandlers() != null &&
- (process.getFaultHandlers().getCatch().size() > 0 ||
- process.getFaultHandlers().getCatchAll() != null)) {
- org.scribble.protocol.model.Try te=
- new org.scribble.protocol.model.Try();
- //te.derivedFrom(this);
- //te.getBlock().derivedFrom(this);
-
- acts.add(te);
-
- acts = te.getBlock().getContents();
-
- for (int i=0; i < process.getFaultHandlers().getCatch().size(); i++) {
- TCatch catchPath=process.getFaultHandlers().getCatch().get(i);
-
- org.scribble.protocol.model.Catch cb=
- new org.scribble.protocol.model.Catch();
- //cb.derivedFrom(catchPath);
-
- /* TODO: How to deal with catch based on type?
- *
- *
- TypeReference tref=new TypeReference();
- tref.setName(XMLUtils.getLocalname(catchPath.getFaultName()));
- cb.setType(tref);
- */
-
- TVariable faultVar=null;
-
- if (catchPath.getFaultVariable() != null) {
- faultVar = new TVariable();
- faultVar.setName(catchPath.getFaultVariable());
- faultVar.setMessageType(catchPath.getFaultMessageType());
- faultVar.setElement(catchPath.getFaultElement());
- context.addVariable(faultVar);
- }
-
- TActivity cbact=ActivityUtil.getActivity(catchPath);
-
- if (cbact != null) {
- context.convert(cbact, cb.getBlock().getContents());
- }
-
- if (faultVar != null) {
- context.removeVariable(faultVar);
- }
-
- te.getCatches().add(cb);
- }
- }
-
- // Convert normal activities in scope
- if (act != null) {
- context.convert(act, acts);
- }
- }
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ProcessGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TCatch;
+import org.savara.bpel.model.TInvoke;
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.model.TSequence;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.ActivityUtil;
+import org.savara.bpel.util.InteractionUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a BPEL process.
+ *
+ * @author gary
+ */
+public class ProcessParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TProcess);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TProcess process=(TProcess)component;
+
+ // Add variables to the context
+ for (int i=0; i < process.getVariables().getVariable().size(); i++) {
+ context.addVariable(process.getVariables().getVariable().get(i));
+ }
+
+ // Count number of invoke activities
+ int invokeCount=InteractionUtil.countInvokes(process);
+
+ // Check whether scope has been defined to represent
+ // an interaction with one or more fault responses and
+ // no event handlers
+ TInvoke invoke=null;
+ TActivity act=ActivityUtil.getActivity(process);
+
+ if (//invokeCount == 1 &&
+ process.getFaultHandlers() != null &&
(process.getFaultHandlers().getCatch().size() > 0 ||
+ process.getFaultHandlers().getCatchAll() != null) &&
+ (process.getEventHandlers() == null ||
(process.getEventHandlers().getOnEvent().size() == 0 &&
+ process.getEventHandlers().getOnAlarm().size() == 0)) &&
+ (invoke = InteractionUtil.getInvoke(act)) != null) {
+
+ InvokeParserRule.convertRequest(invoke, activities, context);
+
+ // Create choice with normal response and fault paths
+ org.scribble.protocol.model.Choice choice=new org.scribble.protocol.model.Choice();
+
+ When cb=new When();
+
+ InvokeParserRule.convertResponse(invoke, cb.getBlock().getContents(), context);
+
+ // Include remaining activities
+ if (act instanceof TSequence) {
+ for (int i=1; i < ((TSequence)act).getActivity().size(); i++) {
+ context.convert(((TSequence)act).getActivity().get(i), cb.getBlock().getContents(),
+ journal);
+ }
+ }
+
+ choice.getWhens().add(cb);
+
+ // Process fault handlers
+ for (int i=0; i < process.getFaultHandlers().getCatch().size(); i++) {
+ TCatch catchBlock=process.getFaultHandlers().getCatch().get(i);
+
+ When fcb=new When();
+
+ QName mesgType=catchBlock.getFaultMessageType();
+
+ if (mesgType == null) {
+ mesgType = catchBlock.getFaultElement();
+ }
+
+ TVariable faultVar=null;
+
+ if (catchBlock.getFaultVariable() != null) {
+ faultVar = new TVariable();
+ faultVar.setName(catchBlock.getFaultVariable());
+ faultVar.setMessageType(catchBlock.getFaultMessageType());
+ faultVar.setElement(catchBlock.getFaultElement());
+ context.addVariable(faultVar);
+ }
+
+ InvokeParserRule.convertFaultResponse(invoke,
+ fcb.getBlock().getContents(), catchBlock.getFaultVariable(),
+ mesgType, context);
+
+ TActivity cbact=ActivityUtil.getActivity(catchBlock);
+
+ if (cbact != null) {
+ context.convert(cbact, fcb.getBlock().getContents(), journal);
+ }
+
+ choice.getWhens().add(fcb);
+
+ if (faultVar != null) {
+ context.removeVariable(faultVar);
+ }
+ }
+
+ activities.add(choice);
+ } else {
+ // Store in local var, in case try/catch block needs to be
+ // added
+ java.util.List<Activity> acts=activities;
+
+ // Check if try/catch block is required
+ if (process.getFaultHandlers() != null &&
+ (process.getFaultHandlers().getCatch().size() > 0 ||
+ process.getFaultHandlers().getCatchAll() != null)) {
+ org.scribble.protocol.model.Try te=
+ new org.scribble.protocol.model.Try();
+ //te.derivedFrom(this);
+ //te.getBlock().derivedFrom(this);
+
+ acts.add(te);
+
+ acts = te.getBlock().getContents();
+
+ for (int i=0; i < process.getFaultHandlers().getCatch().size(); i++) {
+ TCatch catchPath=process.getFaultHandlers().getCatch().get(i);
+
+ org.scribble.protocol.model.Catch cb=
+ new org.scribble.protocol.model.Catch();
+ //cb.derivedFrom(catchPath);
+
+ /* TODO: How to deal with catch based on type?
+ *
+ *
+ TypeReference tref=new TypeReference();
+ tref.setName(XMLUtils.getLocalname(catchPath.getFaultName()));
+ cb.setType(tref);
+ */
+
+ TVariable faultVar=null;
+
+ if (catchPath.getFaultVariable() != null) {
+ faultVar = new TVariable();
+ faultVar.setName(catchPath.getFaultVariable());
+ faultVar.setMessageType(catchPath.getFaultMessageType());
+ faultVar.setElement(catchPath.getFaultElement());
+ context.addVariable(faultVar);
+ }
+
+ TActivity cbact=ActivityUtil.getActivity(catchPath);
+
+ if (cbact != null) {
+ context.convert(cbact, cb.getBlock().getContents(), journal);
+ }
+
+ if (faultVar != null) {
+ context.removeVariable(faultVar);
+ }
+
+ te.getCatches().add(cb);
+ }
+ }
+
+ // Convert normal activities in scope
+ if (act != null) {
+ context.convert(act, acts, journal);
+ }
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ProtocolGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import org.scribble.protocol.model.Activity;
-
-/**
- * This interface represents a generation rule from a domain specific component
- * to a Protocol component.
- *
- */
-public interface ProtocolGenerationRule {
-
- /**
- * This method determines whether the supplied domain component is supported
- * by this conversion rule.
- *
- * @param context The conversion context
- * @param component The domain component
- * @return Whether the component is supported for this rule
- */
- public boolean isSupported(Object component);
-
- /**
- * This method converts a domain specific component to a protocol component and
- * add it to the supplied activity list.
- *
- * @param context The conversion context
- * @param component The domain component
- * @param activities The list of protocol activities
- */
- public void convert(ConversionContext context, Object component,
java.util.List<Activity> activities);
-
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ProtocolGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProtocolParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This interface represents a generation rule from a domain specific component
+ * to a Protocol component.
+ *
+ */
+public interface ProtocolParserRule {
+
+ /**
+ * This method determines whether the supplied domain component is supported
+ * by this conversion rule.
+ *
+ * @param context The conversion context
+ * @param component The domain component
+ * @return Whether the component is supported for this rule
+ */
+ public boolean isSupported(Object component);
+
+ /**
+ * This method converts a domain specific component to a protocol component and
+ * add it to the supplied activity list.
+ *
+ * @param context The conversion context
+ * @param component The domain component
+ * @param activities The list of protocol activities
+ */
+ public void convert(ConversionContext context, Object component,
java.util.List<Activity> activities,
+ Journal journal);
+
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ReceiveGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TReceive;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
-import org.savara.bpel.util.PartnerLinkUtil;
-import org.savara.bpel.util.TypeReferenceUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents an unsupported (or custom) action within
- * the conversation based ESB service descriptor.
- *
- * @author gary
- */
-public class ReceiveGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TReceive);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TReceive elem=(TReceive)component;
-
- //getSource().setComponentURI(getURI());
-
- Interaction interaction=new Interaction();
- //interaction.derivedFrom(this);
-
- TVariable var=context.getVariable(elem.getVariable());
-
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
-
- MessageSignature ms=new MessageSignature();
- //ms.derivedFrom(this);
-
- ms.setOperation(elem.getOperation());
- ms.getTypeReferences().add(tref);
-
- String fromRole=PartnerLinkUtil.getServerPartnerRole(elem.getPartnerLink());
-
- if (fromRole != null && fromRole.equals(context.getRole())) {
- fromRole = PartnerLinkUtil.getClientPartnerRole(elem.getPartnerLink());
- }
-
- if (fromRole != null) {
- interaction.setFromRole(new Role(fromRole));
- }
-
- if (context.getRole() != null) {
- interaction.getToRoles().add(new Role(context.getRole()));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
- }
-
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ReceiveGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TReceive;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.PartnerLinkUtil;
+import org.savara.bpel.util.TypeReferenceUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class ReceiveParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TReceive);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TReceive elem=(TReceive)component;
+
+ //getSource().setComponentURI(getURI());
+
+ Interaction interaction=new Interaction();
+ //interaction.derivedFrom(this);
+
+ TVariable var=context.getVariable(elem.getVariable());
+
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+
+ MessageSignature ms=new MessageSignature();
+ //ms.derivedFrom(this);
+
+ ms.setOperation(elem.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ String fromRole=PartnerLinkUtil.getServerPartnerRole(elem.getPartnerLink());
+
+ if (fromRole != null && fromRole.equals(context.getRole())) {
+ fromRole = PartnerLinkUtil.getClientPartnerRole(elem.getPartnerLink());
+ }
+
+ if (fromRole != null) {
+ interaction.setFromRole(new Role(fromRole));
+ }
+
+ //if (context.getRole() != null) {
+ // interaction.getToRoles().add(new Role(context.getRole()));
+ //}
+
+ interaction.setMessageSignature(ms);
+
+ activities.add(interaction);
+ }
+
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ReplyGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TReply;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
-import org.savara.bpel.util.PartnerLinkUtil;
-import org.savara.bpel.util.TypeReferenceUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a BPEL reply activity.
- *
- * @author gary
- */
-public class ReplyGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TReply);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TReply reply=(TReply)component;
-
- //getSource().setComponentURI(getURI());
-
- Interaction interaction=new Interaction();
- //interaction.derivedFrom(this);
-
- TVariable var=context.getVariable(reply.getVariable());
-
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
- context.getResourceLocator());
-
- TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
-
- MessageSignature ms=new MessageSignature();
- //ms.derivedFrom(this);
-
- ms.setOperation(reply.getOperation());
- ms.getTypeReferences().add(tref);
-
- if (context.getRole() != null) {
- interaction.setFromRole(new Role(context.getRole()));
- }
-
- String toRole=PartnerLinkUtil.getServerPartnerRole(reply.getPartnerLink());
-
- if (toRole != null) {
- interaction.getToRoles().add(new Role(toRole));
- }
-
- interaction.setMessageSignature(ms);
-
- activities.add(interaction);
- }
-
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ReplyGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TReply;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.PartnerLinkUtil;
+import org.savara.bpel.util.TypeReferenceUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a BPEL reply activity.
+ *
+ * @author gary
+ */
+public class ReplyParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TReply);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TReply reply=(TReply)component;
+
+ //getSource().setComponentURI(getURI());
+
+ Interaction interaction=new Interaction();
+ //interaction.derivedFrom(this);
+
+ TVariable var=context.getVariable(reply.getVariable());
+
+ String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ context.getResourceLocator());
+
+ TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+
+ MessageSignature ms=new MessageSignature();
+ //ms.derivedFrom(this);
+
+ ms.setOperation(reply.getOperation());
+ ms.getTypeReferences().add(tref);
+
+ //if (context.getRole() != null) {
+ // interaction.setFromRole(new Role(context.getRole()));
+ //}
+
+ String toRole=PartnerLinkUtil.getServerPartnerRole(reply.getPartnerLink());
+
+ if (toRole != null) {
+ interaction.getToRoles().add(new Role(toRole));
+ }
+
+ interaction.setMessageSignature(ms);
+
+ activities.add(interaction);
+ }
+
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ScopeGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,193 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TCatch;
-import org.savara.bpel.model.TInvoke;
-import org.savara.bpel.model.TScope;
-import org.savara.bpel.model.TSequence;
-import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a scope grouping activity.
- *
- * @author gary
- */
-public class ScopeGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TScope);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TScope scope=(TScope)component;
-
- //getSource().setComponentURI(getURI());
-
- // Add variables to the context
- for (int i=0; i < scope.getVariables().getVariable().size(); i++) {
- context.addVariable(scope.getVariables().getVariable().get(i));
- }
-
- // Count number of invoke activities
- int invokeCount=InteractionUtil.countInvokes(scope);
-
- // Check whether scope has been defined to represent
- // an interaction with one or more fault responses and
- // no event handlers
- TInvoke invoke=null;
-
- if (invokeCount == 1 &&
- scope.getFaultHandlers() != null &&
(scope.getFaultHandlers().getCatch().size() > 0 ||
- scope.getFaultHandlers().getCatchAll() != null) &&
- (scope.getEventHandlers() == null || (scope.getEventHandlers().getOnEvent().size() ==
0 &&
- scope.getEventHandlers().getOnAlarm().size() == 0)) &&
- (invoke = InteractionUtil.getInvoke(ActivityUtil.getActivity(scope))) != null) {
-
- InvokeGenerationRule.convertRequest(invoke, activities, context);
-
- // Create choice with normal response and fault paths
- org.scribble.protocol.model.Choice choice=new org.scribble.protocol.model.Choice();
-
- When cb=new When();
-
- InvokeGenerationRule.convertResponse(invoke, cb.getBlock().getContents(), context);
-
- // Include remaining activities
- if (scope.getSequence() != null) {
- for (int i=1; i < ((TSequence)scope.getSequence()).getActivity().size(); i++) {
- context.convert(((TSequence)scope.getSequence()).getActivity().get(i),
- cb.getBlock().getContents());
- }
- }
-
- choice.getWhens().add(cb);
-
- // Process fault handlers
- for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
- TCatch catchBlock=scope.getFaultHandlers().getCatch().get(i);
-
- When fcb=new When();
-
- QName mesgType=catchBlock.getFaultMessageType();
-
- if (mesgType == null) {
- mesgType = catchBlock.getFaultElement();
- }
-
- TVariable faultVar=null;
-
- if (catchBlock.getFaultVariable() != null) {
- faultVar = new TVariable();
- faultVar.setName(catchBlock.getFaultVariable());
- faultVar.setMessageType(catchBlock.getFaultMessageType());
- faultVar.setElement(catchBlock.getFaultElement());
- context.addVariable(faultVar);
- }
-
- InvokeGenerationRule.convertFaultResponse(invoke, fcb.getBlock().getContents(),
- catchBlock.getFaultVariable(), mesgType, context);
-
- TActivity act=ActivityUtil.getActivity(catchBlock);
-
- if (act != null) {
- context.convert(act, fcb.getBlock().getContents());
- }
-
- choice.getWhens().add(fcb);
-
- if (faultVar != null) {
- context.removeVariable(faultVar);
- }
- }
-
- activities.add(choice);
- } else {
- // Store in local var, in case try/catch block needs to be
- // added
- java.util.List<Activity> acts=activities;
-
- // Check if try/catch block is required
- if (scope.getFaultHandlers() != null &&
- (scope.getFaultHandlers().getCatch().size() > 0 ||
- scope.getFaultHandlers().getCatchAll() != null)) {
- org.scribble.protocol.model.Try te=
- new org.scribble.protocol.model.Try();
- //te.derivedFrom(this);
- //te.getBlock().derivedFrom(this);
-
- acts.add(te);
-
- acts = te.getBlock().getContents();
-
- for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
- TCatch catchPath=scope.getFaultHandlers().getCatch().get(i);
-
- org.scribble.protocol.model.Catch cb=
- new org.scribble.protocol.model.Catch();
- //cb.derivedFrom(catchPath);
-
- TypeReference tref=new TypeReference();
- tref.setName(catchPath.getFaultName().getLocalPart());
-
- //cb.setType(tref);
-
- // TODO: Need to do a search for first interaction in the block,
- // and treat that as the triggering condition
-
- TVariable faultVar=null;
-
- if (catchPath.getFaultVariable() != null) {
- faultVar = new TVariable();
- faultVar.setName(catchPath.getFaultVariable());
- faultVar.setMessageType(catchPath.getFaultMessageType());
- faultVar.setElement(catchPath.getFaultElement());
- context.addVariable(faultVar);
- }
-
- TActivity act=ActivityUtil.getActivity(catchPath);
-
- if (act != null) {
- context.convert(act, cb.getBlock().getContents());
- }
-
- if (faultVar != null) {
- context.removeVariable(faultVar);
- }
-
- te.getCatches().add(cb);
- }
- }
-
- // Convert normal activities in scope
- TActivity act=ActivityUtil.getActivity(scope);
-
- if (act != null) {
- context.convert(act, acts);
- }
- }
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/ScopeGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TCatch;
+import org.savara.bpel.model.TInvoke;
+import org.savara.bpel.model.TScope;
+import org.savara.bpel.model.TSequence;
+import org.savara.bpel.model.TVariable;
+import org.savara.bpel.util.ActivityUtil;
+import org.savara.bpel.util.InteractionUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a scope grouping activity.
+ *
+ * @author gary
+ */
+public class ScopeParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TScope);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TScope scope=(TScope)component;
+
+ //getSource().setComponentURI(getURI());
+
+ // Add variables to the context
+ if (scope.getVariables() != null) {
+ for (int i=0; i < scope.getVariables().getVariable().size(); i++) {
+ context.addVariable(scope.getVariables().getVariable().get(i));
+ }
+ }
+
+ // Count number of invoke activities
+ int invokeCount=InteractionUtil.countInvokes(scope);
+
+ // Check whether scope has been defined to represent
+ // an interaction with one or more fault responses and
+ // no event handlers
+ TInvoke invoke=null;
+
+ if (//invokeCount == 1 &&
+ scope.getFaultHandlers() != null &&
(scope.getFaultHandlers().getCatch().size() > 0 ||
+ scope.getFaultHandlers().getCatchAll() != null) &&
+ (scope.getEventHandlers() == null || (scope.getEventHandlers().getOnEvent().size() ==
0 &&
+ scope.getEventHandlers().getOnAlarm().size() == 0)) &&
+ (invoke = InteractionUtil.getInvoke(ActivityUtil.getActivity(scope))) != null) {
+
+ InvokeParserRule.convertRequest(invoke, activities, context);
+
+ // Create choice with normal response and fault paths
+ org.scribble.protocol.model.Choice choice=new org.scribble.protocol.model.Choice();
+
+ When cb=new When();
+
+ InvokeParserRule.convertResponse(invoke, cb.getBlock().getContents(), context);
+
+ if (cb.getBlock().getContents().size() > 0) {
+ Interaction resp=(Interaction)cb.getBlock().getContents().get(0);
+ cb.getBlock().getContents().remove(resp);
+
+ cb.setMessageSignature(resp.getMessageSignature());
+
+ choice.setFromRole(resp.getFromRole());
+ }
+
+ // Include remaining activities
+ if (scope.getSequence() != null) {
+ for (int i=1; i < ((TSequence)scope.getSequence()).getActivity().size(); i++) {
+ context.convert(((TSequence)scope.getSequence()).getActivity().get(i),
+ cb.getBlock().getContents(), journal);
+ }
+ }
+
+ choice.getWhens().add(cb);
+
+ // Process fault handlers
+ for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
+ TCatch catchBlock=scope.getFaultHandlers().getCatch().get(i);
+
+ When fcb=new When();
+
+ QName mesgType=catchBlock.getFaultMessageType();
+
+ if (mesgType == null) {
+ mesgType = catchBlock.getFaultElement();
+ }
+
+ TVariable faultVar=null;
+
+ if (catchBlock.getFaultVariable() != null) {
+ faultVar = new TVariable();
+ faultVar.setName(catchBlock.getFaultVariable());
+ faultVar.setMessageType(catchBlock.getFaultMessageType());
+ faultVar.setElement(catchBlock.getFaultElement());
+ context.addVariable(faultVar);
+ }
+
+ InvokeParserRule.convertFaultResponse(invoke, fcb.getBlock().getContents(),
+ catchBlock.getFaultVariable(), mesgType, context);
+
+ if (fcb.getBlock().getContents().size() > 0) {
+ Interaction resp=(Interaction)fcb.getBlock().getContents().get(0);
+ fcb.getBlock().getContents().remove(resp);
+
+ fcb.setMessageSignature(resp.getMessageSignature());
+
+ // Validate from role
+ if (resp.getFromRole() != null &&
+ choice.getFromRole() != null &&
+ resp.getFromRole().equals(choice.getFromRole()) == false) {
+ journal.error("Fault handler 'from role' not same as normal
response", null);
+ }
+ }
+
+ TActivity act=ActivityUtil.getActivity(catchBlock);
+
+ if (act != null) {
+ context.convert(act, fcb.getBlock().getContents(), journal);
+ }
+
+ choice.getWhens().add(fcb);
+
+ if (faultVar != null) {
+ context.removeVariable(faultVar);
+ }
+ }
+
+ activities.add(choice);
+ } else {
+ // Store in local var, in case try/catch block needs to be
+ // added
+ java.util.List<Activity> acts=activities;
+
+ // Check if try/catch block is required
+ if (scope.getFaultHandlers() != null &&
+ (scope.getFaultHandlers().getCatch().size() > 0 ||
+ scope.getFaultHandlers().getCatchAll() != null)) {
+ org.scribble.protocol.model.Try te=
+ new org.scribble.protocol.model.Try();
+ //te.derivedFrom(this);
+ //te.getBlock().derivedFrom(this);
+
+ acts.add(te);
+
+ acts = te.getBlock().getContents();
+
+ for (int i=0; i < scope.getFaultHandlers().getCatch().size(); i++) {
+ TCatch catchPath=scope.getFaultHandlers().getCatch().get(i);
+
+ org.scribble.protocol.model.Catch cb=
+ new org.scribble.protocol.model.Catch();
+ //cb.derivedFrom(catchPath);
+
+ TypeReference tref=new TypeReference();
+ tref.setName(catchPath.getFaultName().getLocalPart());
+
+ //cb.setType(tref);
+
+ // TODO: Need to do a search for first interaction in the block,
+ // and treat that as the triggering condition
+
+ TVariable faultVar=null;
+
+ if (catchPath.getFaultVariable() != null) {
+ faultVar = new TVariable();
+ faultVar.setName(catchPath.getFaultVariable());
+ faultVar.setMessageType(catchPath.getFaultMessageType());
+ faultVar.setElement(catchPath.getFaultElement());
+ context.addVariable(faultVar);
+ }
+
+ TActivity act=ActivityUtil.getActivity(catchPath);
+
+ if (act != null) {
+ context.convert(act, cb.getBlock().getContents(), journal);
+ }
+
+ if (faultVar != null) {
+ context.removeVariable(faultVar);
+ }
+
+ te.getCatches().add(cb);
+ }
+ }
+
+ // Convert normal activities in scope
+ TActivity act=ActivityUtil.getActivity(scope);
+
+ if (act != null) {
+ context.convert(act, acts, journal);
+ }
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/SequenceGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TSequence;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a sequence grouping activity.
- *
- * @author gary
- */
-public class SequenceGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TSequence);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TSequence bpelElem=(TSequence)component;
-
- //getSource().setComponentURI(getURI());
-
- for (int i=0; i < bpelElem.getActivity().size(); i++) {
- context.convert(bpelElem.getActivity().get(i), activities);
- }
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/SequenceGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/SequenceParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TSequence;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a sequence grouping activity.
+ *
+ * @author gary
+ */
+public class SequenceParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TSequence);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TSequence bpelElem=(TSequence)component;
+
+ //getSource().setComponentURI(getURI());
+
+ for (int i=0; i < bpelElem.getActivity().size(); i++) {
+ context.convert(bpelElem.getActivity().get(i), activities, journal);
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileGenerationRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/WhileGenerationRule.java 2010-12-22
22:50:23 UTC (rev 513)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileGenerationRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.bpel.generator.protocol;
-
-import java.util.List;
-
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TWhile;
-import org.savara.bpel.util.ActivityUtil;
-import org.scribble.protocol.model.*;
-
-/**
- * This class represents a while grouping activity.
- *
- * @author gary
- */
-public class WhileGenerationRule implements ProtocolGenerationRule {
-
- public boolean isSupported(Object component) {
- return(component instanceof TWhile);
- }
-
- public void convert(ConversionContext context, Object component, List<Activity>
activities) {
- TWhile bpelElem=(TWhile)component;
-
- //getSource().setComponentURI(getURI());
-
- org.scribble.protocol.model.Repeat elem=
- new org.scribble.protocol.model.Repeat();
-
- // TODO: Convert while expression
-
- TActivity act=ActivityUtil.getActivity(bpelElem);
-
- if (act != null) {
- context.convert(act, elem.getBlock().getContents());
- }
-
- activities.add(elem);
- }
-}
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileParserRule.java
(from rev 513,
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/protocol/WhileGenerationRule.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileParserRule.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/WhileParserRule.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser.rules;
+
+import java.util.List;
+
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TWhile;
+import org.savara.bpel.util.ActivityUtil;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a while grouping activity.
+ *
+ * @author gary
+ */
+public class WhileParserRule implements ProtocolParserRule {
+
+ public boolean isSupported(Object component) {
+ return(component instanceof TWhile);
+ }
+
+ public void convert(ConversionContext context, Object component, List<Activity>
activities,
+ Journal journal) {
+ TWhile bpelElem=(TWhile)component;
+
+ //getSource().setComponentURI(getURI());
+
+ org.scribble.protocol.model.Repeat elem=
+ new org.scribble.protocol.model.Repeat();
+
+ // TODO: Convert while expression
+
+ TActivity act=ActivityUtil.getActivity(bpelElem);
+
+ if (act != null) {
+ context.convert(act, elem.getBlock().getContents(), journal);
+ }
+
+ activities.add(elem);
+ }
+}
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/TypeReferenceUtil.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/TypeReferenceUtil.java 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/TypeReferenceUtil.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -19,7 +19,7 @@
import javax.xml.namespace.QName;
-import org.savara.bpel.generator.protocol.ConversionContext;
+import org.savara.bpel.parser.rules.ConversionContext;
import org.scribble.protocol.model.TypeReference;
public class TypeReferenceUtil {
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/parser/ParserTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/parser/ParserTest.java 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/parser/ParserTest.java 2011-01-05
16:17:24 UTC (rev 533)
@@ -36,8 +36,9 @@
suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_Broker",
"ESBBroker@Broker"));
suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_Buyer",
"ESBBroker@Buyer"));
+ suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_CreditAgency",
"ESBBroker@CreditAgency"));
+
/*
- suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_CreditAgency",
"ESBBroker@CreditAgency"));
suite.addTest(new
BPELToProtocolTest("RequestForQuote_SupplierQuoteEngine",
"ESBBroker@SupplierQuoteEngine"));
suite.addTest(new
BPELToProtocolTest("CompleteTransaction_SupplierTxnProcessor",
"ESBBroker@SupplierTxnProcessor"));
suite.addTest(new BPELToProtocolTest("PurchaseGoodsProcess_Buyer",
"PurchaseGoods@Buyer"));
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Broker.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Broker.spr 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Broker.spr 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,4 +1,4 @@
-protocol ESBBrokerProcess_Broker {
+protocol ESBBrokerProcess_Broker @ BrokerBehavior {
makeEnquiry(enquiry) from Buyer;
repeat {
getQuote(requestForQuote) to SupplierQuoteEngine;
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Buyer.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Buyer.spr 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)Buyer.spr 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,4 +1,4 @@
-protocol ESBBrokerProcess_Buyer {
+protocol ESBBrokerProcess_Buyer @ Buyer {
makeEnquiry(enquiry) to Broker;
makeEnquiry(quoteList) from Broker;
choice to Broker {
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.scv
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.scv 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.scv 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,12 +0,0 @@
-namespace null;
-
-conversation ESBBrokerProcess_CreditAgency@CreditAgency implements Common@CreditAgency {
- if {
- checkCredit(CreditCheckRequest) from Broker to CreditAgency;
- if {
- checkCredit(CreditCheckOk) from CreditAgency to Broker;
- } else if {
- checkCredit(CreditCheckInvalid) from CreditAgency to Broker;
- }
- }
-}
\ No newline at end of file
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/results/ESBBroker(a)CreditAgency.spr 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,9 @@
+protocol ESBBrokerProcess_CreditAgency @ CreditAgency {
+ checkCredit(CreditCheckRequest) from Broker;
+ choice to Broker {
+ checkCredit(CreditCheckOk):
+
+ checkCredit(CreditCheckInvalid):
+
+ }
+}
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpel 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpel 2011-01-05
16:17:24 UTC (rev 533)
@@ -5,7 +5,7 @@
<import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_Supplier.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
<import
namespace="http://www.pi4soa.org/ESBBroker/Buyer"
location="ESBBrokerProcess_BuyerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
<partnerLinks>
- <partnerLink name="BuyerToBroker"
partnerLinkType="byr:BuyerToBrokerLT"
partnerRole="BrokerRequester"/>
+ <partnerLink name="BuyerToBroker"
partnerLinkType="byr:BuyerToBrokerLT" partnerRole="BrokerRequester"
myRole="Buyer"/>
</partnerLinks>
<variables>
<variable name="makeEnquiryRequestVar"
messageType="brk:makeEnquiryRequest"/>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpelex
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpelex
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_Buyer.bpelex 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ASCII"?>
+<extensionmodel:ExtensionMap xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:extensionmodel="http:///extensionmodel.ecore"
xmlns:org.eclipse.bpel.ui.uiextensionmodel="http:///org/eclipse/bpel/ui/uiextensionmodel.ecore"
namespace="http://org.eclipse.bpel.ui/">
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@variables/(a)children.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@variables/(a)children.1"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@variables/(a)children.2"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@variables/(a)children.3"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@variables/(a)children.4"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="ESBBrokerProcess_Buyer.bpel#//@activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/(a)activities.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/(a)activities.1"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@else/(a)activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@else/@activity/(a)activities.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/(a)activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@activity/(a)activities.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@activity/@activities.0/@faultHandlers/@catch.0/(a)faultVariable"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@activity/@activities.0/@faultHandlers/@catch.0/(a)activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@activity/@activities.0/(a)activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="ESBBrokerProcess_Buyer.bpel#//@activity/@activities.1/@activity/@activities.0/@activity/(a)activities.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="ESBBrokerProcess_Buyer.bpel#/"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ProcessExtension"
modificationStamp="1294243978000"/>
+ </extensions>
+</extensionmodel:ExtensionMap>
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel 2011-01-04
22:28:15 UTC (rev 532)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel 2011-01-05
16:17:24 UTC (rev 533)
@@ -1,36 +1,29 @@
-<process
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://www.scribble.org/conversation"
ns0:conversationType="overlord.cdl.samples.Common@CreditAgency"
name="ESBBrokerProcess_CreditAgency"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"...
- <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
- <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
- <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Supplier.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
- <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
- <partnerLinks>
- <partnerLink myRole="CreditAgencyService"
name="BrokerToCreditAgency"
partnerLinkType="cay:BrokerToCreditAgencyServiceLT"/>
- </partnerLinks>
- <variables>
- <variable messageType="cay:checkCreditRequest"
name="checkCreditRequestVar"/>
- <variable messageType="cay:checkCreditResponse"
name="checkCreditResponseVar"/>
- <variable messageType="cay:invalidCreditFault"
name="invalidCreditFaultVar"/>
- </variables>
- <sequence>
- <pick>
- <onMessage operation="checkCredit"
partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"
variable="checkCreditRequestVar">
- <sequence>
- <scope>
- <sequence>
- <if>
- <sequence>
- <reply name="Send_CreditCheckOk"
operation="checkCredit" partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior"
variable="checkCreditResponseVar"/>
- </sequence>
- <else>
- <sequence>
- <reply faultName="cay:invalidCredit"
name="Send_CreditCheckInvalid" operation="checkCredit"
partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"
variable="invalidCreditFaultVar"/>
- </sequence>
- </else>
- </if>
- </sequence>
- </scope>
- </sequence>
- </onMessage>
- </pick>
- </sequence>
-</process>
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="ESBBrokerProcess_CreditAgency"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Broker"
location="ESBBrokerProcess_Broker.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_Supplier.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BrokerToCreditAgency"
partnerLinkType="cay:BrokerToCreditAgencyServiceLT"
myRole="CreditAgency"/>
+ </partnerLinks>
+ <variables>
+ <variable name="checkCreditRequestVar"
messageType="cay:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="cay:checkCreditResponse"/>
+ <variable name="invalidCreditFaultVar"
messageType="cay:invalidCreditFault"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="checkCreditRequestVar" createInstance="yes"
name="Receive_CreditCheckRequest"/>
+ <if>
+ <sequence>
+ <reply partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="checkCreditResponseVar" name="Send_CreditCheckOk"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="invalidCreditFaultVar" faultName="cay:invalidCredit"
name="Send_CreditCheckInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Copied:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpelOLD
(from rev 531,
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpelOLD
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/parser/testmodels/ESBBrokerProcess_CreditAgency.bpelOLD 2011-01-05
16:17:24 UTC (rev 533)
@@ -0,0 +1,36 @@
+<process
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://www.scribble.org/conversation"
ns0:conversationType="overlord.cdl.samples.Common@CreditAgency"
name="ESBBrokerProcess_CreditAgency"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"...
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Supplier.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <partnerLinks>
+ <partnerLink myRole="CreditAgencyService"
name="BrokerToCreditAgency"
partnerLinkType="cay:BrokerToCreditAgencyServiceLT"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="cay:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="cay:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="cay:invalidCreditFault"
name="invalidCreditFaultVar"/>
+ </variables>
+ <sequence>
+ <pick>
+ <onMessage operation="checkCredit"
partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"
variable="checkCreditRequestVar">
+ <sequence>
+ <scope>
+ <sequence>
+ <if>
+ <sequence>
+ <reply name="Send_CreditCheckOk"
operation="checkCredit" partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior"
variable="checkCreditResponseVar"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply faultName="cay:invalidCredit"
name="Send_CreditCheckInvalid" operation="checkCredit"
partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"
variable="invalidCreditFaultVar"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+ </scope>
+ </sequence>
+ </onMessage>
+ </pick>
+ </sequence>
+</process>