[savara-commits] savara SVN: r502 - in branches/experimental/2.0.x: bundles and 371 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 10 17:38:30 EST 2010


Author: objectiser
Date: 2010-12-10 17:38:20 -0500 (Fri, 10 Dec 2010)
New Revision: 502

Added:
   branches/experimental/2.0.x/.project
   branches/experimental/2.0.x/bundles/
   branches/experimental/2.0.x/bundles/org.savara.bpel/
   branches/experimental/2.0.x/bundles/org.savara.bpel/.classpath
   branches/experimental/2.0.x/bundles/org.savara.bpel/.project
   branches/experimental/2.0.x/bundles/org.savara.bpel/Copyright.txt
   branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/
   branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.bpel/build.properties
   branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/export/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/export/BPELLanguageModelStreamExportRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/GeneratorUtil.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELLanguageModel.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELNotation.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/DefaultBPELLanguageModel.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/AbstractBPELModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationInteractionModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/IfModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/LanguageToConversationModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ModelChangeUtils.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/RunModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/SpawnModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhenModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhileModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractCondition.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractInteraction.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELActivity.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElement.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElementFactory.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELGroupingConstruct.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Catch.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CatchAll.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CompensationHandler.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Condition.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ConversionContext.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/DefaultConversionContext.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Else.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Elseif.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/EventHandlers.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Exit.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/FaultHandlers.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Flow.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/For.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ForEach.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/If.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Import.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Invoke.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Link.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnAlarm.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnEvent.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnMessage.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/PartnerLink.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Pick.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Process.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Receive.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/RepeatUntil.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Reply.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Rethrow.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Scope.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ScopeActivity.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Sequence.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Source.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Target.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/TerminationHandler.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Throw.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Until.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Variable.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Wait.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/While.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/InteractionUtil.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/TypeReferenceUtil.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELModelParserRule.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELTokenizer.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/change/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/change/ModelChangeUtilsTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/AbstractInteractionTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELActivityTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELElementTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchAllTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CompensationHandlerTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ConditionTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseIfTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/EventHandlersTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ExitTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FaultHandlersTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FlowTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ForEachTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/IfTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/InvokeTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnAlarmTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnEventTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnMessageTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PartnerLinkTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PickTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ProcessTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReceiveTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RepeatUntilTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReplyTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RethrowTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ScopeTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/SequenceTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TerminationHandlerTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestAbstractInteraction.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELActivity.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELElement.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ThrowTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/VariableTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WaitTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WhileTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/util/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/util/InteractionUtilTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/util/
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/util/XMLUtilsTest.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/.classpath
   branches/experimental/2.0.x/bundles/org.savara.contract.model/.project
   branches/experimental/2.0.x/bundles/org.savara.contract.model/Copyright.txt
   branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.contract.model/build.properties
   branches/experimental/2.0.x/bundles/org.savara.contract.model/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Contract.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/FaultDetails.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Interface.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/MessageExchangePattern.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Namespace.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/OneWayRequestMEP.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/RequestResponseMEP.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Type.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/TypeDefinition.java
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/osgi/
   branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.core/
   branches/experimental/2.0.x/bundles/org.savara.core/.classpath
   branches/experimental/2.0.x/bundles/org.savara.core/.project
   branches/experimental/2.0.x/bundles/org.savara.core/META-INF/
   branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.core/build.properties
   branches/experimental/2.0.x/bundles/org.savara.core/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.core/src/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/osgi/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/AbstractModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelChangeContext.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelGenerator.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeContext.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeRule.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelGenerator.java
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/
   branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/XMLUtils.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.classpath
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.project
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/Copyright.txt
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/META-INF/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/build.properties
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/CDMDefinitions.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/AssignConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterContext.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRule.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRuleFactory.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/DefaultConverterContext.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizeConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizerHandlerConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ParallelConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/PerformConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/Scope.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/SequenceConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhenConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhileConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/cdm/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/cdm/PurchaseGoods.cdm
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/spr/
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/spr/PurchaseGoods.spr
   branches/experimental/2.0.x/bundles/org.savara.wsdl/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath
   branches/experimental/2.0.x/bundles/org.savara.wsdl/.project
   branches/experimental/2.0.x/bundles/org.savara.wsdl/Copyright.txt
   branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.wsdl/build.properties
   branches/experimental/2.0.x/bundles/org.savara.wsdl/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLBinding.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGenerator.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGeneratorFactory.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPDocLitWSDLBinding.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPRPCWSDLBinding.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/osgi/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/util/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/util/WSDLGeneratorUtil.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java
   branches/experimental/2.0.x/bundles/pom.xml
   branches/experimental/2.0.x/distribution/
   branches/experimental/2.0.x/distribution/pom.xml
   branches/experimental/2.0.x/distribution/src/
   branches/experimental/2.0.x/distribution/src/files/
   branches/experimental/2.0.x/distribution/src/files/jbossesb/
   branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-original.xml
   branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-validator.xml
   branches/experimental/2.0.x/distribution/src/files/jbossws-native/
   branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml
   branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml
   branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml
   branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml
   branches/experimental/2.0.x/distribution/src/main/
   branches/experimental/2.0.x/distribution/src/main/assembly/
   branches/experimental/2.0.x/distribution/src/main/assembly/bin.xml
   branches/experimental/2.0.x/distribution/src/main/assembly/src.xml
   branches/experimental/2.0.x/distribution/src/main/release/
   branches/experimental/2.0.x/distribution/src/main/release/JBossORG-EULA.txt
   branches/experimental/2.0.x/distribution/src/main/release/README.txt
   branches/experimental/2.0.x/distribution/src/main/release/ReleaseNotes.txt
   branches/experimental/2.0.x/distribution/src/main/release/install/
   branches/experimental/2.0.x/distribution/src/main/release/install/README.txt
   branches/experimental/2.0.x/distribution/src/main/release/install/build.xml
   branches/experimental/2.0.x/distribution/src/main/release/install/deployment.properties
   branches/experimental/2.0.x/distribution/src/main/release/samples/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.classpath
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.project
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.settings/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.settings/org.eclipse.core.resources.prefs
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/src/
   branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/src/pi4soa.xml
   branches/experimental/2.0.x/docs/
   branches/experimental/2.0.x/docs/gettingstartedguide/
   branches/experimental/2.0.x/docs/gettingstartedguide/pom.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ChoreoMonReady.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckError.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessage.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessageMenu.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExpectedToFail.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportBPMNMenu.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLDialog.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLMenu.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedBPMN.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedHTML.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesDialog.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesMenu.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesNav.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportDialog.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportFileDialog.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportMenu.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportProjectsDialog.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportedProject.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/InvalidPurchasePostTest.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/JavaCompiler1-5Compliant.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/MonitorMenu.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ParticipantAndOtherTypes.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/PurchaseGoods.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/QuickFixDialog.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/RolesAndRelationships.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing1.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing2.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ShowReferencedDescription.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePostTest.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePreTest.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailBlazerMonitorError.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailblazerWebPage.jpg
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/editvalidatorann.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatorannotation.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatortooltip.png
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/master.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/architecture.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/author_group.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/installation.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/overview.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/tap.xml
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/xslt/
   branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/xslt/pdf.xsl
   branches/experimental/2.0.x/docs/pom.xml
   branches/experimental/2.0.x/docs/samplesguide/
   branches/experimental/2.0.x/docs/samplesguide/pom.xml
   branches/experimental/2.0.x/docs/samplesguide/src/
   branches/experimental/2.0.x/docs/samplesguide/src/main/
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/ChoreoMonReady.jpg
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/MonitorMenu.jpg
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/TrailblazerWebPage.jpg
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/master.xml
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/author_group.xml
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/overview.xml
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/servicevalidator.xml
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/xslt/
   branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/xslt/pdf.xsl
   branches/experimental/2.0.x/docs/trailblazer/
   branches/experimental/2.0.x/docs/trailblazer/TBGuide.odt
   branches/experimental/2.0.x/docs/trailblazer/TBGuide.pdf
   branches/experimental/2.0.x/docs/userguide/
   branches/experimental/2.0.x/docs/userguide/pom.xml
   branches/experimental/2.0.x/docs/userguide/src/
   branches/experimental/2.0.x/docs/userguide/src/main/
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorann.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatoranndiag.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorannselect.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel1.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel2.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel3.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig1.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig2.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig3.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatordialog.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatormenu.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorprefs.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorui.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/setconversationtype.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/validatorannotation.png
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/master.xml
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/author_group.xml
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/bpel.xml
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/conversation-validation.xml
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/overview.xml
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/xslt/
   branches/experimental/2.0.x/docs/userguide/src/main/en-US/xslt/pdf.xsl
   branches/experimental/2.0.x/pom.xml
   branches/experimental/2.0.x/samples/
   branches/experimental/2.0.x/samples/jbossesb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.odt
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/build.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/jbossall-client.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/junit-4.1.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/log4j.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/trove.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/xstream-1.2.2.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/log4j.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/monitored_folders/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/build.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/FailedLoanBroker.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/SuccessfulLoanBroker.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/jsp/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/jsp/index.jsp
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/web.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/webservices.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wsdl/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wstools-config.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/build.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/deployment.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/log4j.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/test/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/test/src/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/juddi.properties
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/log4j.xml
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/LoanRequest.scn
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/TrailBlazer.cdm
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/readme.txt
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/template/
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/template/quote.st
   branches/experimental/2.0.x/samples/jbossesb/trailblazer/trailblazer.properties
   branches/experimental/2.0.x/samples/purchasing/
   branches/experimental/2.0.x/samples/purchasing/.project
   branches/experimental/2.0.x/samples/purchasing/BuyConfirmed.xml
   branches/experimental/2.0.x/samples/purchasing/BuyRequest.xml
   branches/experimental/2.0.x/samples/purchasing/CreditCheckInvalid.xml
   branches/experimental/2.0.x/samples/purchasing/CreditCheckOk.xml
   branches/experimental/2.0.x/samples/purchasing/CreditCheckRequest.xml
   branches/experimental/2.0.x/samples/purchasing/InvalidPurchase.scn
   branches/experimental/2.0.x/samples/purchasing/PurchaseGoods.cdm
   branches/experimental/2.0.x/samples/purchasing/SuccessfulPurchase.scn
   branches/experimental/2.0.x/samples/purchasing/completed/
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml
   branches/experimental/2.0.x/samples/purchasing/completed/store/
   branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
   branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml
   branches/experimental/2.0.x/samples/purchasing/creditAgency.xsd
   branches/experimental/2.0.x/samples/purchasing/purchasing.tap
   branches/experimental/2.0.x/samples/purchasing/store.xsd
   branches/experimental/2.0.x/tools/
   branches/experimental/2.0.x/tools/features/
   branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/
   branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/Copyright.txt
   branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/build.properties
   branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/feature.xml
   branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/pom.xml
   branches/experimental/2.0.x/tools/features/org.savara.tools.feature/
   branches/experimental/2.0.x/tools/features/org.savara.tools.feature/Copyright.txt
   branches/experimental/2.0.x/tools/features/org.savara.tools.feature/build.properties
   branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml
   branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml
   branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/
   branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/LICENSE.txt
   branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/build.properties
   branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/feature.xml
   branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/pom.xml
   branches/experimental/2.0.x/tools/features/pom.xml
   branches/experimental/2.0.x/tools/plugins/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGeneratorFactory.java
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/Messages.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/OSGI-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/OSGI-INF/eclipse-resource-loader.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/EclipseResourceLoader.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/actions/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/actions/ValidateAction.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/schema/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/schema/tap.xsd
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Link.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/ObjectFactory.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Phase.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Project.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Relationship.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Resource.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Root.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/URI.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/ResourceLoader.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/TAPModelUtil.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/package-info.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/bpel-cdm-relationship-validator.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/cdm-scenario-relationship-validator.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/Messages.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/RelationshipValidator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ResourceValidator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/TAPValidator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/cdl/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/cdl/CDMScenarioRelationshipValidator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ws/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ws/BPELCDMRelationshipValidator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/resources/
   branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/resources/tap.xsd
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/actions/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/actions/GenerateAction.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/dialogs/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/dialogs/GenerateDialog.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/editor/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/editor/BPELEditorManager.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorException.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorUtil.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Ant.template
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Maven.template
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/ExportBPMNWizard.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/FolderSelectionPage.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNConfiguration.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerationException.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNModelFactory.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNNotationFactory.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/DefaultBPMNConfiguration.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/AbstractBPMNActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNDiagram.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNPool.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ChoiceActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ConditionalActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/JunctionActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ParallelActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/PerformActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ReceiveActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SequenceActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SimpleActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhenActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhileActivity.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/gmf/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/gmf/GMFBPMNNotationFactoryImpl.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/stp/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/stp/STPBPMNModelFactoryImpl.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/LICENSE.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/CorrelationManagerListener.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ExchangeEvent.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/TxnMonitor.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorAction.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLaunchConfigurationConstants.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLauncher.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorMainTab.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorTabGroup.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferencePage.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferences.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/PreferenceInitializer.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ChannelJPanel.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventWrapper.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventsData.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/Monitor.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorExchangeEvent.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorFileFilter.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMainPanel.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMenuBar.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorTreeModelListener.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/SpringUtilities.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/XmlPrettyPrinter.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelclosed.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelempty.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelleaf.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelopen.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/errorsleaf.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesclosed.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesempty.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesopen.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/monitor.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnclosed.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnempty.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnleaf.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnopen.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/unexpectedleaf.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/warningsleaf.png
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/table/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/table/TableSorter.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/preferences/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/preferences/SavaraPreferencePage.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/ValidatorAnnotations.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/annotations.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.presentation
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.template
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.classpath
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.project
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/Copyright.txt
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/META-INF/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/build.properties
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/plugin.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/pom.xml
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/osgi/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/osgi/Activator.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/util/
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/util/XMLUtils.java
   branches/experimental/2.0.x/tools/plugins/pom.xml
   branches/experimental/2.0.x/tools/pom.xml
   branches/experimental/2.0.x/tools/site/
   branches/experimental/2.0.x/tools/site/pom.xml
   branches/experimental/2.0.x/tools/site/site.xml
   branches/experimental/2.0.x/tools/tests/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.classpath
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.project
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/Copyright.txt
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/META-INF/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/build.properties
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/pom.xml
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ContractGeneratorTest.java
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ProtocolContractAllTests.java
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/impl/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/impl/ContractIntrospectorTest.java
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/osgi/
   branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/osgi/Activator.java
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.classpath
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.project
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/META-INF/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/build.properties
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/pom.xml
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/GeneratorTest.java
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Broker.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at CreditAgency.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Supplier.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierQuoteEngine.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierTxnProcessor.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at CreditAgency.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Store.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Seller.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ESBBroker.cdm
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/PurchaseGoods.cdm
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ReqRespFault.cdm
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/ParserTest.java
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Broker.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Buyer.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at CreditAgency.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierQuoteEngine.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierTxnProcessor.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Buyer.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at CreditAgency.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Store.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Buyer.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Seller.scv
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BrokerArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BuyerArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgencyArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Supplier.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/LoanApprovalService at Service.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_BuyerArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_StoreArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Buyer.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_BuyerArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_SellerArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.bpel
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/AllTests.java
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/osgi/
   branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/osgi/Activator.java
   branches/experimental/2.0.x/tools/tests/pom.xml
   branches/experimental/2.0.x/validators/
   branches/experimental/2.0.x/validators/jboss/
   branches/experimental/2.0.x/validators/jboss/common/
   branches/experimental/2.0.x/validators/jboss/common/pom.xml
   branches/experimental/2.0.x/validators/jboss/common/src/
   branches/experimental/2.0.x/validators/jboss/common/src/main/
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jbm-queue-service.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-beans.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-scanning.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-structure.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/common-assembly.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/TrailBlazer.cdm
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/pi4soa.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/configs/validator-config.xml
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/AbstractServiceValidator.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/DefaultValidatorConfig.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/Endpoint.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidator.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorFactory.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorManager.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfig.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigFactory.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigLoader.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorName.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/JMSServiceTracker.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceRecorder.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceValidator.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAValidatorConfigLoader.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/ValidatorConfigGenerator.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java
   branches/experimental/2.0.x/validators/jboss/common/src/main/resources/
   branches/experimental/2.0.x/validators/jboss/esb/
   branches/experimental/2.0.x/validators/jboss/esb/pom.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/deployment.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-esb.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-scanning.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-structure.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/esb-assembly.xml
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java
   branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ValidatorFilter.java
   branches/experimental/2.0.x/validators/jboss/esb/src/main/resources/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/jbossesb/
   branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java
   branches/experimental/2.0.x/validators/jboss/esb/src/test/resources/
   branches/experimental/2.0.x/validators/jboss/pom.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/
   branches/experimental/2.0.x/validators/jboss/wsnative/pom.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/src/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java
   branches/experimental/2.0.x/validators/jboss/wsnative/src/main/resources/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/test/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/test/java/
   branches/experimental/2.0.x/validators/jboss/wsnative/src/test/resources/
   branches/experimental/2.0.x/validators/pom.xml
Log:
Initial experimental version of savara 2, with some refactoring and change to scribble 2. Still plenty of compilation errors to sort out.

Added: branches/experimental/2.0.x/.project
===================================================================
--- branches/experimental/2.0.x/.project	                        (rev 0)
+++ branches/experimental/2.0.x/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>savara-2.0.x</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+  <classpathentry kind="src" path="/org.savara.contract.model"/>
+  <classpathentry kind="src" path="/org.savara.core"/>
+  <classpathentry kind="src" path="/org.savara.wsdl"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol.parser/2.0.0.20101208-M2/org.scribble.protocol.parser-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol.parser/2.0.0.20101208-M2/org.scribble.protocol.parser-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/.project
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/.project	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<projectDescription>
+  <name>org.savara.bpel</name>
+  <comment>The SAVARA project. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects>
+    <project>org.savara.contract.model</project>
+    <project>org.savara.core</project>
+    <project>org.savara.wsdl</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.ManifestBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.SchemaBuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.pde.PluginNature</nature>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA BPEL
+Bundle-SymbolicName: org.savara.bpel
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.bpel.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.apache.commons.logging,
+ org.savara.contract.model,
+ org.savara.wsdl,
+ org.savara.core,
+ org.junit,
+ org.scribble.common,
+ org.scribble.protocol,
+ org.scribble.protocol.parser
+Scribble-Extensions: org.savara.bpel.parser.BPELTokenizer,
+  org.savara.bpel.parser.BPELModelParserRule,
+  org.savara.bpel.model.BPELNotation,
+  org.savara.bpel.model.change.LanguageToConversationModelChangeRule,
+  org.savara.bpel.model.change.ConversationChangeRule,
+  org.savara.bpel.model.change.WhileModelChangeRule,
+  org.savara.bpel.model.change.WhenModelChangeRule,
+  org.savara.bpel.model.change.IfModelChangeRule,
+  org.savara.bpel.model.change.RunModelChangeRule,
+  org.savara.bpel.model.change.SpawnModelChangeRule,
+  org.savara.bpel.model.change.ConversationInteractionModelChangeRule
+Export-Package: org.savara.bpel.model;x-friends:="org.savara.tools.bpel.tests",
+ org.savara.bpel.model.change;x-friends:="org.savara.tools.bpel.tests",
+ org.savara.bpel.model.component;x-friends:="org.savara.tools.bpel.tests"

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/build.properties
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.savara.bpel</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::BPEL</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.parser</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.core</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+	    <dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+           	<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+   </dependencies>
+</project>

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/export/BPELLanguageModelStreamExportRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/export/BPELLanguageModelStreamExportRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/export/BPELLanguageModelStreamExportRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,75 @@
+/*
+ * 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.export;
+
+import java.io.IOException;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.BPELNotation;
+import org.savara.util.XMLUtils;
+import org.scribble.export.ExportRule;
+import org.scribble.export.ExporterContext;
+import org.scribble.export.Formatter;
+import org.scribble.export.stream.AbstractModelStreamExportRule;
+import org.scribble.export.stream.StreamFormatter;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.ModelObject;
+
+/**
+ * This class implements the stream based export rule for the
+ * BPELLanguageModel entity.
+ */
+ at RegistryInfo(extension=ExportRule.class,notation=BPELNotation.NOTATION_CODE)
+public class BPELLanguageModelStreamExportRule extends AbstractModelStreamExportRule {
+
+	/**
+	 * This method determines whether the exporter rule is appropriate
+	 * for the supplied model object and format.
+	 * 
+	 * @param modelObject The model object
+	 * @param format The format
+	 * @return Whether the rule is appropriate for the model object and
+	 * 						format
+	 */
+	public boolean isSupported(ModelObject modelObject, Formatter format) {
+		return(super.isSupported(modelObject, format) &&
+				BPELLanguageModel.class.isAssignableFrom(modelObject.getClass()));
+	}
+	
+	/**
+	 * This method exports the model object.
+	 * 
+	 * @param modelObject The model object
+	 * @param context The context
+	 * @throws IOException Failed to record export information
+	 */
+	public void export(ModelObject modelObject, ExporterContext context)
+							throws java.io.IOException {
+		BPELLanguageModel model=(BPELLanguageModel)modelObject;
+		StreamFormatter formatter=(StreamFormatter)context.getFormatter();
+		
+		try {
+			String text=XMLUtils.toText(model.getBPELProcess().getDOMElement());			
+			formatter.record(text.getBytes());
+			
+		} catch(Exception e) {
+			throw new java.io.IOException("Failed to get BPEL process text");
+		}
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/GeneratorUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/GeneratorUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/GeneratorUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+import org.scribble.protocol.model.Role;
+
+/**
+ * This class provides general utility functions for
+ * use when generating artefacts.
+ */
+public class GeneratorUtil {
+
+	/**
+	 * This method returns the WSDL file name for the supplied role and local
+	 * conversation model.
+	 * 
+	 * @param role The role
+	 * @param localcm The local conversation model
+	 * @param fileNum The file name (zero being the main wsdl file)
+	 * @return The file name
+	 */
+	public static String getWSDLFileName(Role role, String modelName, String suffix) {
+		return(modelName+"_"+role.getName()+suffix+".wsdl");
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELLanguageModel.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELLanguageModel.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELLanguageModel.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,60 @@
+/*
+ * 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.model;
+
+import org.savara.bpel.model.component.Process;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a BPEL model.
+ *  
+ * @author gary
+ */
+public interface BPELLanguageModel {
+
+	/**
+	 * This method validates the ESB model and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	public void validate(ModelListener l);
+	
+	/**
+	 * This method returns the source model reference.
+	 * 
+	 * @return The source model reference
+	 */
+	public ModelReference getModelReference();
+
+	/**
+	 * This textual contents of the model.
+	 * 
+	 * @return The textual contents
+	 */
+	public String getOriginalContents();
+	
+	/**
+	 * This method returns the BPEL Process.
+	 * 
+	 * @return The BPEL Process
+	 */
+	public Process getBPELProcess();
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELNotation.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELNotation.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/BPELNotation.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+/*
+ * 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.model;
+
+import org.scribble.extensions.*;
+import org.scribble.model.ModelReference;
+import org.scribble.model.Notation;
+
+/**
+ * The notation class for the BPEL language.
+ */
+ at RegistryInfo(extension=org.scribble.model.Notation.class)
+public class BPELNotation extends org.scribble.model.AbstractNotation {
+
+	public static final String NOTATION_CODE = "bpel";
+
+	/**
+	 * This is the default constructor for the BPEL notation.
+	 */
+	public BPELNotation() {
+		super(NOTATION_CODE, "BPEL", false);
+	}
+	
+	/**
+	 * This method returns the initial description associated
+	 * with the supplied reference.
+	 * 
+	 * @param ref The reference
+	 * @return The initial description, or null if no description
+	 */
+	@Override
+	public String getInitialDescription(ModelReference ref) {
+		StringBuffer buf=new StringBuffer();
+				
+		return(buf.toString());
+	}
+
+	/**
+	 * This method returns the optional 'super' notation.
+	 * If defined, then this notation is a derived notation
+	 * from the 'super' notation.
+	 * 
+	 * @return The optional 'super' notation
+	 */
+	@Override
+	public Notation getSuperNotation() {
+		return(m_superNotation);
+	}
+
+	private Notation m_superNotation=new org.scribble.conversation.model.ConversationNotation();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/DefaultBPELLanguageModel.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/DefaultBPELLanguageModel.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/DefaultBPELLanguageModel.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,188 @@
+/*
+ * 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.model;
+
+//import org.apache.commons.logging.*;
+import org.savara.bpel.model.component.Process;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.protocol.model.*;
+import org.scribble.model.admin.Context;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.common.logging.Journal;
+import org.scribble.model.resolutions.*;
+
+/**
+ * This class represents a BPEL model.
+ *  
+ * @author gary
+ */
+public class DefaultBPELLanguageModel extends org.scribble.lang.model.LanguageModel
+					implements BPELLanguageModel {
+
+	private static final long serialVersionUID = 7625564863751533521L;
+
+	public static final String BPEL_NOTATION = "bpel";
+
+	/**
+	 * This constructor is initialized with the BPEL description.
+	 * 
+	 * @param source The model reference for the BPEL source
+	 * @param elem The BPEL document
+	 * @param contents The textual contents
+	 */
+	public DefaultBPELLanguageModel(ModelReference source, org.w3c.dom.Element elem,
+							String contents, Context context) {
+		m_source = source;
+		m_contents = contents;
+		m_bpelProcess = new Process(this, elem);
+		
+		Namespace ns=new Namespace();
+		ns.setName(source.getNamespace());
+		setNamespace(ns);
+		
+		// Initialize the existing model
+		Conversation conv=m_bpelProcess.convert(context);
+		
+		if (conv != null) {
+			getConversations().add(conv);
+		} else {
+			// Log error?
+		}
+	}
+	
+	/**
+	 * This constructor initializes a new BPEL process.
+	 * 
+	 * @param source The model reference for the BPEL description
+	 */
+	public DefaultBPELLanguageModel(ModelReference source) {
+		m_source = source;
+		
+		m_bpelProcess = new Process(this);
+	}
+	
+	/**
+	 * This method returns the source model reference.
+	 * 
+	 * @return The source model reference
+	 */
+	public ModelReference getModelReference() {
+		return(m_source);
+	}
+
+	/**
+	 * Generate a key for use in accessing the service related to
+	 * the supplied category and name.
+	 * 
+	 * @param category The category
+	 * @param name The service name
+	 * @return The key
+	 */
+	protected String getKey(String category, String name) {
+		return(category+"/"+name);
+	}
+	
+	/**
+	 * This method validates the ESB model and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	public void validate(ModelListener l) {
+
+	}
+	
+	/**
+	 * This textual contents of the model.
+	 * 
+	 * @return The textual contents
+	 */
+	public String getOriginalContents() {
+		return(m_contents);
+	}
+	
+	/**
+	 * This method returns the BPEL Process.
+	 * 
+	 * @return The BPEL Process
+	 */
+	public Process getBPELProcess() {
+		return(m_bpelProcess);
+	}
+		
+	//private static Log logger = LogFactory.getLog(DefaultBPELLanguageModel.class);
+
+	private ModelReference m_source=null;
+	private Process m_bpelProcess=null;
+	private String m_contents=null;
+	
+	public class InnerModelListener implements ModelListener {
+
+		public InnerModelListener(ModelListener l) {
+			m_listener = l;
+		}
+		
+		public void error(ModelIssue issue) {
+						
+			/*
+			issue.getProperties().put(ModelListener.RESOLUTIONS, ModelListener.SHOW_REFERENCE_DESCRIPTION_RESOLUTION);
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL, m_source);
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL_START_POSITION,
+						issue.getModelObject().getSource().getStartPosition());
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL_END_POSITION,
+						issue.getModelObject().getSource().getEndPosition());
+			if (issue.getModelObject().getSource().getComponentURI() != null) {
+				issue.getProperties().put(ModelListener.REFERENCE_MODEL_COMPONENT,
+						issue.getModelObject().getSource().getComponentURI());
+			}
+			*/
+			ShowReferencedDescription res=new ShowReferencedDescription();
+			res.setModel(m_source);
+			res.setSourceReference(issue.getModelObject().getSource());
+			
+			issue.getResolutions().add(res);
+			
+			m_listener.error(issue);
+		}
+
+		public void warning(ModelIssue issue) {
+			/*
+			issue.getProperties().put(ModelListener.RESOLUTIONS, ModelListener.SHOW_REFERENCE_DESCRIPTION_RESOLUTION);
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL, m_source);
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL_START_POSITION,
+						issue.getModelObject().getSource().getStartPosition());
+			issue.getProperties().put(ModelListener.REFERENCE_MODEL_END_POSITION,
+						issue.getModelObject().getSource().getEndPosition());
+			if (issue.getModelObject().getSource().getComponentURI() != null) {
+				issue.getProperties().put(ModelListener.REFERENCE_MODEL_COMPONENT,
+						issue.getModelObject().getSource().getComponentURI());
+			}
+			*/
+			
+			ShowReferencedDescription res=new ShowReferencedDescription();
+			res.setModel(m_source);
+			res.setSourceReference(issue.getModelObject().getSource());
+						
+			issue.getResolutions().add(res);
+
+			m_listener.warning(issue);
+		}
+		
+		private ModelListener m_listener=null;
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/AbstractBPELModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/AbstractBPELModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/AbstractBPELModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,90 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.Sequence;
+import org.scribble.protocol.model.*;
+import org.savara.protocol.change.*;
+
+/**
+ * This is the abstract ESB model change rule.
+ */
+public abstract class AbstractBPELModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and inserted
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object being inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				ProtocolModel model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (context.getParent() instanceof Sequence &&
+					model instanceof BPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and deleted model object.
+	 * 
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object to be removed
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isDeleteSupported(ModelChangeContext context,
+					ProtocolModel model, ModelObject mobj) {
+		boolean ret=false;
+		
+		return(ret);
+	}
+
+	/**
+	 * This method removes the supplied model object from the
+	 * supplied model. The model object representation must
+	 * contain the necessary model specific to remove the 
+	 * object from the underlying model representation.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object to be deleted
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean delete(ModelChangeContext context,
+				ProtocolModel model, ModelObject mobj) {
+		boolean ret=false;
+
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,243 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.generator.GeneratorUtil;
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.savara.bpel.model.component.Import;
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Conversation.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class ConversationChangeRule extends AbstractModelChangeRule {
+
+	//private static final String NAME_SUFFIX = "_main";
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof Conversation &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		Conversation conv=(Conversation)mobj;
+		String roleNamespace=null;
+		
+		Sequence seq=new Sequence(bpelModel);
+		
+		// Check if root conversation
+		if (conv.getParent() instanceof Model) {
+			
+			// Set the name of the process
+			bpelModel.getBPELProcess().setName(conv.getLocatedName().getName()+"_"+
+					conv.getLocatedName().getRole().getName());
+			
+			// Get contract
+			Contract contract=ModelChangeUtils.getContract(context, conv.getLocatedName().getRole().getName());
+			
+			if (contract != null) {
+				roleNamespace = contract.getNamespace();
+				
+				// Set namespace
+				bpelModel.getBPELProcess().setTargetNamespace(contract.getNamespace());
+				
+				// Add other namespaces
+				for (org.savara.contract.model.Namespace ns : contract.getNamespaces()) {
+					bpelModel.getBPELProcess().initNamespace(ns.getURI(), ns.getPrefix());
+				}
+			}
+			
+			String namespace=((Model)conv.getModel()).
+						getNamespace().getName();
+
+			String ctype=null;
+			
+			// Check if conversation has a 'conforms to' reference
+			if (conv.getConformsTo().size() > 0) {
+				// Set conversation type based on first 'conforms to'
+				// reference
+				ConformanceReference cref=conv.getConformsTo().get(0);
+				
+				ctype = cref.getNamespace()+"."+
+						cref.getLocalpart()+"@"+
+						cref.getLocatedRole();
+			} else {
+				// Set conversation type based on conversation
+				// namespace and name
+				ctype = namespace+"."+
+						conv.getLocatedName().getName()+"@"+
+						conv.getLocatedName().getRole().getName();
+			}
+			
+			if (ctype != null) {
+				bpelModel.getBPELProcess().setConversationType(ctype);
+			}
+			
+			// Add import for this role
+			addImport(context, bpelModel, conv, context.getRole());
+
+			// Add import statements for partner roles
+			java.util.List<Role> roles=conv.getRoles();
+			
+			for (int i=0; i < roles.size(); i++) {
+				addImport(context, bpelModel, conv, roles.get(i));
+			}
+			
+			// Add import for partner link types
+			Import imp=new Import(bpelModel);
+			imp.setLocation(bpelModel.getBPELProcess().getName()+"Artifacts.wsdl");
+			imp.setNamespace(roleNamespace);
+			imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
+			
+			bpelModel.getBPELProcess().addImport(imp, -1);
+			
+			// Add sequence to model
+			bpelModel.getBPELProcess().setActivity(seq);
+			
+		} else if (context.getParent() instanceof Sequence) {
+			
+			// Create a scope
+			Scope scope=new Scope(bpelModel);
+
+			((Sequence)context.getParent()).addActivity(scope, -1);
+			
+			// NOTE: Currently needs to be added after adding scope
+			// to parent sequence, as otherwise the DOM element
+			// associated with the 'seq' sequence becomes
+			// disconnected from the actual document - due to
+			// the fact that added elements are copied (in
+			// turn due to an xml parser exception).
+			scope.setActivity(seq);
+		}
+
+		// Process the activities within the conversation
+		java.util.List<Activity> acts=conv.getBlock().getContents();
+		
+		Object parent=context.getParent();
+		
+		context.setParent(seq);
+		
+		for (int i=0; i < acts.size(); i++) {
+			if ((acts.get(i) instanceof Definition) == false) {
+				context.insert(model, acts.get(i), null);
+			}
+		}
+		
+		// Reset old parent
+		context.setParent(parent);
+		
+		return(true);
+	}
+	
+	/**
+	 * This method adds an import statement for the contract associated with the
+	 * supplied role.
+	 * 
+	 * @param context The context
+	 * @param bpelModel The model
+	 * @param conv The conversation
+	 * @param role The role
+	 */
+	protected void addImport(ModelChangeContext context, DefaultBPELLanguageModel bpelModel,
+								Conversation conv, Role role) {
+		if (role.getAnnotations().containsKey(Contract.class.getName())) {
+			Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
+
+			boolean gen=false;
+			
+			java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
+			
+			while (gen == false && iter.hasNext()) {
+				Interface intf=iter.next();
+				
+				if (intf.getMessageExchangePatterns().size() > 0) {
+					gen = true;
+				}
+			}
+			
+			if (gen) {
+				String fileName=GeneratorUtil.getWSDLFileName(role,
+								conv.getLocatedName().getName(), "");
+				
+				Import imp=new Import(bpelModel);
+				
+				imp.setLocation(fileName);
+				imp.setNamespace(contract.getNamespace());
+				imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
+				
+				bpelModel.getBPELProcess().addImport(imp, -1);
+			}
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationInteractionModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationInteractionModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ConversationInteractionModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,472 @@
+/*
+ * 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.model.change;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.savara.bpel.model.util.*;
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.wsdl.util.WSDLGeneratorUtil;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Conversation Interaction.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class ConversationInteractionModelChangeRule extends AbstractBPELModelChangeRule {
+
+	private static final String INTERFACE_NAME = "interfaceName";
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and inserted
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object being inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+					Model model, ModelObject mobj,
+					ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof ConversationInteraction &&
+				super.isInsertSupported(context, model, mobj, ref)) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		BPELLanguageModel bpelModel=(BPELLanguageModel)model;
+		ConversationInteraction interaction=(ConversationInteraction)mobj;
+		boolean ret=false;
+		AbstractInteraction act=null;
+		PartnerLink pl=new PartnerLink(bpelModel);
+		Role role=null;
+		String portType=null;	
+		String varName=null; //InteractionPatterns.getVariableName(interaction);
+		Interface intf=null;
+			
+		if (interaction.getEnclosingDefinition() != null) {
+			role = interaction.getEnclosingDefinition().
+						getLocatedName().getRole();
+		}
+		
+		// Identify port type role
+		String prefix=null;
+		
+		String mainPrefix=null;
+		
+		Contract contract=ModelChangeUtils.getContract(context, context.getRole().getName());
+		if (contract != null) {
+			mainPrefix = bpelModel.getBPELProcess().addNamespace(contract.getNamespace());
+		}
+		
+		Role roleType=null;
+		
+		if (InteractionUtil.isRequest(interaction)) {
+			roleType = interaction.getToRole();
+			if (roleType == null) {
+				roleType = role;
+			}
+		} else {
+			roleType = interaction.getFromRole();
+			if (roleType == null) {
+				roleType = role;
+			}
+		}
+		
+		if (roleType != null) {
+			contract = ModelChangeUtils.getContract(context, roleType.getName());
+
+			if (contract != null) {			
+				if (interaction.getAnnotations().containsKey(INTERFACE_NAME)) {
+					String intfName=(String)interaction.getAnnotations().get(INTERFACE_NAME);
+					intf = contract.getInterface(intfName);
+					
+					if (intf == null) {
+						// Try localpart
+						javax.xml.namespace.QName qname=javax.xml.namespace.QName.valueOf(intfName);
+						intf = contract.getInterface(qname.getLocalPart());
+					}
+				} else if (contract.getInterfaces().size() > 0) {
+					intf = contract.getInterfaces().iterator().next();
+				}
+			}
+		}
+		
+		if (intf != null) {
+			portType = intf.getName();
+			
+			prefix = bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+			
+			if (prefix != null) {
+				portType = prefix+":"+portType;
+			}
+		}
+
+		// Create variable
+		//if (varName != null) {
+			QName qname=null;
+			if (InteractionUtil.isRequest(interaction)) {
+				qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+									interaction.getMessageSignature().getOperation());
+			} else if (InteractionPatterns.isFaultResponse(interaction)) {
+				qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+						InteractionPatterns.getFaultName(interaction));
+			} else {
+				qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+									interaction.getMessageSignature().getOperation());
+			}
+			
+			varName = qname.getLocalPart()+"Var";
+
+			org.savara.bpel.model.component.Variable var=
+					bpelModel.getBPELProcess().getVariable(varName);
+
+			if (var == null) {
+				var = new org.savara.bpel.model.component.Variable(bpelModel);
+				var.setName(varName);
+				
+				String mesgType=qname.getLocalPart();
+				
+				// Find namespace prefix
+				if (qname.getNamespaceURI() != null) {
+					String pfix=bpelModel.getBPELProcess().addNamespace(qname.getNamespaceURI());
+					
+					if (pfix != null) {
+						mesgType = pfix+":"+mesgType;
+					}
+				}
+				
+				var.setMessageType(mesgType);
+				
+				bpelModel.getBPELProcess().addVariable(var, -1);
+			}
+		//}
+
+		// Check if send or receive
+		if (InteractionUtil.isSend(interaction)) {
+			
+			// TODO: Record variables against relevant interaction
+			// based activity - probably only mechanism for
+			// establishing message type
+
+			if (InteractionUtil.isRequest(interaction)) {
+				
+				if (InteractionPatterns.isFaultHandlerRequired(interaction)) {
+					
+					Scope scope=new Scope(bpelModel);
+					
+					if (context.getParent() instanceof Sequence) {
+						((Sequence)context.getParent()).addActivity(scope, -1);
+					}
+					
+					FaultHandlers fhs=new FaultHandlers(bpelModel);
+					
+					Sequence seq=new Sequence(bpelModel);
+					
+					scope.setActivity(seq);
+					scope.setFaultHandlers(fhs);
+					
+					context.setParent(scope.getActivity());
+				}
+				
+				act = new Invoke(bpelModel);
+				
+				pl.setPartnerRole(interaction.getToRole().getName()+"Requester");
+				pl.setName(role.getName()+"To"+interaction.getToRole().getName());
+				
+				String plt=role.getName()+"To"+interaction.getToRole().getName()+"LT";
+				
+				if (mainPrefix != null) {
+					plt = mainPrefix+":"+plt;
+				}
+				
+				pl.setPartnerLinkType(plt);
+
+				//portType = interaction.getToRole().getName()+"PT";
+				
+				if (varName != null) {
+					((Invoke)act).setInputVariable(varName);
+				}
+				
+			} else {
+				act = new Reply(bpelModel);
+		
+				pl.setMyRole(role.getName()+"Service");
+				pl.setName(interaction.getToRole().getName()+"To"+role.getName());
+				
+				String plt=interaction.getToRole().getName()+"To"+role.getName()+"Service"+"LT";
+				
+				if (mainPrefix != null) {
+					plt = mainPrefix+":"+plt;
+				}
+				
+				pl.setPartnerLinkType(plt);
+
+				//portType = role.getName()+"PT";
+				
+				if (InteractionPatterns.isFaultResponse(interaction)) {
+					String faultName=InteractionPatterns.getFaultName(interaction);
+					
+					// Find namespace prefix
+					//if (intf != null) {
+					//	String prefix=bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+						
+						if (prefix != null) {
+							faultName = prefix+":"+faultName;
+						}
+					//}
+					
+					((Reply)act).setFaultName(faultName);
+				}
+				
+				if (varName != null) {
+					((Reply)act).setVariable(varName);
+				}
+			}
+		} else if (InteractionPatterns.isResponseInFaultHandler(interaction) == false) {
+			
+			if (InteractionPatterns.isSyncNormalResponse(interaction)) {
+				
+				//System.out.println("ADD RESP VAR TO PRECEDING");
+				if (context.getParent() instanceof Sequence) {
+					java.util.List<BPELActivity> acts=
+							((Sequence)context.getParent()).getActivities();
+					
+					if (acts.size() > 0 &&
+							acts.get(acts.size()-1) instanceof Invoke) {
+						Invoke invoke=(Invoke)acts.get(acts.size()-1);
+						
+						invoke.setOutputVariable(varName);
+					}
+				}
+				
+			} else if (InteractionPatterns.isInteractionPickPathTrigger(interaction) == false) {
+				act = new Receive(bpelModel);
+				
+				String intfName=(String)interaction.getAnnotations().get("interfaceName");
+				
+				if (intfName != null && intfName.trim().length() > 0) {
+					intfName = javax.xml.namespace.QName.valueOf(intfName).getLocalPart();
+				} else {
+					intfName = role.getName();
+				}
+	
+				if (InteractionUtil.isRequest(interaction)) {
+		
+					pl.setMyRole(intfName); //role.getName()+"Service");
+					//pl.setPartnerRole(interaction.getToRole().getName());
+					pl.setName(interaction.getFromRole().getName()+"To"+role.getName());
+					
+					String plt=interaction.getFromRole().getName()+"To"+role.getName()+"Service"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
+	
+					//portType = role.getName()+"PT";
+				} else {
+					pl.setMyRole(intfName); //role.getName()+"Requester");
+					pl.setPartnerRole(interaction.getFromRole().getName()+"Service");
+					pl.setName(role.getName()+"To"+interaction.getFromRole().getName());
+					
+					String plt=role.getName()+"To"+interaction.getFromRole().getName()+"Requester"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
+	
+					//portType = role.getName()+
+					//		interaction.getFromRole().getName()+"CallbackPT";				
+				}
+
+				if (varName != null) {
+					((Receive)act).setVariable(varName);
+				}
+				
+				// Check if create instance
+				if (org.scribble.model.util.InteractionUtil.isInitialInteraction(interaction)) {
+					((Receive)act).setCreateInstance(true);
+				}
+			}
+		}
+		
+		// TODO: Possibly if the channel is set, then
+		// might be a callback channel, so could use
+		// channel name to reflect callback port
+
+		// TODO: If both myRole and partnerRole are specified
+		// then one is a callback porttype
+		
+		if (act != null) {
+			
+			// Set the name
+			act.setName(InteractionUtil.getName(interaction));
+			
+			if (context.getParent() instanceof Sequence) {
+				((Sequence)context.getParent()).addActivity(act, -1);
+				
+				ret = true;
+			}	
+
+			// Create partner link
+			PartnerLink other=
+					bpelModel.getBPELProcess().getPartnerLink(pl.getName());
+			if (other == null) {
+				bpelModel.getBPELProcess().addPartnerLink(pl, -1);
+			} else {
+				if (other.getPartnerRole() == null &&
+						pl.getPartnerRole() != null) {
+					other.setPartnerRole(pl.getPartnerRole());
+				}
+				if (other.getMyRole() == null &&
+						pl.getMyRole() != null) {
+					other.setMyRole(pl.getMyRole());
+				}
+			}
+			
+			// Set details on interaction
+			act.setPartnerLink(pl.getName());
+			
+			act.setPortType(portType);
+	
+			if (interaction.getMessageSignature() != null) {
+				act.setOperation(interaction.getMessageSignature().getOperation());
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and modified model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isUpdateSupported(ModelChangeContext context,
+					Model model, ModelObject fromObj, ModelObject toObj) {
+		boolean ret=false;
+		
+		if (fromObj instanceof ConversationInteraction &&
+				toObj instanceof ConversationInteraction &&
+				model instanceof BPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method modifies an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean update(ModelChangeContext context,
+				Model model, ModelObject fromObj, ModelObject toObj) {
+		boolean ret=false;
+		//BPELLanguageModel bpelModel=(BPELLanguageModel)model;
+		//ConversationInteraction fromInteraction=(ConversationInteraction)fromObj;
+		//ConversationInteraction toInteraction=(ConversationInteraction)toObj;
+		
+		return(ret);
+	}
+		
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and deleted model object.
+	 * 
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object to be removed
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isDeleteSupported(ModelChangeContext context,
+						Model model, ModelObject mobj) {
+		boolean ret=false;
+		
+		if (mobj instanceof ConversationInteraction &&
+				super.isDeleteSupported(context, model, mobj)) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/IfModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/IfModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/IfModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,483 @@
+/*
+ * 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.model.change;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.savara.bpel.model.util.InteractionUtil;
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.wsdl.util.WSDLGeneratorUtil;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the If.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class IfModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof org.scribble.conversation.model.If &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		org.scribble.conversation.model.If elem=
+					 (org.scribble.conversation.model.If)mobj;
+		java.util.List<Block> paths=elem.getPaths();
+		
+		// Check if the 'If' construct is to handle responses
+		// to a preceding request being sent
+		if (InteractionPatterns.isResponseAndFaultHandler(elem)) {
+			
+			if (context.getParent() instanceof Sequence) {
+				// Find fault handler
+				Sequence seq=(Sequence)context.getParent();
+				Scope scope=new Scope(bpelModel,
+						(org.w3c.dom.Element)seq.getDOMElement().getParentNode());
+				FaultHandlers fh=scope.getFaultHandlers();
+				
+				for (int i=0; i < paths.size(); i++) {
+					Block path=paths.get(i);
+					
+					if (path.getContents().size() > 0) {
+						Activity act=path.getContents().get(0);
+						Sequence subseq=null;
+						
+						if (act instanceof Interaction &&
+								InteractionPatterns.isFaultResponse(
+										(Interaction)act)) {
+							String faultName=InteractionPatterns.getFaultName((Interaction)act);
+							
+							Contract contract = ModelChangeUtils.getContract(context,
+										((Interaction)act).getFromRole().getName());
+							
+							// Define fault message type
+							QName qname= WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+												faultName);
+							
+							String faultVarName=qname.getLocalPart()+"Var";
+							String mesgType=InteractionPatterns.getMessageTypeLocalPart((Interaction)act);
+							//String namespace=InteractionPatterns.getMessageTypeNameSpace((Interaction)act);
+					
+							Catch c=new Catch(bpelModel);
+							c.setFaultVariable(faultVarName);
+							
+							// Find namespace prefix
+							if (qname != null) {
+								String prefix=bpelModel.getBPELProcess().addNamespace(qname.getNamespaceURI());
+								
+								if (prefix != null) {
+									mesgType = prefix+":"+qname.getLocalPart();
+									faultName = prefix+":"+faultName;
+								}
+							}
+							
+							c.setFaultName(faultName);
+							c.setFaultMessageType(mesgType);
+							
+							// Add catch to fault handler
+							fh.addCatch(c);
+							
+							subseq = new Sequence(bpelModel);
+							c.setActivity(subseq);
+						} else {
+							subseq = seq;
+
+							java.util.List<BPELActivity> acts=
+								((Sequence)context.getParent()).getActivities();
+							
+							if (acts.size() > 0 && act instanceof Interaction &&
+									acts.get(acts.size()-1) instanceof Invoke) {
+								Contract contract = ModelChangeUtils.getContract(context,
+										((Interaction)act).getFromRole().getName());
+							
+								QName qname=null;
+								if (InteractionUtil.isRequest((Interaction)act)) {
+									qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+											((Interaction)act).getMessageSignature().getOperation());
+								} else if (InteractionPatterns.isFaultResponse((Interaction)act)) {
+									qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+											InteractionPatterns.getFaultName((Interaction)act));
+								} else {
+									qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+														((Interaction)act).getMessageSignature().getOperation());
+								}
+
+								String varName=qname.getLocalPart()+"Var"; //InteractionPatterns.getVariableName((Interaction)act);
+								Invoke invoke=(Invoke)acts.get(acts.size()-1);
+								
+								invoke.setOutputVariable(varName);
+
+								// Create variable
+								if (varName != null) {
+									createVariable(context, varName, (Interaction)act, bpelModel);
+								}
+							}
+						}
+						
+						Object parent=context.getParent();
+						
+						context.setParent(subseq);
+						
+						for (int j=1; j < path.getContents().size(); j++) {
+							context.insert(model, path.getContents().get(j), null);
+						}
+						
+						context.setParent(parent);
+					}
+				}
+			} else {
+				// TODO: Error handling
+			}
+		} else if (InteractionPatterns.isSwitch(elem)) {
+			Pick act=new Pick(bpelModel);
+			
+			if (context.getParent() instanceof Sequence) {
+				((Sequence)context.getParent()).addActivity(act, -1);
+			}
+			
+			Role role=null;
+		
+			if (elem.getEnclosingDefinition() != null) {
+				role = elem.getEnclosingDefinition().
+							getLocatedName().getRole();
+			}
+
+			for (int i=0; i < paths.size(); i++) {
+				Block path=paths.get(i);
+				
+				Sequence seq=new Sequence(bpelModel);
+				
+				// Process the activities within the conversation
+				java.util.List<Activity> acts=path.getContents();
+							
+				Object parent=context.getParent();
+				
+				context.setParent(seq);
+				
+				for (int j=0; j < acts.size(); j++) {
+					context.insert(model, acts.get(j), null);
+				}
+				
+				context.setParent(parent);
+				
+				Interaction recv=InteractionPatterns.getPickPathInteraction(path);
+				
+				OnMessage onm=new OnMessage(bpelModel);
+				onm.setActivity(seq);
+				
+				PartnerLink pl=new PartnerLink(bpelModel);
+				String portType=null;
+				
+				String prevPLName=role.getName()+"To"+recv.getFromRole().getName();
+				
+				String mainPrefix=null;
+				
+				Contract contract=ModelChangeUtils.getContract(context, context.getRole().getName());
+				if (contract != null) {
+					mainPrefix = bpelModel.getBPELProcess().addNamespace(contract.getNamespace());
+				}
+				
+				// Check if partner link already exists in
+				// other direction
+				PartnerLink prev=
+					bpelModel.getBPELProcess().getPartnerLink(prevPLName);
+
+				if (InteractionUtil.isRequest(recv) && prev == null) {
+					
+					pl.setMyRole(role.getName()+"Service");
+					//pl.setPartnerRole(interaction.getToRole().getName());
+					pl.setName(recv.getFromRole().getName()+"To"+role.getName());
+					
+					String plt=recv.getFromRole().getName()+"To"+role.getName()+"Service"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
+
+					contract = ModelChangeUtils.getContract(context, role.getName());
+					
+					if (contract != null && contract.getInterfaces().size() > 0) {
+						Interface intf = contract.getInterfaces().iterator().next();
+						
+						portType = intf.getName();
+						
+						String prefix = bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+						
+						if (prefix != null) {
+							portType = prefix+":"+portType;
+						}
+					}
+				} else {
+					pl.setMyRole(role.getName()+"Requester");
+					pl.setPartnerRole(recv.getFromRole().getName()+"Service");
+					pl.setName(role.getName()+"To"+recv.getFromRole().getName());
+					
+					String plt=role.getName()+"To"+recv.getFromRole().getName()+"Requester"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
+
+					//portType = role.getName()+
+					//		recv.getFromRole().getName()+"CallbackPT";				
+
+					contract = ModelChangeUtils.getContract(context, recv.getFromRole().getName());
+					if (contract != null && contract.getInterfaces().size() > 0) {
+						Interface intf = contract.getInterfaces().iterator().next();
+						
+						portType = intf.getName();
+						
+						String prefix = bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+						
+						if (prefix != null) {
+							portType = prefix+":"+portType;
+						}
+					}
+				}
+				
+				QName qname=null;
+				if (InteractionUtil.isRequest(recv)) {
+					qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+							recv.getMessageSignature().getOperation());
+				} else if (InteractionPatterns.isFaultResponse(recv)) {
+					qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+							InteractionPatterns.getFaultName(recv));
+				} else {
+					qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+							recv.getMessageSignature().getOperation());
+				}
+
+				String varName=qname.getLocalPart()+"Var"; //InteractionPatterns.getVariableName(recv);
+				
+				if (varName != null) {
+					onm.setVariable(varName);
+				}
+				
+				// Create partner link
+				PartnerLink other=
+					bpelModel.getBPELProcess().getPartnerLink(pl.getName());
+
+				if (other == null) {
+					bpelModel.getBPELProcess().addPartnerLink(pl, -1);
+				} else {
+					if (other.getPartnerRole() == null &&
+							pl.getPartnerRole() != null) {
+						other.setPartnerRole(pl.getPartnerRole());
+					}
+					if (other.getMyRole() == null &&
+							pl.getMyRole() != null) {
+						other.setMyRole(pl.getMyRole());
+					}
+				}
+				
+				// Create variable
+				if (varName != null) {
+					createVariable(context, varName, recv, bpelModel);
+				}
+				
+				// Check if create instance
+				if (org.scribble.model.util.InteractionUtil.isInitialInteraction(recv)) {
+					act.setCreateInstance(true);
+				}
+				
+				// Set details on interaction
+				onm.setPartnerLink(pl.getName());
+				onm.setPortType(portType);
+
+				MessageSignature ms=recv.getMessageSignature();
+				if (ms.getOperation() != null) {
+					onm.setOperation(ms.getOperation());
+				}
+				
+				act.addOnMessage(onm, -1);
+			}
+			
+		} else {
+			If act=new If(bpelModel);
+			
+			if (context.getParent() instanceof Sequence) {
+				((Sequence)context.getParent()).addActivity(act, -1);
+			}
+			
+			for (int i=0; i < paths.size(); i++) {
+				Block path=paths.get(i);
+				
+				Sequence seq=new Sequence(bpelModel);
+				
+				// Process the activities within the conversation
+				java.util.List<Activity> acts=path.getContents();
+							
+				Object parent=context.getParent();
+				
+				context.setParent(seq);
+				
+				for (int j=0; j < acts.size(); j++) {
+					context.insert(model, acts.get(j), null);
+				}
+				
+				context.setParent(parent);
+	
+				if (i == 0) {
+					act.setActivity(seq);
+				} else if (i == elem.getPaths().size()-1) {
+					Else construct=new Else(bpelModel);
+					construct.setActivity(seq);
+					
+					act.setElsePath(construct);
+				} else {
+					Elseif construct=new Elseif(bpelModel);
+					
+					construct.setActivity(seq);
+					
+					act.addElseIfPath(construct);
+				}
+			}
+		}
+				
+		return(true);
+	}
+	
+	/**
+	 * This method creates a variable, if one does not already exist for the
+	 * supplied name, with the message type associated with the supplied
+	 * interaction.
+	 * 
+	 * @param varName The variable name
+	 * @param interaction The interaction associated with the variable
+	 * @param bpelModel The BPEL model
+	 */
+	protected void createVariable(ModelChangeContext context, String varName,
+						Interaction interaction, BPELLanguageModel bpelModel) {
+		org.savara.bpel.model.component.Variable var=
+					bpelModel.getBPELProcess().getVariable(varName);
+
+		if (var == null) {
+			Role role=null;
+			
+			if (interaction.getEnclosingDefinition() != null) {
+				role = interaction.getEnclosingDefinition().
+							getLocatedName().getRole();
+			}
+
+			var = new org.savara.bpel.model.component.Variable(bpelModel);
+			var.setName(varName);
+			
+			Role roleType=null;
+			Contract contract=null;
+			
+			if (InteractionUtil.isRequest(interaction)) {
+				roleType = interaction.getToRole();
+				if (roleType == null) {
+					roleType = role;
+				}
+			} else {
+				roleType = interaction.getFromRole();
+				if (roleType == null) {
+					roleType = role;
+				}
+			}
+			
+			if (roleType != null) {
+				contract = ModelChangeUtils.getContract(context, roleType.getName());
+			}
+
+			QName qname=null;
+			if (InteractionUtil.isRequest(interaction)) {
+				qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+									interaction.getMessageSignature().getOperation());
+			} else {
+				qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+									interaction.getMessageSignature().getOperation());
+			}
+
+			String mesgType=qname.getLocalPart();
+			
+			// Find namespace prefix
+			if (qname.getNamespaceURI() != null) {
+				String pfix=bpelModel.getBPELProcess().addNamespace(qname.getNamespaceURI());
+				
+				if (pfix != null) {
+					mesgType = pfix+":"+mesgType;
+				}
+			}
+			
+			var.setMessageType(mesgType);
+			
+			bpelModel.getBPELProcess().addVariable(var, -1);
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,382 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.util.InteractionUtil;
+import org.scribble.protocol.model.*;
+import org.scribble.conversation.model.*;
+
+/**
+ * This class provides utility functions for detecting
+ * patterns related to interactions.
+ */
+public class InteractionPatterns {
+
+	private static final String FAULT_NAME = "faultName";
+	private static final String MESSAGE_TYPE_LOCALPART = "messageTypeLocalPart";
+	private static final String MESSAGE_TYPE_NAMESPACE = "messageTypeNameSpace";
+
+	/**
+	 * This method checks whether the supplied interaction
+	 * is a request that requires a scope with associated
+	 * fault handlers.
+	 * 
+	 * @param interaction The interaction
+	 * @return Whether the interaction is a request requiring
+	 * 			an outer fault handler
+	 */
+	public static boolean isFaultHandlerRequired(org.scribble.model.Interaction interaction) {
+		boolean ret=false;
+		
+		// Check if interaction is an invoke, and followed
+		// by a choice representing a normal and multiple
+		// fault responses
+		if (InteractionUtil.isRequest(interaction) &&
+				interaction.getRequestLabel() != null) {
+			
+			if (interaction.getParent() instanceof
+						org.scribble.model.Block) {
+				org.scribble.model.Block block=
+					(org.scribble.model.Block)interaction.getParent();
+				
+				int pos=block.getContents().indexOf(interaction);
+				
+				if (pos != -1 && pos < block.getContents().size()-1) {
+					org.scribble.model.Activity act=
+						block.getContents().get(pos+1);
+					
+					if (act instanceof org.scribble.conversation.model.If) {
+						
+						// Need to check if each path receives a
+						// response (normal and fault)
+						org.scribble.conversation.model.If choice=
+							(org.scribble.conversation.model.If)act;
+						
+						if (choice.getPaths().size() > 0) {
+							ret = true;							
+						}
+						
+						for (int i=0; ret &&
+								i < choice.getPaths().size(); i++) {
+							
+							org.scribble.model.Block path=
+								choice.getPaths().get(i);
+							
+							if (path.getContents().size() == 0 ||
+									(path.getContents().get(0) instanceof Interaction) == false ||
+									InteractionUtil.isRequest((Interaction)
+											path.getContents().get(0))) {
+								ret = false;
+							}
+						}
+					}
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	// TODO: Method to detect if normal response, which needs
+	// to enhance the invoke (and subsequent activities following
+	// the invoke), or a fault response needing to
+	// place itself and subsequent activities in a fault handler.
+	// Methods need to return (and set) the relevant sequence
+	// to use for subsequent activities.
+	
+	public static boolean isResponseAndFaultHandler(If choice) {
+		boolean ret=false;
+		
+		// Obtain interaction prior to 'If'
+		if (choice.getPaths().size() > 0 &&
+				choice.getParent() instanceof
+				org.scribble.model.Block) {
+			org.scribble.model.Block block=
+				(org.scribble.model.Block)choice.getParent();
+		
+			int pos=block.getContents().indexOf(choice);
+		
+			if (pos != -1 && pos > 0) {
+				org.scribble.model.Activity act=
+					block.getContents().get(pos-1);
+			
+				if (act instanceof Interaction &&
+						InteractionUtil.isSend((Interaction)act) &&
+						InteractionUtil.isRequest((Interaction)act) &&
+						((Interaction)act).getRequestLabel() != null) {
+					
+					// Check if each path has a response/fault associated
+					// with the preceding request
+					String requestLabel=
+						((Interaction)act).getRequestLabel();
+					
+					java.util.List<Block> paths=choice.getPaths();
+					int matched=0;
+					
+					for (int i=0; i < paths.size(); i++) {
+						if (paths.get(i).getContents().size() > 0) {
+							Interaction in=getPickPathInteraction(paths.get(i));
+							
+							if (in != null &&
+									InteractionUtil.isResponse(in) &&
+									in.getReplyToLabel().equals(requestLabel)) {
+								matched++;
+							}
+						}
+					}
+					
+					if (matched == paths.size()) {
+						ret = true;
+					}
+				}
+			}
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method obtains the interaction that triggers a
+	 * specified path in a BPEL pick activity.
+	 * 
+	 * @param path The path
+	 * @return The interaction that triggers the path in
+	 * 				the pick activity
+	 */
+	public static Interaction getPickPathInteraction(Block path) {
+		Interaction ret=null;
+		
+		// TODO: This method is the opposite of the
+		// 'isInteractionPickPathTrigger', so needs to be
+		// updated to reflect any changes to that method
+		
+		if (path.getContents().size() > 0) {
+			org.scribble.model.Activity sub=
+				path.getContents().get(0);
+								
+			// Check if scope
+			if (sub instanceof Compose) {
+				Definition defn=((Compose)sub).getDefinition();
+				org.scribble.model.Behaviour b=null;
+				
+				for (int j=0; b == null &&
+							j < defn.getBlock().getContents().size(); j++) {
+					if (defn.getBlock().getContents().get(j) instanceof org.scribble.model.Behaviour) {
+						b = (org.scribble.model.Behaviour)
+									defn.getBlock().getContents().get(j);
+					}
+				}
+				
+				if (b != null) {
+					sub = b;
+				}
+			}
+			
+			if (sub instanceof Interaction) {
+				ret = (Interaction)sub;
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied interaction
+	 * is the trigger interaction within a BPEL pick activity.
+	 * 
+	 * @param in The interaction
+	 * @return Whether the interaction is a pick trigger activity
+	 */
+	public static boolean isInteractionPickPathTrigger(Interaction in) {
+		boolean ret=false;
+		
+		// TODO: Need to determine all situations and ensure
+		// is generic enough to cope with extensions to Scribble
+		// model
+		
+		Block path=(Block)in.getParent();
+		
+		if (path.getParent() instanceof If &&
+				InteractionPatterns.isSwitch((If)path.getParent())) {
+			ret = true;
+			
+		// Check if receive is directly contained within a
+		// sub-definition
+		} else if (InteractionUtil.isSend(in) == false &&
+				path.getParent() instanceof org.scribble.model.Definition &&
+				path.getParent().getParent() instanceof Block &&
+				path.getParent().getParent().getParent() instanceof 
+						org.scribble.model.Definition) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	public static boolean isSwitch(If choice) {
+		boolean ret=false;
+		
+		if (choice.getPaths().size() > 0) {
+			java.util.List<Block> paths=choice.getPaths();
+			int matched=0;
+			
+			for (int i=0; i < paths.size(); i++) {
+				if (paths.get(i).getContents().size() > 0) {
+					Interaction in=getPickPathInteraction(paths.get(i));
+					
+					if (in != null &&
+							InteractionUtil.isSend(in) == false) {
+						matched++;
+					}
+				}
+			}
+			
+			if (matched == paths.size()) {
+				ret = true;
+			}
+		}
+
+		return(ret);
+	}
+	
+	public static Interaction getRequestForResponseInFaultHandler(Interaction interaction) {
+		Interaction ret=null;
+		
+		if (InteractionUtil.isRequest(interaction) == false &&
+				interaction.getReplyToLabel() != null) {
+			
+			// Find if contained in 'if' path
+			if (interaction.getParent() instanceof Block &&
+					interaction.getParent().getParent() instanceof If) {
+				
+				If choice=(If)interaction.getParent().getParent();
+				
+				// Obtain interaction prior to 'If'
+				if (choice.getParent() instanceof
+						org.scribble.model.Block) {
+					org.scribble.model.Block block=
+						(org.scribble.model.Block)choice.getParent();
+				
+					int pos=block.getContents().indexOf(choice);
+				
+					if (pos != -1 && pos > 0) {
+						org.scribble.model.Activity act=
+							block.getContents().get(pos-1);
+					
+						if (act instanceof Interaction &&
+								InteractionUtil.isRequest((Interaction)act) &&
+								((Interaction)act).getRequestLabel() != null &&
+								interaction.getReplyToLabel().equals(
+										((Interaction)act).getRequestLabel())) {
+							ret = (Interaction)act;
+						}
+					}
+				}
+			}	
+		}
+		
+		return(ret);
+	}
+	
+	public static boolean isResponseInFaultHandler(Interaction interaction) {
+		return(getRequestForResponseInFaultHandler(interaction) != null);
+	}
+	
+	public static boolean isFaultResponse(Interaction interaction) {
+		boolean ret=false;
+		
+		if (InteractionUtil.isRequest(interaction) == false &&
+				interaction.getMessageSignature().getAnnotations().
+						keySet().contains(FAULT_NAME)) {
+			ret = true;
+		}
+
+		return(ret);
+	}
+	
+	public static String getFaultName(Interaction interaction) {
+		return((String)interaction.
+			getMessageSignature().getAnnotations().get(FAULT_NAME));
+	}
+	
+	public static String getMessageTypeLocalPart(Interaction interaction) {
+		return((String)interaction.
+			getMessageSignature().getAnnotations().get(MESSAGE_TYPE_LOCALPART));
+	}
+	
+	public static String getMessageTypeNameSpace(Interaction interaction) {
+		return((String)interaction.
+			getMessageSignature().getAnnotations().get(MESSAGE_TYPE_NAMESPACE));
+	}
+	
+	/*
+	public static String getVariableName(Interaction interaction) {
+		String varName=getMessageTypeLocalPart(interaction);
+		
+		if (varName != null) {
+			int ind=varName.lastIndexOf('}');
+		
+			if (ind != -1) {
+				varName = varName.substring(ind+1);
+			}
+			
+			varName += "Var";
+			
+			if (Character.isLowerCase(varName.charAt(0)) == false) {
+				varName = Character.toLowerCase(varName.charAt(0))+
+							varName.substring(1);
+			}
+		}
+		
+		return(varName);
+	}
+	*/
+	
+	public static boolean isSyncNormalResponse(Interaction interaction) {
+		boolean ret=false;
+
+		if (InteractionUtil.isResponse(interaction) &&
+				interaction.getParent() instanceof Block) {
+			Block block=(Block)interaction.getParent();
+		
+			int pos=block.getContents().indexOf(interaction);
+			
+			if (pos > 0 && block.getContents().get(pos-1) instanceof Interaction) {
+				Interaction req=(Interaction)block.getContents().get(pos-1);
+				
+				ret = isResponseForRequest(interaction, req);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	public static boolean isResponseForRequest(Interaction resp,
+							Interaction req) {
+		boolean ret=false;
+		
+		if (InteractionUtil.isRequest(req) &&
+				InteractionUtil.isResponse(resp) &&
+				resp.getReplyToLabel().equals(
+						req.getRequestLabel())) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/LanguageToConversationModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/LanguageToConversationModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/LanguageToConversationModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,100 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Language Model to
+ * Conversation Model.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class LanguageToConversationModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and inserted
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object being inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof ConversationModel &&
+				model instanceof BPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		ConversationModel cm=(ConversationModel)mobj;
+		
+		if (cm.getConversation() != null) {
+			ModelChangeUtils.addContracts(context, cm.getConversation(), true);
+
+			context.insert(model, cm.getConversation(), null);
+
+			ModelChangeUtils.removeContracts(context, cm.getConversation(), true);
+		}
+		
+		return(true);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ModelChangeUtils.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ModelChangeUtils.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ModelChangeUtils.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,239 @@
+/*
+ * 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.model.change;
+
+import org.savara.contract.model.Contract;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+
+/**
+ * Model change utilities.
+ */
+public class ModelChangeUtils {
+
+	/**
+	 * This method adds any contracts associated with roles defined in the
+	 * supplied conversation.
+	 * 
+	 * @param context The context
+	 * @param conv The conversation
+	 * @param root Whether this is the root conversation
+	 */
+	@SuppressWarnings("unchecked")
+	public static void addContracts(ModelChangeContext context, Conversation conv, boolean root) {
+		
+		java.util.Map<String,Contract> contracts=(java.util.Map<String,Contract>)
+							context.getProperties().get(Contract.class.getName());
+		
+		if (contracts == null) {
+			contracts = new java.util.HashMap<String, Contract>();
+			
+			context.getProperties().put(Contract.class.getName(), contracts);
+		}
+		
+		if (conv.getLocatedName().getRole() != null && root) {
+			addRoleContract(conv.getLocatedName().getRole(), contracts);
+		}
+		
+		// Get list of roles
+		java.util.List<Role> roles=getRoles(conv);
+		
+		for (Role r : roles) {
+			addRoleContract(r, contracts);
+		}
+	}
+	
+	// NOTE: Return all the roles defined in the scope of this conversation
+	// Would be better to incrementally add contracts for roles, as defined
+	// in their own scope, but need to refactor how blocks are dealt with
+	// first - which is different in some cases, so not straightforward.
+	protected static java.util.List<Role> getRoles(final Conversation conv) {
+		final java.util.List<Role> roles=new java.util.Vector<Role>();
+		
+		conv.visit(new Visitor() {
+
+			public boolean visit(ModelObject obj) {
+				boolean ret=true;
+				
+				if (obj instanceof RoleList) {
+					roles.addAll(((RoleList)obj).getRoles());
+				} else if (obj instanceof Conversation &&
+						obj != conv) {
+					ret = false;
+				}
+				
+				return(ret);
+			}
+		});
+		
+		return(roles);
+	}
+	
+	/**
+	 * This method initializes the contract associated with the supplied role.
+	 * 
+	 * @param role The role
+	 * @param contracts The map of roles to contracts
+	 */
+	protected static void addRoleContract(Role role, java.util.Map<String,Contract> contracts) {
+		if (role != null && role.getAnnotations().containsKey(Contract.class.getName())) {
+			contracts.put(role.getName(),
+					(Contract)role.getAnnotations().get(Contract.class.getName()));
+		}
+	}
+
+	/**
+	 * This method removes the contract associated with the supplied role.
+	 * 
+	 * @param role The role
+	 * @param contracts The map of roles to contracts
+	 */
+	protected static void removeRoleContract(Role role, java.util.Map<String,Contract> contracts) {
+		if (role != null && role.getAnnotations().containsKey(Contract.class.getName())) {
+			contracts.remove(role.getName());
+		}
+	}
+
+	/**
+	 * This method removes any contracts associated with roles defined in the
+	 * supplied conversation.
+	 * 
+	 * @param context The context
+	 * @param conv The conversation
+	 * @param root Whether this is the root conversation
+	 */
+	@SuppressWarnings("unchecked")
+	public static void removeContracts(ModelChangeContext context, Conversation conv, boolean root) {
+		
+		java.util.Map<String,Contract> contracts=(java.util.Map<String,Contract>)
+							context.getProperties().get(Contract.class.getName());
+		
+		if (contracts != null) {
+		
+			if (conv.getLocatedName().getRole() != null && root) {
+				removeRoleContract(conv.getLocatedName().getRole(), contracts);
+			}
+		
+			// Get list of roles
+			java.util.List<Role> roles=getRoles(conv);
+			
+			for (Role r : roles) {
+				removeRoleContract(r, contracts);
+			}
+		}
+	}
+	
+	/**
+	 * This method returns the contract associated with the supplied role.
+	 * 
+	 * @param contezt The context
+	 * @param roleName The role name
+	 * @return The contract, or null if not found
+	 */
+	@SuppressWarnings("unchecked")
+	public static Contract getContract(ModelChangeContext context, String roleName) {
+		Contract ret=null;
+		
+		if (context.getProperties().containsKey(Contract.class.getName())) {
+			java.util.Map<String,Contract> contracts=
+					(java.util.Map<String,Contract>)
+					context.getProperties().get(Contract.class.getName());
+			
+			ret = contracts.get(roleName);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method updates the role mapping based on the supplied list of
+	 * declaration bindings.
+	 * 
+	 * @param context The context
+	 * @param run The run construct
+	 */
+	@SuppressWarnings("unchecked")
+	public static void pushRoleContractMapping(ModelChangeContext context,
+							Compose run) {
+
+		if (context.getProperties().containsKey(Contract.class.getName())) {
+			java.util.Map<String,Contract> contracts=
+					(java.util.Map<String,Contract>)
+					context.getProperties().get(Contract.class.getName());
+
+			if (run.getEnclosingDefinition().getLocatedName().getRole() != null &&
+					run.getDefinition().getLocatedName().getRole() != null) {
+				Contract c=contracts.remove(run.getEnclosingDefinition().getLocatedName().getRole().getName());
+				
+				if (c != null) {
+					contracts.put(run.getDefinition().getLocatedName().getRole().getName(), c);
+				}
+			}
+			
+			for (DeclarationBinding db : run.getBindings()) {
+				if (db.getDeclaration() instanceof Role) {
+					Contract c=contracts.remove(db.getDeclaration().getName());
+					
+					if (c != null) {
+						contracts.put(db.getBoundName(), c);
+					}
+				}
+			}
+			
+		}
+	}
+
+	/**
+	 * This method resets the role mapping based on the supplied list of
+	 * declaration bindings.
+	 * 
+	 * @param context The context
+	 * @param run The run construct
+	 */
+	@SuppressWarnings("unchecked")
+	public static void popRoleContractMapping(ModelChangeContext context,
+									Compose run) {
+
+		if (context.getProperties().containsKey(Contract.class.getName())) {
+			java.util.Map<String,Contract> contracts=
+					(java.util.Map<String,Contract>)
+					context.getProperties().get(Contract.class.getName());
+
+			if (run.getEnclosingDefinition().getLocatedName().getRole() != null &&
+					run.getDefinition().getLocatedName().getRole() != null) {
+				Contract c=contracts.remove(run.getDefinition().getLocatedName().getRole().getName());
+				
+				if (c != null) {
+					contracts.put(run.getEnclosingDefinition().getLocatedName().getRole().getName(), c);
+				}
+			}
+			
+			for (DeclarationBinding db : run.getBindings()) {
+				if (db.getDeclaration() instanceof Role) {
+					Contract c=contracts.remove(db.getBoundName());
+					
+					if (c != null) {
+						contracts.put(db.getDeclaration().getName(), c);
+					}
+				}
+			}
+			
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/RunModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/RunModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/RunModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Run.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class RunModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof Run &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		Run elem=(Run)mobj;
+
+		if (elem.getDefinition() != null) {
+			
+			ModelChangeUtils.pushRoleContractMapping(context, elem);
+			
+			ModelChangeUtils.addContracts(context, elem.getDefinition(), false);
+			
+			context.insert(bpelModel, elem.getDefinition(), ref);
+
+			ModelChangeUtils.removeContracts(context, elem.getDefinition(), false);
+			
+			ModelChangeUtils.popRoleContractMapping(context, elem);
+		}
+		
+		return(true);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/SpawnModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/SpawnModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/SpawnModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,105 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Run.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class SpawnModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof Spawn &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		Spawn elem=(Spawn)mobj;
+
+		if (elem.getDefinition() != null) {
+			ModelChangeUtils.pushRoleContractMapping(context, elem);
+			
+			ModelChangeUtils.addContracts(context, elem.getDefinition(), false);
+			
+			context.insert(bpelModel, elem.getDefinition(), ref);
+
+			ModelChangeUtils.removeContracts(context, elem.getDefinition(), false);
+			
+			ModelChangeUtils.popRoleContractMapping(context, elem);
+		}
+		
+		return(true);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhenModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhenModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhenModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,108 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the When.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class WhenModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof When &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		When elem=(When)mobj;
+		
+		// TODO: Need to decide best way to deal with single
+		// and multi-path when constructs.
+		
+		if (elem.getPaths().size() == 1) {
+			// Single path - so ignore it for now
+			Block path=elem.getPaths().get(0);
+			
+			// Process the activities within the conversation
+			java.util.List<Activity> acts=path.getContents();
+						
+			for (int i=0; i < acts.size(); i++) {
+				context.insert(model, acts.get(i), null);
+			}
+		}
+				
+		return(true);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhileModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhileModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/WhileModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,117 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.*;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the While.
+ */
+ at RegistryInfo(extension=ModelChangeRule.class,notation=BPELNotation.NOTATION_CODE)
+public class WhileModelChangeRule extends AbstractModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object causing the change
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	@Override
+	public boolean isInsertSupported(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		if (mobj instanceof org.scribble.conversation.model.While &&
+				model instanceof DefaultBPELLanguageModel) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	@Override
+	public boolean insert(ModelChangeContext context,
+				Model model, ModelObject mobj, ModelObject ref) {
+		DefaultBPELLanguageModel bpelModel=(DefaultBPELLanguageModel)model;
+		org.scribble.conversation.model.While elem=
+			(org.scribble.conversation.model.While)mobj;
+		
+		While act=new While(bpelModel);
+		
+		Sequence seq=new Sequence(bpelModel);
+		
+		if (context.getParent() instanceof Sequence) {		
+			((Sequence)context.getParent()).addActivity(act, -1);
+		}
+
+		// Process the activities within the conversation
+		java.util.List<Activity> acts=elem.getBlock().getContents();
+		
+		Object parent=context.getParent();
+		
+		context.setParent(seq);
+		
+		for (int i=0; i < acts.size(); i++) {
+			context.insert(model, acts.get(i), null);
+		}
+		
+		act.setActivity(seq);
+
+		// Reset old parent
+		context.setParent(parent);
+		
+		return(true);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractCondition.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractCondition.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractCondition.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,126 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the BPEL condition element.
+ */
+public abstract class AbstractCondition extends BPELElement {
+
+	private static final long serialVersionUID = 178873060670041144L;
+
+	private static final String EXPRESSION_LANGUAGE = "expressionLanguage";
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public AbstractCondition(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elemName The condition's element name
+	 */
+	public AbstractCondition(BPELLanguageModel model, String elemName) {
+		super(model, elemName);
+	}
+
+	/**
+	 * This method returns the expression associated
+	 * with the condition.
+	 * 
+	 * @return The expression
+	 */
+	public String getExpression() {
+		String ret=null;
+		
+		getDOMElement().normalize();
+		
+		if (getDOMElement().getFirstChild() instanceof org.w3c.dom.Text) {
+			org.w3c.dom.Text text=(org.w3c.dom.Text)
+							getDOMElement().getFirstChild();
+			
+			ret = text.getNodeValue();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method sets the expression.
+	 * 
+	 * @param expr The expression
+	 */
+	public void setExpression(String expr) {
+		
+		getDOMElement().normalize();
+		
+		if (getDOMElement().getFirstChild() == null) {
+			org.w3c.dom.Text text=
+				getDOMElement().getOwnerDocument().createTextNode(expr);
+			
+			getDOMElement().appendChild(text);
+			
+		} else if (getDOMElement().getFirstChild() instanceof org.w3c.dom.Text) {
+			org.w3c.dom.Text text=(org.w3c.dom.Text)
+							getDOMElement().getFirstChild();
+			
+			text.setNodeValue(expr);
+		}
+	}
+	
+	/**
+	 * This method returns the expression language associated
+	 * with the condition.
+	 * 
+	 * @return The expression language
+	 */
+	public String getExpressionLanguage() {
+		return(getDOMElement().hasAttribute(EXPRESSION_LANGUAGE)?
+				getDOMElement().getAttribute(EXPRESSION_LANGUAGE):null);
+	}
+	
+	/**
+	 * This method sets the expression language.
+	 * 
+	 * @param lang The expression language
+	 */
+	public void setExpressionLanguage(String lang) {
+		getDOMElement().setAttribute(EXPRESSION_LANGUAGE, lang);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractInteraction.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractInteraction.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/AbstractInteraction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,158 @@
+/*
+ * 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.model.component;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.TypeReference;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents an abstract interaction activity.
+ *  
+ * @author gary
+ */
+public abstract class AbstractInteraction extends BPELActivity {
+
+	private static final String PARTNER_LINK = "partnerLink";
+	private static final String PORT_TYPE = "portType";
+	private static final String OPERATION = "operation";
+	
+	private static final long serialVersionUID = -5048477859609625462L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public AbstractInteraction(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public AbstractInteraction(BPELLanguageModel model,
+			String name) {
+		super(model, name);
+	}
+	
+	/**
+	 * This method sets the operation.
+	 * 
+	 * @param op The operation
+	 */
+	public void setOperation(String op) {		
+		getDOMElement().setAttribute(OPERATION, op);
+	}
+	
+	/**
+	 * This method returns the operation.
+	 * 
+	 * @return The operation
+	 */
+	public String getOperation() {
+		return(getDOMElement().hasAttribute(OPERATION)?
+				getDOMElement().getAttribute(OPERATION):null);
+	}
+
+	/**
+	 * This method sets the partner link.
+	 * 
+	 * @param pl The partner link
+	 */
+	public void setPartnerLink(String pl) {		
+		getDOMElement().setAttribute(PARTNER_LINK, pl);
+	}
+	
+	/**
+	 * This method returns the partner link.
+	 * 
+	 * @return The partner link
+	 */
+	public String getPartnerLink() {
+		return(getDOMElement().hasAttribute(PARTNER_LINK)?
+				getDOMElement().getAttribute(PARTNER_LINK):null);
+	}
+
+	/**
+	 * This method sets the port type.
+	 * 
+	 * @param pt The port type
+	 */
+	public void setPortType(String pt) {		
+		getDOMElement().setAttribute(PORT_TYPE, pt);
+	}
+	
+	/**
+	 * This method returns the port type.
+	 * 
+	 * @return The port type
+	 */
+	public String getPortType() {
+		return(getDOMElement().hasAttribute(PORT_TYPE)?
+				getDOMElement().getAttribute(PORT_TYPE):null);
+	}
+	
+	/**
+	 * This method attempts to identify the client's partner role name.
+	 * 
+	 * @return The partner role
+	 */
+	protected String getClientPartnerRole() {
+		String ret=getPartnerLink();
+		int index=-1;
+		
+		if (ret != null && (index=ret.indexOf("To")) != -1) {
+			ret = ret.substring(index+2);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method attempts to identify the server's partner role name.
+	 * 
+	 * @return The partner role
+	 */
+	protected String getServerPartnerRole() {
+		String ret=getPartnerLink();
+		int index=-1;
+		
+		if (ret != null && (index=ret.indexOf("To")) != -1) {
+			ret = ret.substring(0, index);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	public void validate(Journal l) {
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,413 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the base class for all BPEL
+ * activities.
+ */
+public abstract class BPELActivity extends BPELElement {
+
+	private static final String SOURCES = "sources";
+
+	private static final String TARGETS = "targets";
+
+	private static final String SUPPRESS_JOIN_FAILURE = "suppressJoinFailure";
+
+	private static final String NAME = "name";
+	
+	private static final long serialVersionUID = 2885165314780298048L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public BPELActivity(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+
+		org.w3c.dom.Element targets=findChildElement(TARGETS);
+		
+		if (targets != null) {
+			org.w3c.dom.NodeList nl=targets.getChildNodes();
+		
+			for (int i=0; i < nl.getLength(); i++) {
+				if (nl.item(i) instanceof org.w3c.dom.Element &&
+						nl.item(i).getLocalName().equals(Target.TARGET)
+						&& nl.item(i) instanceof org.w3c.dom.Element) {
+					m_targets.add(new Target(model,
+							(org.w3c.dom.Element)nl.item(i)));
+				}
+			}
+		}
+		
+		org.w3c.dom.Element sources=findChildElement(SOURCES);
+		
+		if (sources != null) {
+			org.w3c.dom.NodeList nl=sources.getChildNodes();
+		
+			for (int i=0; i < nl.getLength(); i++) {
+				if (nl.item(i) instanceof org.w3c.dom.Element &&
+						nl.item(i).getLocalName().equals(Source.SOURCE)
+						&& nl.item(i) instanceof org.w3c.dom.Element) {
+					m_sources.add(new Source(model,
+							(org.w3c.dom.Element)nl.item(i)));
+				}
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public BPELActivity(BPELLanguageModel model,
+			String name) {
+		super(model, name);
+	}
+	
+	/**
+	 * This method identifies whether the BPEL element
+	 * is an activity.
+	 * 
+	 * @return Whether the element is an activity
+	 */
+	@Override
+	public boolean isActivity() {
+		return(true);
+	}
+
+	/**
+	 * This method sets the name.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {		
+		getDOMElement().setAttribute(NAME, name);
+	}
+	
+	/**
+	 * This method returns the name.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(getDOMElement().hasAttribute(NAME)?
+				getDOMElement().getAttribute(NAME):null);
+	}
+
+	/**
+	 * This method sets the 'suppress join failure'
+	 * attribute.
+	 * 
+	 * @param b Whether to suppress join failure
+	 */
+	public void setSuppressJoinFailure(boolean b) {
+		String suppress=(b?"yes":"no");
+		
+		getDOMElement().setAttribute(SUPPRESS_JOIN_FAILURE, suppress);
+	}
+	
+	/**
+	 * This method returns whether the join should
+	 * be suppressed.
+	 * 
+	 * @return Whether the join should be suppressed
+	 */
+	public boolean getSuppressJoinFailure() {
+		boolean ret=false;
+		String suppress=
+			getDOMElement().getAttribute(SUPPRESS_JOIN_FAILURE);
+
+		if (suppress != null &&
+				suppress.equals("yes")) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method adds a target to the activity.
+	 * 
+	 * @param target The target to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addTarget(Target target, int pos) {
+		
+		org.w3c.dom.Element targets=null;
+		
+		if (m_targets.size() == 0) {
+			targets = getDOMElement().getOwnerDocument().
+						createElementNS(BPEL_NS, TARGETS);
+			
+			if (getDOMElement().getFirstChild() == null) {
+				getDOMElement().appendChild(targets);
+			} else {
+				getDOMElement().insertBefore(targets,
+						getDOMElement().getFirstChild());
+			}
+		} else {
+			targets = findChildElement(TARGETS);
+		}
+		
+		org.w3c.dom.Node newNode=target.getDOMElement().cloneNode(true);
+		
+		getDOMElement().getOwnerDocument().adoptNode(newNode);
+		
+		target.setDOMElement((org.w3c.dom.Element)newNode);
+		
+		if (pos == -1 && pos < m_targets.size()) {
+			m_targets.add(target);
+			
+			targets.appendChild(newNode);
+		} else {
+			
+			Target cur=m_targets.get(pos);
+			
+			m_targets.add(pos, target);
+			
+			if (cur != null) {
+				targets.insertBefore(newNode,
+							cur.getDOMElement());
+			} else {
+				targets.appendChild(newNode);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes a target from the activity.
+	 * 
+	 * @param target The target to be removed
+	 * @return Whether the target was removed
+	 */
+	public boolean removeTarget(Target target) {
+		boolean ret=m_targets.remove(target);
+		
+		if (ret) {
+			org.w3c.dom.Element targets=
+						findChildElement(TARGETS);
+			
+			if (targets != null) {
+				targets.removeChild(target.getDOMElement());
+				
+				if (m_targets.size() == 0) {
+					getDOMElement().removeChild(targets);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of targets associated
+	 * with the activity.
+	 * 
+	 * @return The list of targets
+	 */
+	public java.util.List<Target> getTargets() {
+		return(m_targets);
+	}
+
+	/**
+	 * This method adds a source to the activity.
+	 * 
+	 * @param source The source to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addSource(Source source, int pos) {
+		
+		org.w3c.dom.Element sources=null;
+		
+		if (m_sources.size() == 0) {
+			sources = getDOMElement().getOwnerDocument().
+						createElementNS(BPEL_NS, SOURCES);
+			
+			if (getDOMElement().getFirstChild() == null) {
+				getDOMElement().appendChild(sources);
+			} else {
+				getDOMElement().insertBefore(sources,
+						getDOMElement().getFirstChild());
+			}
+		} else {
+			sources = findChildElement(SOURCES);
+		}
+		
+		org.w3c.dom.Node newNode=source.getDOMElement().cloneNode(true);
+		
+		getDOMElement().getOwnerDocument().adoptNode(newNode);
+		
+		source.setDOMElement((org.w3c.dom.Element)newNode);
+		
+		if (pos == -1 && pos < m_sources.size()) {
+			m_sources.add(source);
+			
+			sources.appendChild(newNode);
+		} else {
+			
+			Source cur=m_sources.get(pos);
+			
+			m_sources.add(pos, source);
+			
+			if (cur != null) {
+				sources.insertBefore(newNode,
+							cur.getDOMElement());
+			} else {
+				sources.appendChild(newNode);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes a source from the activity.
+	 * 
+	 * @param source The source to be removed
+	 * @return Whether the source was removed
+	 */
+	public boolean removesource(Source source) {
+		boolean ret=m_sources.remove(source);
+		
+		if (ret) {
+			org.w3c.dom.Element sources=
+						findChildElement(SOURCES);
+			
+			if (sources != null) {
+				sources.removeChild(source.getDOMElement());
+				
+				if (m_sources.size() == 0) {
+					getDOMElement().removeChild(sources);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of sources associated
+	 * with the activity.
+	 * 
+	 * @return The list of sources
+	 */
+	public java.util.List<Source> getSources() {
+		return(m_sources);
+	}
+	
+	/**
+	 * This method converts the BPEL activity into an equivalent
+	 * behavioural description for conformance checking.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	public void convert(java.util.List<Activity> activities,
+			ConversionContext context) {
+		
+		/* TODO: Currently don't have a 'when' construct similar to CDL
+		 * 
+		 *
+		if (getTargets().size() > 0) {
+			
+			// Create 'when' construct to wait for inbound links
+			// to be satisfied
+			org.scribble.expression.xpath.model.XPathExpression expr=
+				new org.scribble.expression.xpath.model.XPathExpression();
+	
+			String query="";
+			
+			for (int i=0; i < getTargets().size(); i++) {
+				if (i > 0) {
+					query += " and ";
+				}
+				query += "$"+getTargets().get(i).getLinkName();
+			}
+				
+			expr.setQuery(query);
+
+			org.scribble.protocol.model.When elem=
+				new org.scribble.conversation.model.When();
+			
+			org.scribble.conversation.model.ConditionalBlock block=
+					new org.scribble.conversation.model.ConditionalBlock();
+			block.setExpression(expr);
+			
+			elem.getConditionalBlocks().add(block);
+			
+			activities.add(elem);
+			
+			activities = block.getContents();
+		}
+		*/
+		
+		convertActivity(activities, context);
+		
+		/* TODO: How to deal with sources???
+		 * 
+		 *
+		// If sources, then set boolean variable
+		for (int i=0; i < getSources().size(); i++) {
+			
+			org.scribble.conversation.model.Assignment assign=
+				new org.scribble.conversation.model.Assignment();
+			
+			org.scribble.conversation.model.Variable var=
+				new org.scribble.conversation.model.Variable();
+			
+			var.setName(getSources().get(i).getLinkName());
+			
+			assign.setVariable(var);
+			
+			org.scribble.expression.xpath.model.XPathExpression expr=
+						new org.scribble.expression.xpath.model.XPathExpression();
+			
+			expr.setQuery("true()");
+			assign.setExpression(expr);
+			
+			activities.add(assign);
+		}
+		*/
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected abstract void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context);
+		
+	private java.util.List<Target> m_targets=
+		new java.util.Vector<Target>();
+	private java.util.List<Source> m_sources=
+		new java.util.Vector<Source>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElement.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElement.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElement.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,408 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.savara.util.XMLUtils;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+import org.apache.commons.logging.*;
+
+/**
+ * This is the generic BPEL element class.
+ *  
+ * @author gary
+ */
+public abstract class BPELElement extends ModelObject {
+
+	public static final String BPEL_NS = "http://docs.oasis-open.org/wsbpel/2.0/process/executable";
+
+	private static final long serialVersionUID = -7306844554703224704L;
+
+	/**
+	 * The constructor for initializing the BPEL element based on
+	 * an existing DOM element.
+	 */
+	protected BPELElement(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		m_model = model;
+		
+		m_element = elem;
+		
+		// Set the start/end position information
+		// in the source details
+		XMLUtils.setStartAndEndPosition(this, model.getOriginalContents(), elem);
+			
+		//getSource().setObject(this);
+	}
+	
+	/**
+	 * The contructor for initializing a new element.
+	 */
+	protected BPELElement(BPELLanguageModel model,
+								String elemName) {
+		m_model = model;
+
+		org.w3c.dom.Document doc=null;
+		
+		if (model.getBPELProcess() == null) {
+			try {
+				javax.xml.parsers.DocumentBuilderFactory factory=
+					javax.xml.parsers.DocumentBuilderFactory.
+								newInstance();
+				factory.setNamespaceAware(true);
+				
+				doc = factory.newDocumentBuilder().newDocument();
+			} catch(Exception e) {
+				logger.error("Failed to create document", e);
+			}
+		} else {
+			doc = model.getBPELProcess().getDOMElement().
+							getOwnerDocument();
+		}
+		
+		m_element = doc.createElementNS(BPEL_NS, elemName);
+
+		//getSource().setObject(this);
+	}
+	
+	/**
+	 * This method validates the ESB action and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	public void validate(Journal l) {		
+	}
+		
+	/**
+	 * This method returns the XML configuration representation 
+	 * of the activity.
+	 * 
+	 * @return The XML configuration for the BPEL node
+	 */
+	public org.w3c.dom.Element getDOMElement() {
+		return(m_element);
+	}
+	
+	/**
+	 * This method sets the XML configuration representation
+	 * of the activity.
+	 * 
+	 * @param elem The XML configuration
+	 */
+	protected void setDOMElement(org.w3c.dom.Element elem) {
+		m_element = elem;
+	}
+	
+	/**
+	 * This method identifies whether the BPEL element
+	 * is an activity.
+	 * 
+	 * @return Whether the element is an activity
+	 */
+	public boolean isActivity() {
+		return(false);
+	}
+	
+	/**
+	 * This method returns the model.
+	 * 
+	 * @return The model
+	 */
+	protected BPELLanguageModel getModel() {
+		return(m_model);
+	}
+	
+	/**
+	 * This method returns the BPEL process in which the BPEL element
+	 * is contained.
+	 * 
+	 * @return The BPEL process, or null if not found
+	 */
+	protected Process getProcess() {
+		Process ret=null;
+		ModelObject cur=this;
+		
+		while (ret == null && cur != null) {
+			if (cur instanceof Process) {
+				ret = (Process)cur;
+			} else {
+				cur = cur.getParent();
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the element associated with
+	 * the supplied name.
+	 * 
+	 * @param name The name
+	 * @return The element, or null if not found
+	 */
+	public org.w3c.dom.Element findChildElement(String name) {
+		org.w3c.dom.Element ret=null;
+		
+		org.w3c.dom.NodeList nl=getDOMElement().getChildNodes();
+		
+		for (int i=0; ret == null && i < nl.getLength(); i++) {
+			org.w3c.dom.Node n=nl.item(i);
+			
+			if (n instanceof org.w3c.dom.Element &&
+					n.getLocalName() != null &&
+					n.getLocalName().equals(name)) {
+				ret = (org.w3c.dom.Element)nl.item(i);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the first child BPEL activity
+	 * found within the DOM element.
+	 * 
+	 * @return The child BPEL activity, or null if not found
+	 */
+	public BPELActivity findChildActivity() {
+		BPELActivity ret=null;
+		
+		org.w3c.dom.NodeList nl=getDOMElement().getChildNodes();
+		
+		for (int i=0; ret == null &&
+					i < nl.getLength(); i++) {
+			if (nl.item(i) instanceof org.w3c.dom.Element) {
+				BPELElement elem = BPELElementFactory.createBPELElement(m_model,
+								(org.w3c.dom.Element)nl.item(i));
+				
+				if (elem != null && elem.isActivity() &&
+						elem instanceof BPELActivity) {
+					ret = (BPELActivity)elem;
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the child elements that conform to
+	 * the supplied class.
+	 * 
+	 * @param cls The class
+	 * @return The list of child elements of the type specified
+	 * 			by the supplied class
+	 */
+	public java.util.List<BPELElement> findChildElements(Class<? extends BPELElement> cls) {
+		return(findChildElements(getDOMElement(), cls));
+	}
+
+	/**
+	 * This method returns the child elements that conform to
+	 * the supplied class.
+	 * 
+	 * @param root The root element
+	 * @param cls The class
+	 * @return The list of child elements of the type specified
+	 * 			by the supplied class
+	 */
+	public java.util.List<BPELElement> findChildElements(org.w3c.dom.Element root,
+						Class<? extends BPELElement> cls) {
+		java.util.List<BPELElement> ret=new java.util.Vector<BPELElement>();
+		
+		org.w3c.dom.NodeList nl=root.getChildNodes();
+		
+		for (int i=0; i < nl.getLength(); i++) {
+			
+			if (nl.item(i) instanceof org.w3c.dom.Element) {
+				BPELElement elem=BPELElementFactory.createBPELElement(m_model,
+						(org.w3c.dom.Element)nl.item(i));
+				
+				if (elem != null &&
+						cls.isAssignableFrom(elem.getClass())) {
+					ret.add(elem);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method sets a new element. If an existing element
+	 * is specified, then it is replaced with the new element.
+	 * Otherwise if an insertBefore node is specified, then
+	 * the new element is inserted before it. If no existing
+	 * or insertBefore parameters are specified, then the
+	 * new element will be appended.<b>
+	 * <b>
+	 * The new BPEL element will be updated to be associated
+	 * with a DOM element that is adopted by the document
+	 * into which it is being added.
+	 * 
+	 * @param existing The optional existing element to be
+	 * 						replaced
+	 * @param newelem The new element
+	 * @param insertBefore Optional location to insert new element
+	 */
+	public void setChildElement(org.w3c.dom.Element existing,
+				BPELElement newelem, org.w3c.dom.Node insertBefore) {
+		
+		setChildElement(getDOMElement(), existing, newelem, insertBefore);
+	}
+	
+	/**
+	 * This method sets a new element. If an existing element
+	 * is specified, then it is replaced with the new element.
+	 * Otherwise if an insertBefore node is specified, then
+	 * the new element is inserted before it. If no existing
+	 * or insertBefore parameters are specified, then the
+	 * new element will be appended.<b>
+	 * <b>
+	 * The new BPEL element will be updated to be associated
+	 * with a DOM element that is adopted by the document
+	 * into which it is being added.
+	 * 
+	 * @param root The root element to add child to
+	 * @param existing The optional existing element to be
+	 * 						replaced
+	 * @param newelem The new element
+	 * @param insertBefore Optional location to insert new element
+	 */
+	public void setChildElement(org.w3c.dom.Element root,
+					org.w3c.dom.Element existing,
+				BPELElement newelem, org.w3c.dom.Node insertBefore) {
+			
+		if (newelem != null) {
+			org.w3c.dom.Node newNode=newelem.getDOMElement().cloneNode(true);
+			
+			root.getOwnerDocument().adoptNode(newNode);
+			
+			newelem.setDOMElement((org.w3c.dom.Element)newNode);
+			
+			if (existing != null) {
+				root.replaceChild(newNode, existing);
+			} else if (insertBefore != null) {
+				root.insertBefore(newNode, insertBefore);
+			} else {
+				root.appendChild(newNode);
+			}
+		}
+	}
+	
+	/**
+	 * This method converts the BPEL activity into an equivalent
+	 * behavioural description for conformance checking.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	public abstract void convert(java.util.List<Activity> activities,
+					ConversionContext context);
+		
+	/**
+	 * This method returns the URI fragment to the activity within the
+	 * BPEL model.
+	 * 
+	 * @return The URI
+	 */
+	public String getURI() {
+		String ret="";
+		
+		BPELElement parent=null;
+		
+		if (getParent() != null) {
+			if (getParent() instanceof BPELElement) {
+				parent = (BPELElement)getParent();
+			}
+		} else if (getDOMElement().getParentNode() instanceof org.w3c.dom.Element) {
+			parent = BPELElementFactory.createBPELElement(getModel(),
+								(org.w3c.dom.Element)getDOMElement().getParentNode());
+		}
+		
+		if (parent != null) {
+			ret = parent.getParentURI(this);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method recursively builds up the URI using the local URI
+	 * parts for each BPEL element up to the root node.
+	 * 
+	 * @param elem The child element
+	 * @return The URI for the parent element
+	 */
+	protected String getParentURI(BPELElement elem) {
+		String ret="";
+		
+		BPELElement parent=null;
+		
+		if (getParent() != null) {
+			if (getParent() instanceof BPELElement) {
+				parent = (BPELElement)getParent();
+			}
+		} else if (elem.getDOMElement().getParentNode() instanceof org.w3c.dom.Element) {
+			parent = BPELElementFactory.createBPELElement(getModel(),
+								(org.w3c.dom.Element)getDOMElement().getParentNode());
+		}
+		
+		if (parent != null) {
+			ret = parent.getParentURI(this)+"/"+getLocalURIPart(elem);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the URI part associated with the supplied child element.
+	 * 
+	 * @param elem The child element
+	 * @return The URI part
+	 */
+	protected String getLocalURIPart(BPELElement elem) {
+		return("");
+	}
+	
+	public void visit(Visitor visitor) {
+		// TODO: Not sure if need visitor implementations
+	}
+	
+	public int hashCode() {
+		return(m_element.hashCode());
+	}
+	
+	public boolean equals(Object obj) {
+		boolean ret=false;
+		
+		if (obj instanceof BPELElement) {
+			ret = m_element.equals(((BPELElement)obj).getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	private static Log logger = LogFactory.getLog(BPELElement.class);
+
+	private BPELLanguageModel m_model=null;
+	private org.w3c.dom.Element m_element=null;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElementFactory.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElementFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELElementFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,67 @@
+/*
+ * 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.model.component;
+
+import org.apache.commons.logging.*;
+import org.savara.bpel.model.BPELLanguageModel;
+
+public class BPELElementFactory {
+
+	public static final String MODEL_COMPONENTS_PACKAGE = BPELElementFactory.class.getPackage().getName();
+	
+	/**
+	* This method creates a BPELElement instance relevant to the
+	* supplied JBossESB action, associated with the supplied
+	* service.
+	* 
+	* @param model The BPEL model
+	* @param elem The XML configuration of the BPEL activity
+	* @return The BPEL element instance
+	*/
+	public static BPELElement createBPELElement(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		BPELElement ret=null;
+		String activityType=elem.getNodeName();
+		
+		// Make first character capitalised
+		char ch=Character.toUpperCase(activityType.charAt(0));
+		
+		activityType = ch+activityType.substring(1);
+		
+		String clsName=MODEL_COMPONENTS_PACKAGE+"."+activityType;
+	
+		try {
+			Class<?> cls=(Class<?>)
+					Class.forName(clsName);
+			
+			java.lang.reflect.Constructor<?> con=
+				cls.getConstructor(new Class<?>[]{BPELLanguageModel.class,
+									org.w3c.dom.Element.class});
+			
+			ret = (BPELElement)con.newInstance(new Object[]{model, elem});
+			
+		} catch(Exception e) {
+			logger.warn("Unable to find BPEL element class '"+
+							clsName+"'");
+		}
+		
+		return(ret);
+	}
+
+	private static Log logger = LogFactory.getLog(BPELElementFactory.class);
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELGroupingConstruct.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELGroupingConstruct.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/BPELGroupingConstruct.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,72 @@
+/*
+ * 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.model.component;
+
+import org.apache.commons.logging.*;
+import org.savara.bpel.model.*;
+
+/**
+ * This is the generic BPEL activity class.
+ *  
+ * @author gary
+ */
+public abstract class BPELGroupingConstruct extends BPELActivity {
+
+	private static final long serialVersionUID = -5550042312010190598L;
+
+	/**
+	 * The constructor for initializing the activity based on
+	 * an existing DOM element.
+	 */
+	protected BPELGroupingConstruct(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+	
+	/**
+	 * The contructor for initializing a new activity.
+	 */
+	protected BPELGroupingConstruct(BPELLanguageModel model,
+								String activityName) {
+		super(model, activityName);
+	}
+	
+	/**
+	 * This method sets the contained activity.
+	 * 
+	 * @param act The contained activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		getDOMElement().appendChild(act.getDOMElement());
+	}
+	
+	/**
+	 * This method returns the contained activity.
+	 * 
+	 * @return The contained activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	private static Log logger = LogFactory.getLog(BPELGroupingConstruct.class);
+
+	private BPELElement m_activity=null;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Catch.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Catch.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Catch.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,187 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'catch' construct contained
+ * within the 'faultHandlers' element.
+ */
+public class Catch extends BPELElement {
+
+	private static final long serialVersionUID = 8191152745680660045L;
+
+	public static final String CATCH="catch";
+	
+	private static final String FAULT_NAME = "faultName";
+	private static final String FAULT_VARIABLE = "faultVariable";
+	private static final String FAULT_MESSAGE_TYPE = "faultMessageType";
+	private static final String FAULT_MESSAGE_ELEMENT = "faultMessageElement";
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public Catch(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Catch(BPELLanguageModel model) {
+		super(model, CATCH);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// Catch is not directly converted, only its contents indirectly as
+		// a fault response in a scope
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELActivity act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELActivity getActivity() {
+		return(m_activity);
+	}
+	
+	/**
+	 * This method sets the fault name.
+	 * 
+	 * @param faultName The fault name
+	 */
+	public void setFaultName(String faultName) {		
+		getDOMElement().setAttribute(FAULT_NAME, faultName);
+	}
+	
+	/**
+	 * This method returns the fault name.
+	 * 
+	 * @return The fault name
+	 */
+	public String getFaultName() {
+		return(getDOMElement().hasAttribute(FAULT_NAME)?
+				getDOMElement().getAttribute(FAULT_NAME):null);
+	}
+
+	/**
+	 * This method sets the fault variable.
+	 * 
+	 * @param faultVariable The fault variable
+	 */
+	public void setFaultVariable(String faultVariable) {		
+		getDOMElement().setAttribute(FAULT_VARIABLE, faultVariable);
+	}
+	
+	/**
+	 * This method returns the fault variable.
+	 * 
+	 * @return The fault variable
+	 */
+	public String getFaultVariable() {
+		return(getDOMElement().hasAttribute(FAULT_VARIABLE)?
+				getDOMElement().getAttribute(FAULT_VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the fault message type.
+	 * 
+	 * @param faultName The fault message type
+	 */
+	public void setFaultMessageType(String faultMessageType) {		
+		getDOMElement().setAttribute(FAULT_MESSAGE_TYPE, faultMessageType);
+	}
+	
+	/**
+	 * This method returns the fault message type.
+	 * 
+	 * @return The fault message type
+	 */
+	public String getFaultMessageType() {
+		return(getDOMElement().hasAttribute(FAULT_MESSAGE_TYPE)?
+				getDOMElement().getAttribute(FAULT_MESSAGE_TYPE):null);
+	}
+
+	/**
+	 * This method sets the fault message element.
+	 * 
+	 * @param faultName The fault message element
+	 */
+	public void setFaultMessageElement(String faultMessageElement) {		
+		getDOMElement().setAttribute(FAULT_MESSAGE_ELEMENT, faultMessageElement);
+	}
+	
+	/**
+	 * This method returns the fault message element.
+	 * 
+	 * @return The fault message element
+	 */
+	public String getFaultMessageElement() {
+		return(getDOMElement().hasAttribute(FAULT_MESSAGE_ELEMENT)?
+				getDOMElement().getAttribute(FAULT_MESSAGE_ELEMENT):null);
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private BPELActivity m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CatchAll.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CatchAll.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CatchAll.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'catchAll' construct contained
+ * within the 'faultHandlers' element.
+ */
+public class CatchAll extends BPELElement {
+
+	private static final long serialVersionUID = 975038289163694699L;
+
+	public static final String CATCHALL="catchAll";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public CatchAll(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public CatchAll(BPELLanguageModel model) {
+		super(model, CATCHALL);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELActivity act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELActivity getActivity() {
+		return(m_activity);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private BPELActivity m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CompensationHandler.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CompensationHandler.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/CompensationHandler.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,96 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'compensationHandler' construct contained
+ * within the 'scope' activity.
+ */
+public class CompensationHandler extends BPELElement {
+
+	private static final long serialVersionUID = -1994083560689296558L;
+
+	public static final String COMPENSATIONHANDLER="compensationHandler";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public CompensationHandler(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public CompensationHandler(BPELLanguageModel model) {
+		super(model, COMPENSATIONHANDLER);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Condition.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Condition.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Condition.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+
+/**
+ * This class represents the BPEL condition element.
+ */
+public class Condition extends AbstractCondition {
+
+	private static final long serialVersionUID = 8666349106632652777L;
+
+	public static final String CONDITION="condition";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public Condition(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Condition(BPELLanguageModel model) {
+		super(model, CONDITION);
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ConversionContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ConversionContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ConversionContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,77 @@
+/*
+ * 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.model.component;
+
+import org.scribble.model.admin.Context;
+
+public interface ConversionContext {
+
+	/**
+	 * This method returns a reference to the environment context.
+	 * 
+	 * @return The environment context
+	 */
+	public Context getEnvironmentContext();
+	
+	/**
+	 * This method returns the process.
+	 * 
+	 * @return The process
+	 */
+	public Process 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 Variable getVariable(String name);
+	
+	/**
+	 * This method adds a variable to the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void addVariable(Variable var);
+
+	/**
+	 * This method removes a variable from the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void removeVariable(Variable var);
+
+	/**
+	 * This method returns the namespace for the supplied prefix.
+	 * 
+	 * @param prefix The prefix
+	 * @return The namespace, or null if not found
+	 */
+	public String getNamespace(String prefix);
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/DefaultConversionContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/DefaultConversionContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/DefaultConversionContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,114 @@
+/*
+ * 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.model.component;
+
+import org.scribble.model.admin.Context;
+
+/**
+ * This class provides a default implementation of the conversation
+ * context.
+ */
+public class DefaultConversionContext implements ConversionContext {
+
+	/**
+	 * 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 envContext The environment context
+	 */
+	public DefaultConversionContext(String role, Process proc, Context envContext) {
+		m_role = role;
+		m_process = proc;
+		m_environmentContext = envContext;
+	}
+	
+	/**
+	 * This method returns a reference to the environment context.
+	 * 
+	 * @return The environment context
+	 */
+	public Context getEnvironmentContext() {
+		return(m_environmentContext);
+	}
+	
+	/**
+	 * This method returns the process.
+	 * 
+	 * @return The process
+	 */
+	public Process 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 Variable getVariable(String name) {
+		return(m_variables.get(name));
+	}
+	
+	/**
+	 * This method adds a variable to the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void addVariable(Variable var) {
+		m_variables.put(var.getName(), var);
+	}
+	
+	/**
+	 * This method removes a variable from the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void removeVariable(Variable var) {
+		m_variables.remove(var.getName());
+	}
+	
+	/**
+	 * This method returns the namespace for the supplied prefix.
+	 * 
+	 * @param prefix The prefix
+	 * @return The namespace, or null if not found
+	 */
+	public String getNamespace(String prefix) {
+		return(m_process.getNamespace(prefix));
+	}
+	
+	private String m_role=null;
+	private Process m_process=null;
+	private Context m_environmentContext=null;
+	private java.util.Map<String,Variable> m_variables=
+					new java.util.HashMap<String,Variable>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Else.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Else.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Else.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,108 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'else' construct contained
+ * within the 'if' activity.
+ */
+public class Else extends BPELElement {
+
+	private static final long serialVersionUID = 1243775332210724718L;
+
+	public static final String ELSE="else";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public Else(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Else(BPELLanguageModel model) {
+		super(model, ELSE);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		
+		if (getActivity() != null) {
+			getActivity().convert(activities, context);
+		}
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Elseif.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Elseif.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Elseif.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,139 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'elseif' construct contained
+ * within the 'if' activity.
+ */
+public class Elseif extends BPELElement {
+
+	private static final long serialVersionUID = 6371029130621912170L;
+
+	public static final String ELSEIF="elseif";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public Elseif(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+
+		org.w3c.dom.Element cond=
+				findChildElement(Condition.CONDITION);
+	
+		if (cond == null) {
+			m_condition = new Condition(model);
+		} else {
+			m_condition = new Condition(model, cond);
+		}
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Elseif(BPELLanguageModel model) {
+		super(model, ELSEIF);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		
+		if (getActivity() != null) {
+			getActivity().convert(activities, context);
+		}
+	}
+	
+	/**
+	 * This method sets the condition.
+	 * 
+	 * @param cond The condition
+	 */
+	public void setCondition(Condition cond) {
+		m_condition = cond;
+		
+		setChildElement(findChildElement(Condition.CONDITION),
+				cond, getDOMElement().getFirstChild());
+	}
+	
+	/**
+	 * This method returns the condition.
+	 * 
+	 * @return The condition
+	 */
+	public Condition getCondition() {
+		return(m_condition);
+	}
+
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private Condition m_condition;
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/EventHandlers.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/EventHandlers.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/EventHandlers.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,230 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the 'eventHandlers' component within
+ * a 'scope' element.
+ *  
+ * @author gary
+ */
+public class EventHandlers extends BPELElement {
+
+	private static final long serialVersionUID = 118381918664522750L;
+
+	public static final String EVENTHANDLERS = "eventHandlers";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public EventHandlers(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		java.util.List<BPELElement> onevts=
+					findChildElements(OnEvent.class);
+		
+		for (int i=0; i < onevts.size(); i++) {
+			if (onevts.get(i) instanceof OnEvent) {
+				m_onEvents.add((OnEvent)onevts.get(i));
+			}
+		}
+		
+		java.util.List<BPELElement> onalrms=
+					findChildElements(OnAlarm.class);
+		
+		for (int i=0; i < onalrms.size(); i++) {
+			if (onalrms.get(i) instanceof OnAlarm) {
+				m_onAlarms.add((OnAlarm)onalrms.get(i));
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public EventHandlers(BPELLanguageModel model) {
+		super(model, EVENTHANDLERS);
+	}
+
+	/**
+	 * This method adds an 'onEvent' to the grouping construct.
+	 * 
+	 * @param on The 'onEvent' to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addOnEvent(OnEvent on, int pos) {
+		if (pos == -1 || pos >= m_onEvents.size()) {
+			m_onEvents.add(on);
+			
+			org.w3c.dom.Element insertBefore=null;
+			
+			if (m_onAlarms.size() > 0) {
+				insertBefore = m_onAlarms.get(0).getDOMElement();
+			}
+			
+			setChildElement(null, on, insertBefore);
+		} else {
+			
+			OnEvent cur=m_onEvents.get(pos);
+			
+			m_onEvents.add(pos, on);
+			
+			if (cur != null) {
+				setChildElement(null, on,
+							cur.getDOMElement());
+			} else {
+				org.w3c.dom.Element insertBefore=null;
+				
+				if (m_onAlarms.size() > 0) {
+					insertBefore = m_onAlarms.get(0).getDOMElement();
+				}
+				
+				setChildElement(null, on, insertBefore);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an 'onEvent' from the grouping
+	 * construct.
+	 * 
+	 * @param on The 'onEvent' to be removed
+	 * @return Whether the 'onEvent' was removed
+	 */
+	public boolean removeOnEvent(OnEvent on) {
+		boolean ret=m_onEvents.remove(on);
+		
+		if (ret) {
+			getDOMElement().removeChild(on.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of 'onEvent' associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of 'onEvent' elements
+	 */
+	public java.util.List<OnEvent> getOnEvents() {
+		return(m_onEvents);
+	}
+
+	/**
+	 * This method adds an 'onAlarm' to the grouping construct.
+	 * 
+	 * @param on The 'onAlarm' to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addOnAlarm(OnAlarm on, int pos) {
+		if (pos == -1 || pos >= m_onAlarms.size()) {
+			m_onAlarms.add(on);
+			
+			setChildElement(null, on, null);
+		} else {
+			
+			OnAlarm cur=m_onAlarms.get(pos);
+			
+			m_onAlarms.add(pos, on);
+			
+			if (cur != null) {
+				setChildElement(null, on,
+							cur.getDOMElement());
+			} else {
+				setChildElement(null, on, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an 'onAlarm' from the grouping
+	 * construct.
+	 * 
+	 * @param on The 'onAlarm' to be removed
+	 * @return Whether the 'onAlarm' was removed
+	 */
+	public boolean removeOnAlarm(OnAlarm on) {
+		boolean ret=m_onAlarms.remove(on);
+		
+		if (ret) {
+			getDOMElement().removeChild(on.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of 'onAlarm' associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of 'onAlarm' elements
+	 */
+	public java.util.List<OnAlarm> getOnAlarms() {
+		return(m_onAlarms);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method converts the BPEL activity into an equivalent
+	 * behavioural description for conformance checking.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	public void convert(java.util.List<Activity> activities,
+			ConversionContext context) {
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof OnEvent) {
+			ret += "@onEvent."+getOnEvents().indexOf(elem);
+		} else if (elem instanceof OnAlarm) {
+			ret += "@onAlarm."+getOnAlarms().indexOf(elem);
+		}
+		
+		return(ret);
+	}
+	
+	private java.util.List<OnEvent> m_onEvents=
+					new java.util.Vector<OnEvent>();
+	private java.util.List<OnAlarm> m_onAlarms=
+					new java.util.Vector<OnAlarm>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Exit.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Exit.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Exit.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,82 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the exit activity.
+ *  
+ * @author gary
+ */
+public class Exit extends BPELActivity {
+
+	private static final long serialVersionUID = -5261386654111234711L;
+
+	public static final String EXIT = "exit";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Exit(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Exit(BPELLanguageModel model) {
+		super(model, EXIT);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/FaultHandlers.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/FaultHandlers.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/FaultHandlers.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,148 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.apache.commons.logging.*;
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'faultHandlers' construct contained
+ * within the 'scope' activity.
+ */
+public class FaultHandlers extends BPELElement {
+
+	private static final long serialVersionUID = 4136137332367247503L;
+
+	public static final String FAULTHANDLERS="faultHandlers";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public FaultHandlers(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		java.util.List<BPELElement> paths=
+				findChildElements(Catch.class);
+
+		for (int i=0; i < paths.size(); i++) {
+			m_catchPaths.add((Catch)paths.get(i));
+		}
+		
+		paths = findChildElements(CatchAll.class);
+		
+		if (paths.size() > 0) {
+			m_catchAll = (CatchAll)paths.get(0);
+		
+			if (paths.size() > 1) {
+				logger.error("BPEL 'faultHandlers' has multiple 'catchAll' constructs");
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public FaultHandlers(BPELLanguageModel model) {
+		super(model, FAULTHANDLERS);
+	}
+
+	/**
+	 * This method adds a 'catch' path.
+	 * 
+	 * @param act The 'catch' path
+	 */
+	public void addCatch(Catch act) {
+		m_catchPaths.add(act);
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_catchAll != null) {
+			insertBefore = m_catchAll.getDOMElement();
+		}
+		
+		setChildElement(null, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the list of 'catch' paths.
+	 * 
+	 * @return The list of 'catch' paths
+	 */
+	public java.util.List<Catch> getCatchPaths() {
+		return(m_catchPaths);
+	}
+	
+	/**
+	 * This method sets the 'catchAll' path.
+	 * 
+	 * @param act The 'catchAll' path
+	 */
+	public void setCatchAll(CatchAll act) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_catchAll != null) {
+			existingElem = m_catchAll.getDOMElement();
+		}
+
+		m_catchAll = act;
+		
+		setChildElement(existingElem, act,
+						null);
+	}
+	
+	/**
+	 * This method returns the 'catchAll' path.
+	 * 
+	 * @return The 'catchAll' path
+	 */
+	public CatchAll getCatchAll() {
+		return(m_catchAll);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof Catch) {
+			ret += "@catch."+getCatchPaths().indexOf(elem);
+		} else if (elem instanceof CatchAll) {
+			ret += "@catchAll";
+		}
+		
+		return(ret);
+	}
+	
+	private static Log logger=LogFactory.getLog(FaultHandlers.class);
+	
+	private CatchAll m_catchAll=null;
+	private java.util.List<Catch> m_catchPaths=
+				new java.util.Vector<Catch>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Flow.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Flow.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Flow.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,292 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a flow grouping activity.
+ *  
+ */
+public class Flow extends BPELActivity {
+
+	private static final long serialVersionUID = -5165269453306785719L;
+
+	public static final String FLOW = "flow";
+	public static final String LINKS = "links";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Flow(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		org.w3c.dom.Element links=findChildElement("links");
+		
+		if (links != null) {
+			org.w3c.dom.NodeList nl=links.getChildNodes();
+		
+			for (int i=0; i < nl.getLength(); i++) {
+				if (nl.item(i) instanceof org.w3c.dom.Element &&
+						nl.item(i).getLocalName().equals(Link.LINK)
+						&& nl.item(i) instanceof org.w3c.dom.Element) {
+					m_links.add(new Link(model,
+							(org.w3c.dom.Element)nl.item(i)));
+				}
+			}
+		}
+		
+		java.util.List<BPELElement> acts=
+					findChildElements(BPELActivity.class);
+		
+		for (int i=0; i < acts.size(); i++) {
+			if (acts.get(i).isActivity() &&
+					acts.get(i) instanceof BPELActivity) {
+				m_activities.add((BPELActivity)acts.get(i));
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Flow(BPELLanguageModel model) {
+		super(model, FLOW);
+	}
+
+	/**
+	 * This method adds a link to the grouping construct.
+	 * 
+	 * @param link The link to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addLink(Link link, int pos) {
+		
+		org.w3c.dom.Element links=null;
+		
+		if (m_links.size() == 0) {
+			links = getDOMElement().getOwnerDocument().
+						createElementNS(BPEL_NS, LINKS);
+			
+			if (getDOMElement().getFirstChild() == null) {
+				getDOMElement().appendChild(links);
+			} else {
+				getDOMElement().insertBefore(links,
+						getDOMElement().getFirstChild());
+			}
+		} else {
+			links = findChildElement(LINKS);
+		}
+		
+		org.w3c.dom.Node newNode=link.getDOMElement().cloneNode(true);
+		
+		getDOMElement().getOwnerDocument().adoptNode(newNode);
+		
+		link.setDOMElement((org.w3c.dom.Element)newNode);
+		
+		if (pos == -1 && pos < m_links.size()) {
+			m_links.add(link);
+			
+			links.appendChild(newNode);
+		} else {
+			
+			Link cur=m_links.get(pos);
+			
+			m_links.add(pos, link);
+			
+			if (cur != null) {
+				links.insertBefore(newNode,
+							cur.getDOMElement());
+			} else {
+				links.appendChild(newNode);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes a link from the grouping
+	 * construct.
+	 * 
+	 * @param link The link to be removed
+	 * @return Whether the link was removed
+	 */
+	public boolean removeLink(Link link) {
+		boolean ret=m_links.remove(link);
+		
+		if (ret) {
+			org.w3c.dom.Element links=
+						findChildElement(LINKS);
+			
+			if (links != null) {
+				links.removeChild(link.getDOMElement());
+				
+				if (m_links.size() == 0) {
+					getDOMElement().removeChild(links);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of links associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of links
+	 */
+	public java.util.List<Link> getLinks() {
+		return(m_links);
+	}
+
+	/**
+	 * This method adds an activity to the grouping construct.
+	 * 
+	 * @param act The activity to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addActivity(BPELActivity act, int pos) {
+		if (pos == -1 && pos < m_activities.size()) {
+			m_activities.add(act);
+			
+			setChildElement(null, act, null);
+		} else {
+			
+			BPELActivity cur=m_activities.get(pos);
+			
+			m_activities.add(pos, act);
+			
+			if (cur != null) {
+				setChildElement(null, act,
+							cur.getDOMElement());
+			} else {
+				setChildElement(null, act, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an activity from the grouping
+	 * construct.
+	 * 
+	 * @param act The activity to be removed
+	 * @return Whether the activity was removed
+	 */
+	public boolean removeActivity(BPELActivity act) {
+		boolean ret=m_activities.remove(act);
+		
+		if (ret) {
+			getDOMElement().removeChild(act.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of activities associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of activities
+	 */
+	public java.util.List<BPELActivity> getActivities() {
+		return(m_activities);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//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 < getActivities().size(); i++) {
+			Block b=new Block();
+			
+			getActivities().get(i).convert(b.getContents(), context);
+			
+			parallel.getBlocks().add(b);
+		}
+		
+		activities.add(parallel);
+	}
+
+	private java.util.List<Link> m_links=
+		new java.util.Vector<Link>();
+	private java.util.List<BPELActivity> m_activities=
+		new java.util.Vector<BPELActivity>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/For.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/For.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/For.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,50 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+
+/**
+ * This class represents the BPEL 'for' element.
+ */
+public class For extends AbstractCondition {
+
+	private static final long serialVersionUID = -3123540793706121742L;
+
+	public static final String FOR="for";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public For(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public For(BPELLanguageModel model) {
+		super(model, FOR);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ForEach.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ForEach.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ForEach.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,124 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a forEach grouping activity.
+ *  
+ * @author gary
+ */
+public class ForEach extends BPELGroupingConstruct {
+
+	private static final long serialVersionUID = -4302270930464272401L;
+
+	public static final String FOREACH = "forEach";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public ForEach(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	
+		org.w3c.dom.Element scopeElem=
+			findChildElement(Scope.SCOPE);
+
+		if (scopeElem == null) {
+			m_scope = new Scope(model);
+		} else {
+			m_scope = new Scope(model, scopeElem);
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public ForEach(BPELLanguageModel model) {
+		super(model, FOREACH);
+	}
+
+	/**
+	 * This method sets the scope.
+	 * 
+	 * @param scope The scope
+	 */
+	public void setScope(Scope scope) {
+		m_scope = scope;
+		
+		org.w3c.dom.Element existingElem=this.findChildElement(Scope.SCOPE);
+		
+		setChildElement(existingElem, scope,
+						null);
+	}
+
+	/**
+	 * This method returns the scope.
+	 * 
+	 * @return The scope
+	 */
+	public Scope getScope() {
+		return(m_scope);
+	}
+	
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof Scope) {
+			ret += "@scope";
+		}
+		
+		return(ret);
+	}
+	
+	private Scope m_scope=null;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/If.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/If.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/If.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,289 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+import org.apache.commons.logging.*;
+
+/**
+ * This class represents an 'if' grouping construct.
+ *  
+ * @author gary
+ */
+public class If extends BPELActivity {
+
+	private static final long serialVersionUID = -763221632866464831L;
+	
+	public static final String IF = "if";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public If(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+
+		org.w3c.dom.Element cond=
+				findChildElement(Condition.CONDITION);
+
+		if (cond == null) {
+			m_condition = new Condition(model);
+		} else {
+			m_condition = new Condition(model, cond);
+		}
+	
+		m_activity = findChildActivity();
+		
+		java.util.List<BPELElement> paths=
+						findChildElements(Elseif.class);
+		
+		for (int i=0; i < paths.size(); i++) {
+			m_elseIfPaths.add((Elseif)paths.get(i));
+		}
+		
+		paths = findChildElements(Else.class);
+		
+		if (paths.size() > 0) {
+			m_elsePath = (Else)paths.get(0);
+			
+			if (paths.size() > 1) {
+				logger.error("BPEL 'if' has multiple 'else' constructs");
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public If(BPELLanguageModel model) {
+		super(model, IF);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+		
+		org.scribble.protocol.model.Choice elem=
+					new org.scribble.protocol.model.Choice();
+		
+		When cb=new When();
+		
+		// TODO: Convert the conditional expression
+		
+		if (getActivity() != null) {
+			getActivity().convert(cb.getBlock().getContents(), context);
+		}
+		
+		elem.getWhens().add(cb);
+		
+		// Convert 'else if' paths
+		for (int i=0; i < getElseIfPaths().size(); i++) {
+			Elseif elseIfElem=getElseIfPaths().get(i);
+			
+			cb = new When();
+			
+			elseIfElem.convert(cb.getBlock().getContents(), context);
+			
+			elem.getWhens().add(cb);
+		}
+		
+		// Convert 'else' path
+		if (getElsePath() != null) {
+			cb = new When();
+			
+			getElsePath().convert(cb.getBlock().getContents(), context);
+			
+			elem.getWhens().add(cb);
+		}
+		
+		activities.add(elem);
+	}
+
+	/**
+	 * This method sets the condition.
+	 * 
+	 * @param cond The condition
+	 */
+	public void setCondition(Condition cond) {
+		m_condition = cond;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_activity != null) {
+			insertBefore = m_activity.getDOMElement();
+		} else if (m_elseIfPaths.size() > 0) {
+			insertBefore = m_elseIfPaths.get(0).getDOMElement();
+		} else if (m_elsePath != null) {
+			insertBefore = m_elsePath.getDOMElement();
+		}
+		
+		setChildElement(findChildElement(Condition.CONDITION),
+				cond, insertBefore);
+	}
+	
+	/**
+	 * This method returns the condition.
+	 * 
+	 * @return The condition
+	 */
+	public Condition getCondition() {
+		return(m_condition);
+	}
+
+	/**
+	 * This method sets the main 'if' activity.
+	 * 
+	 * @param act The activity associated with the 'if'
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_elseIfPaths.size() > 0) {
+			insertBefore = m_elseIfPaths.get(0).getDOMElement();
+		} else if (m_elsePath != null) {
+			insertBefore = m_elsePath.getDOMElement();
+		}
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+
+	/**
+	 * This method returns the activity associated with
+	 * the 'if' path.
+	 * 
+	 * @return The 'if' activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	/**
+	 * This method adds an 'else if' path.
+	 * 
+	 * @param act The 'else if' path
+	 */
+	public void addElseIfPath(Elseif act) {
+		m_elseIfPaths.add(act);
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_elsePath != null) {
+			insertBefore = m_elsePath.getDOMElement();
+		}
+		
+		setChildElement(null, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the list of 'else if' paths.
+	 * 
+	 * @return The list of 'else if' paths
+	 */
+	public java.util.List<Elseif> getElseIfPaths() {
+		return(m_elseIfPaths);
+	}
+	
+	/**
+	 * This method sets the 'else' path.
+	 * 
+	 * @param act The 'else' path
+	 */
+	public void setElsePath(Else act) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_elsePath != null) {
+			existingElem = m_elsePath.getDOMElement();
+		}
+
+		m_elsePath = act;
+		
+		setChildElement(existingElem, act,
+						null);
+	}
+	
+	/**
+	 * This method returns the 'else' path.
+	 * 
+	 * @return The 'else' path
+	 */
+	public Else getElsePath() {
+		return(m_elsePath);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof Elseif) {
+			int pos=getElseIfPaths().indexOf(elem);
+			ret = "@elseif."+pos;
+		} else if (elem instanceof Else) {
+			ret = "@else";
+		} else {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private static Log logger=LogFactory.getLog(If.class);
+	
+	private Condition m_condition=null;
+	private BPELElement m_activity=null;
+	private Else m_elsePath=null;
+	private java.util.List<Elseif> m_elseIfPaths=
+				new java.util.Vector<Elseif>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Import.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Import.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Import.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,120 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'import' construct.
+ */
+public class Import extends BPELElement {
+
+	private static final long serialVersionUID = -7103589689575940289L;
+
+	private static final String IMPORT_TYPE = "importType";
+	private static final String NAMESPACE = "namespace";
+	private static final String LOCATION = "location";
+
+	public static final String IMPORT="import";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public Import(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Import(BPELLanguageModel model) {
+		super(model, IMPORT);
+	}
+
+	/**
+	 * This method sets the import type.
+	 * 
+	 * @param importType The import type
+	 */
+	public void setImportType(String importType) {		
+		getDOMElement().setAttribute(IMPORT_TYPE, importType);
+	}
+	
+	/**
+	 * This method returns the iport type.
+	 * 
+	 * @return The import type
+	 */
+	public String getImportType() {
+		return(getDOMElement().hasAttribute(IMPORT_TYPE)?
+				getDOMElement().getAttribute(IMPORT_TYPE):null);
+	}
+
+	/**
+	 * This method sets the namespace.
+	 * 
+	 * @param ns The namespace
+	 */
+	public void setNamespace(String ns) {		
+		getDOMElement().setAttribute(NAMESPACE, ns);
+	}
+	
+	/**
+	 * This method returns the namespace.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(getDOMElement().hasAttribute(NAMESPACE)?
+				getDOMElement().getAttribute(NAMESPACE):null);
+	}
+
+	/**
+	 * This method sets the location.
+	 * 
+	 * @param location The location
+	 */
+	public void setLocation(String location) {		
+		getDOMElement().setAttribute(LOCATION, location);
+	}
+	
+	/**
+	 * This method returns the location.
+	 * 
+	 * @return The location
+	 */
+	public String getLocation() {
+		return(getDOMElement().hasAttribute(LOCATION)?
+				getDOMElement().getAttribute(LOCATION):null);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Invoke.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Invoke.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Invoke.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,318 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.util.TypeReferenceUtil;
+import org.savara.util.XMLUtils;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *  
+ * @author gary
+ */
+public class Invoke extends AbstractInteraction {
+
+	private static final String INPUT_VARIABLE = "inputVariable";
+	private static final String OUTPUT_VARIABLE = "outputVariable";
+	public static final String INVOKE = "invoke";
+	
+	private static final long serialVersionUID = 928076947383263387L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Invoke(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Invoke(BPELLanguageModel model) {
+		super(model, INVOKE);
+	}
+	
+	/**
+	 * This method sets the input variable.
+	 * 
+	 * @param var The input variable
+	 */
+	public void setInputVariable(String var) {		
+		getDOMElement().setAttribute(INPUT_VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the input variable.
+	 * 
+	 * @return The input variable
+	 */
+	public String getInputVariable() {
+		return(getDOMElement().hasAttribute(INPUT_VARIABLE)?
+				getDOMElement().getAttribute(INPUT_VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the output variable.
+	 * 
+	 * @param var The output variable
+	 */
+	public void setOutputVariable(String var) {		
+		getDOMElement().setAttribute(OUTPUT_VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the output variable.
+	 * 
+	 * @return The output variable
+	 */
+	public String getOutputVariable() {
+		return(getDOMElement().hasAttribute(OUTPUT_VARIABLE)?
+				getDOMElement().getAttribute(OUTPUT_VARIABLE):null);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+		
+		convertRequest(activities, context);
+		
+		// Check if invoke is contained within a scope that defines
+		// fault handlers. If so, then generate choice to throw
+		// fault exceptions.
+		ScopeActivity scope=null;
+		org.w3c.dom.Element cur=getDOMElement();
+		
+		while (cur != null && cur.getParentNode() instanceof org.w3c.dom.Element &&
+							scope == null) {
+			cur = (org.w3c.dom.Element)cur.getParentNode();
+			
+			if (cur != null) {
+				BPELElement elem=BPELElementFactory.createBPELElement(getModel(),
+										cur);
+				
+				if (elem instanceof ScopeActivity) {
+					scope = (ScopeActivity)elem;
+				}
+			}
+		}
+		
+		if (scope != null && scope.getFaultHandlers() != null &&
+						(scope.getFaultHandlers().getCatchPaths().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().getCatchPaths().size(); i++) {
+				Catch catchBlock=scope.getFaultHandlers().getCatchPaths().get(i);
+
+				org.scribble.protocol.model.When fcb=
+					new org.scribble.protocol.model.When();
+				
+				String mesgType=catchBlock.getFaultMessageType();
+				
+				if (mesgType == null) {
+					mesgType = catchBlock.getFaultMessageElement();
+				}
+				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
+				convertFaultResponse(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(XMLUtils.getLocalname(catchBlock.getFaultName()));
+				raise.setType(tref);
+				
+				fcb.getBlock().add(raise);
+				
+				te.getWhens().add(fcb);
+				
+				if (faultVar != null) {
+					context.removeVariable(faultVar);
+				}
+			}
+		}
+		
+		if (getOutputVariable() != null) {
+			
+			convertResponse(activities, context);
+		}
+	}
+	
+	protected void convertRequest(java.util.List<Activity> activities,
+			ConversionContext context) {
+		// Create interaction for request
+		Interaction interaction=new Interaction();
+		interaction.derivedFrom(this);
+		
+		Variable var=context.getVariable(getInputVariable());
+		
+		String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+				context.getEnvironmentContext());
+
+		TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+				
+		MessageSignature ms=new MessageSignature();
+		ms.setOperation(getOperation());
+		ms.getTypeReferences().add(tref);
+		
+		if (context.getRole() != null) {
+			interaction.setFromRole(new Role(context.getRole()));
+		}
+		
+		String toRole=getClientPartnerRole();
+		
+		if (toRole != null) {
+			interaction.getToRoles().add(new Role(toRole));
+		}
+		
+		interaction.setMessageSignature(ms);
+		
+		activities.add(interaction);
+	}
+
+	protected void convertResponse(java.util.List<Activity> activities,
+			ConversionContext context) {
+		
+		// Create interaction for request
+		Interaction interaction=new Interaction();
+		interaction.derivedFrom(this);
+		
+		Variable var=context.getVariable(getOutputVariable());
+		
+		String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+				context.getEnvironmentContext());
+
+		TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+		
+		MessageSignature ms=new MessageSignature();
+		ms.setOperation(getOperation());
+		ms.getTypeReferences().add(tref);
+		
+		String fromRole=getClientPartnerRole();
+		
+		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 void convertFaultResponse(java.util.List<Activity> activities,
+			String faultVar, String 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.
+		
+		Variable var=context.getVariable(faultVar);
+		
+		if (var != null) {
+			String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+					context.getEnvironmentContext());
+
+			tref = TypeReferenceUtil.createTypeReference(xmlType, context);
+			//tref.setLocalpart(var.getMessageType());
+		} else if (faultMesgType != null) {
+			tref = TypeReferenceUtil.createTypeReference(faultMesgType, context);
+			//tref.setLocalpart(faultMesgType);
+		}
+		
+		MessageSignature ms=new MessageSignature();
+		ms.setOperation(getOperation());
+		ms.getTypeReferences().add(tref);
+		
+		String fromRole=getClientPartnerRole();
+		
+		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);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Link.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Link.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Link.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the BPEL link element, contained within
+ * the flow activity.
+ */
+public class Link extends BPELElement {
+
+	private static final long serialVersionUID = 6889776538490515074L;
+
+	private static final String NAME = "name";
+
+	public static final String LINK="link";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public Link(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Link(BPELLanguageModel model) {
+		super(model, LINK);
+	}
+
+	/**
+	 * This method returns the name associated
+	 * with the link.
+	 * 
+	 * @return The link name
+	 */
+	public String getName() {
+		return(getDOMElement().getAttribute(NAME));
+	}
+	
+	/**
+	 * This method sets the link name.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		getDOMElement().setAttribute(NAME, name);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnAlarm.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnAlarm.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnAlarm.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,182 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'onAlarm' construct contained
+ * within the 'pick' activity.
+ */
+public class OnAlarm extends BPELElement {
+
+	private static final long serialVersionUID = 271323368015539L;
+
+	public static final String ONALARM="onAlarm";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public OnAlarm(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public OnAlarm(BPELLanguageModel model) {
+		super(model, ONALARM);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	/**
+	 * This method sets the 'until' condition.
+	 * 
+	 * @param cond The 'until' condition
+	 */
+	public void setUntil(Until cond) {
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_activity != null) {
+			insertBefore = m_activity.getDOMElement();
+		}
+		
+		setChildElement(findChildElement(Until.UNTIL),
+				cond, insertBefore);
+		
+		org.w3c.dom.Element elem=findChildElement(For.FOR);
+		if (elem != null) {
+			getDOMElement().removeChild(elem);
+		}
+	}
+	
+	/**
+	 * This method returns the 'until' condition.
+	 * 
+	 * @return The 'until' condition
+	 */
+	public Until getUntil() {
+		Until ret=null;
+		
+		org.w3c.dom.Element elem=findChildElement(Until.UNTIL);
+		if (elem != null) {
+			ret = new Until(getModel(), elem);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method sets the 'for' condition.
+	 * 
+	 * @param cond The 'for' condition
+	 */
+	public void setFor(For cond) {	
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_activity != null) {
+			insertBefore = m_activity.getDOMElement();
+		}
+		
+		setChildElement(findChildElement(For.FOR),
+				cond, insertBefore);
+		
+		org.w3c.dom.Element elem=findChildElement(Until.UNTIL);
+		if (elem != null) {
+			getDOMElement().removeChild(elem);
+		}
+	}
+	
+	/**
+	 * This method returns the 'for' condition.
+	 * 
+	 * @return The 'for' condition
+	 */
+	public For getFor() {
+		For ret=null;
+		
+		org.w3c.dom.Element elem=findChildElement(For.FOR);
+		if (elem != null) {
+			ret = new For(getModel(), elem);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+		
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof Scope) {
+			ret = "@scope";
+		} else {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnEvent.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnEvent.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnEvent.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,191 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'onEvent' construct contained
+ * within the 'EventHandler' element.
+ */
+public class OnEvent extends BPELElement {
+
+	private static final long serialVersionUID = -2444989267977027500L;
+
+	private static final String PARTNER_LINK = "partnerLink";
+	private static final String PORT_TYPE = "portType";
+	private static final String OPERATION = "operation";
+	private static final String VARIABLE = "variable";
+
+	public static final String ONEVENT="onEvent";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public OnEvent(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		BPELElement elem=findChildActivity();
+		
+		if (elem instanceof Scope) {
+			m_scope = (Scope)elem;
+		}
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public OnEvent(BPELLanguageModel model) {
+		super(model, ONEVENT);
+	}
+
+	/**
+	 * This method sets the operation.
+	 * 
+	 * @param op The operation
+	 */
+	public void setOperation(String op) {		
+		getDOMElement().setAttribute(OPERATION, op);
+	}
+	
+	/**
+	 * This method returns the operation.
+	 * 
+	 * @return The operation
+	 */
+	public String getOperation() {
+		return(getDOMElement().hasAttribute(OPERATION)?
+				getDOMElement().getAttribute(OPERATION):null);
+	}
+
+	/**
+	 * This method sets the partner link.
+	 * 
+	 * @param pl The partner link
+	 */
+	public void setPartnerLink(String pl) {		
+		getDOMElement().setAttribute(PARTNER_LINK, pl);
+	}
+	
+	/**
+	 * This method returns the partner link.
+	 * 
+	 * @return The partner link
+	 */
+	public String getPartnerLink() {
+		return(getDOMElement().hasAttribute(PARTNER_LINK)?
+				getDOMElement().getAttribute(PARTNER_LINK):null);
+	}
+
+	/**
+	 * This method sets the port type.
+	 * 
+	 * @param pt The port type
+	 */
+	public void setPortType(String pt) {		
+		getDOMElement().setAttribute(PORT_TYPE, pt);
+	}
+	
+	/**
+	 * This method returns the port type.
+	 * 
+	 * @return The port type
+	 */
+	public String getPortType() {
+		return(getDOMElement().hasAttribute(PORT_TYPE)?
+				getDOMElement().getAttribute(PORT_TYPE):null);
+	}
+
+	/**
+	 * This method sets the variable.
+	 * 
+	 * @param var The variable
+	 */
+	public void setVariable(String var) {		
+		getDOMElement().setAttribute(VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the variable.
+	 * 
+	 * @return The variable
+	 */
+	public String getVariable() {
+		return(getDOMElement().hasAttribute(VARIABLE)?
+				getDOMElement().getAttribute(VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the scope associated with
+	 * the 'onEvent' construct.
+	 * 
+	 * @param scope The scope
+	 */
+	public void setScope(Scope scope) {
+		m_scope = scope;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, scope,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the scope associated with
+	 * the 'onEvent' construct.
+	 * 
+	 * @return The scope
+	 */
+	public Scope getScope() {
+		return(m_scope);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof Scope) {
+			ret += "@scope";
+		}
+		
+		return(ret);
+	}
+	
+	private Scope m_scope;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnMessage.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnMessage.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/OnMessage.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,233 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.util.TypeReferenceUtil;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents the 'onMessage' construct contained
+ * within the 'pick' activity.
+ */
+public class OnMessage extends BPELElement {
+
+	private static final long serialVersionUID = -827946684365823245L;
+
+	private static final String PARTNER_LINK = "partnerLink";
+	private static final String PORT_TYPE = "portType";
+	private static final String OPERATION = "operation";
+	private static final String VARIABLE = "variable";
+
+	public static final String ONMESSAGE="onMessage";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public OnMessage(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public OnMessage(BPELLanguageModel model) {
+		super(model, ONMESSAGE);
+	}
+
+	/**
+	 * This method sets the operation.
+	 * 
+	 * @param op The operation
+	 */
+	public void setOperation(String op) {		
+		getDOMElement().setAttribute(OPERATION, op);
+	}
+	
+	/**
+	 * This method returns the operation.
+	 * 
+	 * @return The operation
+	 */
+	public String getOperation() {
+		return(getDOMElement().hasAttribute(OPERATION)?
+				getDOMElement().getAttribute(OPERATION):null);
+	}
+
+	/**
+	 * This method sets the partner link.
+	 * 
+	 * @param pl The partner link
+	 */
+	public void setPartnerLink(String pl) {		
+		getDOMElement().setAttribute(PARTNER_LINK, pl);
+	}
+	
+	/**
+	 * This method returns the partner link.
+	 * 
+	 * @return The partner link
+	 */
+	public String getPartnerLink() {
+		return(getDOMElement().hasAttribute(PARTNER_LINK)?
+				getDOMElement().getAttribute(PARTNER_LINK):null);
+	}
+
+	/**
+	 * This method sets the port type.
+	 * 
+	 * @param pt The port type
+	 */
+	public void setPortType(String pt) {		
+		getDOMElement().setAttribute(PORT_TYPE, pt);
+	}
+	
+	/**
+	 * This method returns the port type.
+	 * 
+	 * @return The port type
+	 */
+	public String getPortType() {
+		return(getDOMElement().hasAttribute(PORT_TYPE)?
+				getDOMElement().getAttribute(PORT_TYPE):null);
+	}
+
+	/**
+	 * This method sets the variable.
+	 * 
+	 * @param var The variable
+	 */
+	public void setVariable(String var) {		
+		getDOMElement().setAttribute(VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the variable.
+	 * 
+	 * @return The variable
+	 */
+	public String getVariable() {
+		return(getDOMElement().hasAttribute(VARIABLE)?
+				getDOMElement().getAttribute(VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	/**
+	 * This method attempts to identify the server's partner role name.
+	 * 
+	 * @return The partner role
+	 */
+	protected String getServerPartnerRole() {
+		String ret=getPartnerLink();
+		int index=-1;
+		
+		if (ret != null && (index=ret.indexOf("To")) != -1) {
+			ret = ret.substring(0, index);
+		}
+		
+		return(ret);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		
+		Interaction interaction=new Interaction();
+		
+		Variable var=context.getVariable(getVariable());
+		
+		String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+				context.getEnvironmentContext());
+
+		TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+		
+		MessageSignature ms=new MessageSignature();
+		ms.setOperation(getOperation());
+		ms.getTypeReferences().add(tref);
+		
+		String fromRole=getServerPartnerRole();
+		
+		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);
+
+		if (getActivity() != null) {
+			getActivity().convert(activities, context);
+		}
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/PartnerLink.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/PartnerLink.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/PartnerLink.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,140 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'partnerLink' construct.
+ */
+public class PartnerLink extends BPELElement {
+
+	private static final long serialVersionUID = 8342639172267763736L;
+
+	private static final String NAME = "name";
+	private static final String PARTNER_LINK_TYPE = "partnerLinkType";
+	private static final String MY_ROLE = "myRole";
+	private static final String PARTNER_ROLE = "partnerRole";
+
+	public static final String PARTNERLINK="partnerLink";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public PartnerLink(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public PartnerLink(BPELLanguageModel model) {
+		super(model, PARTNERLINK);
+	}
+
+	/**
+	 * This method sets the name.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {		
+		getDOMElement().setAttribute(NAME, name);
+	}
+	
+	/**
+	 * This method returns the name.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(getDOMElement().hasAttribute(NAME)?
+				getDOMElement().getAttribute(NAME):null);
+	}
+
+	/**
+	 * This method sets the partner link type.
+	 * 
+	 * @param pl The partner link type
+	 */
+	public void setPartnerLinkType(String pl) {		
+		getDOMElement().setAttribute(PARTNER_LINK_TYPE, pl);
+	}
+	
+	/**
+	 * This method returns the partner link type.
+	 * 
+	 * @return The partner link type
+	 */
+	public String getPartnerLinkType() {
+		return(getDOMElement().hasAttribute(PARTNER_LINK_TYPE)?
+				getDOMElement().getAttribute(PARTNER_LINK_TYPE):null);
+	}
+
+	/**
+	 * This method sets my role.
+	 * 
+	 * @param role My role
+	 */
+	public void setMyRole(String role) {		
+		getDOMElement().setAttribute(MY_ROLE, role);
+	}
+	
+	/**
+	 * This method returns my role.
+	 * 
+	 * @return My role
+	 */
+	public String getMyRole() {
+		return(getDOMElement().hasAttribute(MY_ROLE)?
+				getDOMElement().getAttribute(MY_ROLE):null);
+	}
+
+	/**
+	 * This method sets partner role.
+	 * 
+	 * @param role Partner role
+	 */
+	public void setPartnerRole(String role) {		
+		getDOMElement().setAttribute(PARTNER_ROLE, role);
+	}
+	
+	/**
+	 * This method returns partner role.
+	 * 
+	 * @return Partner role
+	 */
+	public String getPartnerRole() {
+		return(getDOMElement().hasAttribute(PARTNER_ROLE)?
+				getDOMElement().getAttribute(PARTNER_ROLE):null);
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Pick.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Pick.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Pick.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,283 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a pick grouping activity.
+ *  
+ * @author gary
+ */
+public class Pick extends BPELActivity {
+
+	private static final long serialVersionUID = -2235972351406517577L;
+
+	public static final String PICK = "pick";
+	public static final String CREATE_INSTANCE = "createInstance";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Pick(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		java.util.List<BPELElement> onmesgs=
+					findChildElements(OnMessage.class);
+		
+		for (int i=0; i < onmesgs.size(); i++) {
+			if (onmesgs.get(i) instanceof OnMessage) {
+				m_onMessages.add((OnMessage)onmesgs.get(i));
+			}
+		}
+		
+		java.util.List<BPELElement> onalrms=
+					findChildElements(OnAlarm.class);
+		
+		for (int i=0; i < onalrms.size(); i++) {
+			if (onalrms.get(i) instanceof OnAlarm) {
+				m_onAlarms.add((OnAlarm)onalrms.get(i));
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Pick(BPELLanguageModel model) {
+		super(model, PICK);
+	}
+
+	/**
+	 * This method sets the 'create instance'
+	 * attribute.
+	 * 
+	 * @param b Whether to create instance
+	 */
+	public void setCreateInstance(boolean b) {
+		String create=(b?"yes":"no");
+		
+		getDOMElement().setAttribute(CREATE_INSTANCE, create);
+	}
+	
+	/**
+	 * This method returns whether to create instance.
+	 * 
+	 * @return Whether to create instance
+	 */
+	public boolean getCreateInstance() {
+		boolean ret=false;
+		String create=
+			getDOMElement().getAttribute(CREATE_INSTANCE);
+
+		if (create != null &&
+				create.equals("yes")) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method adds an 'onMessage' to the grouping construct.
+	 * 
+	 * @param on The 'onMessage' to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addOnMessage(OnMessage on, int pos) {
+		if (pos == -1 || pos >= m_onMessages.size()) {
+			m_onMessages.add(on);
+			
+			org.w3c.dom.Element insertBefore=null;
+			
+			if (m_onAlarms.size() > 0) {
+				insertBefore = m_onAlarms.get(0).getDOMElement();
+			}
+			
+			setChildElement(null, on, insertBefore);
+		} else {
+			
+			OnMessage cur=m_onMessages.get(pos);
+			
+			m_onMessages.add(pos, on);
+			
+			if (cur != null) {
+				setChildElement(null, on,
+							cur.getDOMElement());
+			} else {
+				org.w3c.dom.Element insertBefore=null;
+				
+				if (m_onAlarms.size() > 0) {
+					insertBefore = m_onAlarms.get(0).getDOMElement();
+				}
+				
+				setChildElement(null, on, insertBefore);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an 'onMessage' from the grouping
+	 * construct.
+	 * 
+	 * @param on The 'onMessage' to be removed
+	 * @return Whether the 'onMessage' was removed
+	 */
+	public boolean removeOnMessage(OnMessage on) {
+		boolean ret=m_onMessages.remove(on);
+		
+		if (ret) {
+			getDOMElement().removeChild(on.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of 'onMessage' associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of 'onMessage' elements
+	 */
+	public java.util.List<OnMessage> getOnMessages() {
+		return(m_onMessages);
+	}
+
+	/**
+	 * This method adds an 'onAlarm' to the grouping construct.
+	 * 
+	 * @param on The 'onAlarm' to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addOnAlarm(OnAlarm on, int pos) {
+		if (pos == -1 || pos >= m_onAlarms.size()) {
+			m_onAlarms.add(on);
+			
+			setChildElement(null, on, null);
+		} else {
+			
+			OnAlarm cur=m_onAlarms.get(pos);
+			
+			m_onAlarms.add(pos, on);
+			
+			if (cur != null) {
+				setChildElement(null, on,
+							cur.getDOMElement());
+			} else {
+				setChildElement(null, on, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an 'onAlarm' from the grouping
+	 * construct.
+	 * 
+	 * @param on The 'onAlarm' to be removed
+	 * @return Whether the 'onAlarm' was removed
+	 */
+	public boolean removeOnAlarm(OnAlarm on) {
+		boolean ret=m_onAlarms.remove(on);
+		
+		if (ret) {
+			getDOMElement().removeChild(on.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of 'onAlarm' associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of 'onAlarm' elements
+	 */
+	public java.util.List<OnAlarm> getOnAlarms() {
+		return(m_onAlarms);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+		
+		org.scribble.protocol.model.Choice elem=
+					new org.scribble.protocol.model.Choice();
+		
+		// Convert 'onMessage' paths
+		for (int i=0; i < getOnMessages().size(); i++) {
+			OnMessage onMessageElem=getOnMessages().get(i);
+			
+			When cb = new When();
+			
+			onMessageElem.convert(cb.getBlock().getContents(), context);
+			
+			elem.getWhens().add(cb);
+		}
+		
+		// TODO: If alarms defined, then model these using a
+		// try/catch with interrupt?
+		
+		activities.add(elem);
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof OnMessage) {
+			ret += "@onMessage."+getOnMessages().indexOf(elem);
+		} else if (elem instanceof OnAlarm) {
+			ret += "@onAlarm."+getOnAlarms().indexOf(elem);
+		}
+		
+		return(ret);
+	}
+	
+	private java.util.List<OnMessage> m_onMessages=
+					new java.util.Vector<OnMessage>();
+	private java.util.List<OnAlarm> m_onAlarms=
+					new java.util.Vector<OnAlarm>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Process.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Process.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Process.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,976 @@
+/*
+ * 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.model.component;
+
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.util.InteractionUtil;
+import org.savara.util.XMLUtils;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This class represents a BPEL process.
+ *  
+ * @author gary
+ */
+public class Process extends BPELElement implements ScopeActivity {
+
+	private static final long serialVersionUID = 3400962966628415184L;
+
+	public static final String PROCESS = "process";
+	public static final String NAME = "name";
+	public static final String TARGET_NAMESPACE = "targetNamespace";
+	public static final String CONVERSATION_TYPE = "conversationType";
+	public static final String BPEL_PREFIX = "bpel";
+	
+	public static final String CONVERSATION_NS="http://www.scribble.org/conversation";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Process(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		java.util.List<BPELElement> imports=findChildElements(Import.class);
+		for (BPELElement elem : imports) {
+			m_imports.add((Import)elem);
+		}
+		
+		m_partnerLinksElem = findChildElement("partnerLinks");
+		
+		if (m_partnerLinksElem != null) {
+			java.util.List<BPELElement> elems=
+					findChildElements(m_partnerLinksElem,
+							PartnerLink.class);
+
+			for (int i=0; i < elems.size(); i++) {
+				m_partnerLinks.add((PartnerLink)elems.get(i));
+			}
+		}
+		
+		m_variablesElem = findChildElement("variables");
+
+		if (m_variablesElem != null) {
+			java.util.List<BPELElement> elems=
+					findChildElements(m_variablesElem,
+							Variable.class);
+
+			for (int i=0; i < elems.size(); i++) {
+				m_variables.add((Variable)elems.get(i));
+			}
+		}
+		
+		//m_messageExchangesElem = findChildElement("messageExchanges");
+		//m_correlationSetsElem = findChildElement("correlationSets");
+		
+		org.w3c.dom.Element ehs=findChildElement(EventHandlers.EVENTHANDLERS);
+		if (ehs != null) {
+			m_eventHandlers = new EventHandlers(model, ehs);
+		}
+		
+		org.w3c.dom.Element fhs=findChildElement(FaultHandlers.FAULTHANDLERS);
+		if (fhs != null) {
+			m_faultHandlers = new FaultHandlers(model, fhs);
+		}
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Process(BPELLanguageModel model) {
+		super(model, PROCESS);
+		
+		initNamespace(BPEL_NS, BPEL_PREFIX);
+	}
+
+	/**
+	 * This method adds an import to the scope.
+	 * 
+	 * @param imp The import to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addImport(Import imp, int pos) {
+		
+		if (pos != -1 && pos < m_imports.size()) {
+			m_imports.add(pos, imp);
+		} else {
+			m_imports.add(imp);
+		}
+		
+		java.util.List<BPELElement> children=findChildElements(BPELElement.class);
+		
+		org.w3c.dom.Node newNode=imp.getDOMElement().cloneNode(true);
+		
+		getDOMElement().getOwnerDocument().adoptNode(newNode);
+		
+		if (pos != -1 && pos < children.size()) {
+			getDOMElement().insertBefore(newNode, children.get(pos).getDOMElement());
+		} else {
+			getDOMElement().appendChild(newNode);
+		}
+	}
+	
+	/**
+	 * This method removes a partner link from the grouping
+	 * construct.
+	 * 
+	 * @param pl The partner link to be removed
+	 * @return Whether the partner link was removed
+	 */
+	public boolean removeImport(Import imp) {
+		boolean ret=m_imports.remove(imp);
+		
+		if (ret) {
+			getDOMElement().removeChild(imp.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of imports.
+	 * 
+	 * @return The imports
+	 */
+	public java.util.List<Import> getImports() {
+		return(m_imports);
+	}
+	
+	/**
+	 * This method searches the defined WSDL definitions to identify
+	 * the underlying XML element/type associated with the supplied
+	 * WSDL message type.
+	 * 
+	 * @param wsdlMessageType The WSDL message type
+	 * @param context The context
+	 * @return The underlying XML element/type, or null if not found
+	 */
+	public String getXMLType(String wsdlMessageType, Context context) {
+		String ret=null;
+		
+		// Resolve the namespace prefix
+		int index=wsdlMessageType.indexOf(':');
+		
+		if (index != -1 && context != null) {
+			String prefix=wsdlMessageType.substring(0, index);
+			
+			String namespace=getNamespace(prefix);
+			
+			wsdlMessageType = wsdlMessageType.substring(index+1);
+		
+			for (Import imp : getImports()) {
+				
+				// Check if import relates to the correct namespace
+				if (imp.getNamespace() != null &&
+						imp.getNamespace().equals(namespace) &&
+						imp.getLocation() != null &&
+						imp.getLocation().endsWith(".wsdl")) {
+					
+					java.net.URI uri=
+							context.getResourceURI(getModel().getModelReference(),
+										imp.getLocation());
+
+					if (uri != null) {
+						ret = getXMLType(imp.getNamespace(), wsdlMessageType, uri);
+						
+						if (ret != null) {
+							break;
+						}
+					}
+				}
+			}
+		}
+		
+		return(ret);
+	}
+
+	protected String getXMLType(String namespace, String wsdlMessageType, java.net.URI uri) {
+		String ret=null;
+		
+		try {
+			WSDLReader reader=javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
+			
+			javax.wsdl.Definition defn=reader.readWSDL(uri.toString());
+			
+			if (defn != null) {
+				javax.wsdl.Message mesg=defn.getMessage(new QName(namespace, wsdlMessageType));
+				
+				if (mesg != null && mesg.getParts().size() == 1) {
+					javax.wsdl.Part part=(javax.wsdl.Part)
+								mesg.getParts().values().iterator().next();
+					
+					if (part.getElementName() != null) {
+						ret = part.getElementName().toString();
+					} else if (part.getTypeName() != null) {
+						ret = part.getTypeName().toString();
+					}
+				}
+			}
+			
+		} catch(Exception e) {
+			logger.error("Failed to read WSDL", e);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of partner links.
+	 * 
+	 * @return The partner links
+	 */
+	public java.util.List<PartnerLink> getPartnerLinks() {
+		return(m_partnerLinks);
+	}
+	
+	/**
+	 * This method returns the partner link associated
+	 * with the supplied name.
+	 * 
+	 * @param name The name
+	 * @return The partner link, or null if not found
+	 */
+	public PartnerLink getPartnerLink(String name) {
+		PartnerLink ret=null;
+		
+		for (int i=0; ret == null && i < m_partnerLinks.size(); i++) {
+			if (m_partnerLinks.get(i).getName().equals(name)) {
+				ret = m_partnerLinks.get(i);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method adds a partner link to the scope.
+	 * 
+	 * @param pl The partner link to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addPartnerLink(PartnerLink pl, int pos) {
+		
+		if (m_partnerLinksElem == null) {
+			m_partnerLinksElem = getDOMElement().getOwnerDocument().
+				createElementNS(BPEL_NS, "partnerLinks");
+			
+			// Add to parent
+			org.w3c.dom.Element insertBefore=
+					findChildElement("messageExchanges");
+
+			if (insertBefore == null) {
+				insertBefore = findChildElement("variables");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("correlationSets");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("faultHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("eventHandlers");
+			}
+			
+			if (insertBefore == null) {
+				BPELElement elem=findChildActivity();
+				
+				if (elem != null) {
+					insertBefore = elem.getDOMElement();
+				}
+			}
+			
+			if (insertBefore != null) {
+				getDOMElement().insertBefore(m_partnerLinksElem, insertBefore);
+			} else {
+				getDOMElement().appendChild(m_partnerLinksElem);
+			}
+		}
+		
+		if (pos == -1 || pos >= m_partnerLinks.size()) {
+			m_partnerLinks.add(pl);
+			
+			setChildElement(m_partnerLinksElem, null, pl, null);
+		} else {
+			
+			PartnerLink cur=m_partnerLinks.get(pos);
+			
+			m_partnerLinks.add(pos, pl);
+			
+			if (cur != null) {
+				setChildElement(m_partnerLinksElem, null, pl,
+							cur.getDOMElement());
+			} else {
+				setChildElement(m_partnerLinksElem, null, pl, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes a partner link from the grouping
+	 * construct.
+	 * 
+	 * @param pl The partner link to be removed
+	 * @return Whether the partner link was removed
+	 */
+	public boolean removePartnerLink(PartnerLink pl) {
+		boolean ret=m_partnerLinks.remove(pl);
+		
+		if (ret) {
+			m_partnerLinksElem.removeChild(pl.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method sets the name.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {		
+		getDOMElement().setAttribute(NAME, name);
+	}
+	
+	/**
+	 * This method returns the name.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(getDOMElement().hasAttribute(NAME)?
+				getDOMElement().getAttribute(NAME):null);
+	}
+
+	/**
+	 * This method sets the target namespace.
+	 * 
+	 * @param tns The target namespace
+	 */
+	public void setTargetNamespace(String tns) {		
+		getDOMElement().setAttribute(TARGET_NAMESPACE, tns);
+	}
+	
+	/**
+	 * This method returns the target namespace.
+	 * 
+	 * @return The target namespace
+	 */
+	public String getTargetNamespace() {
+		return(getDOMElement().hasAttribute(TARGET_NAMESPACE)?
+				getDOMElement().getAttribute(TARGET_NAMESPACE):null);
+	}
+
+	/**
+	 * This method sets the conversation type.
+	 * 
+	 * @param ctype The conversation type
+	 */
+	public void setConversationType(String ctype) {		
+		getDOMElement().setAttributeNS(CONVERSATION_NS, CONVERSATION_TYPE, ctype);
+	}
+	
+	/**
+	 * This method returns the conversation type.
+	 * 
+	 * @return The conversation type
+	 */
+	public String getConversationType() {
+		return(getDOMElement().hasAttributeNS(CONVERSATION_NS, CONVERSATION_TYPE)?
+				getDOMElement().getAttributeNS(CONVERSATION_NS, CONVERSATION_TYPE):null);
+	}
+
+	/**
+	 * This method returns the prefix associated with the
+	 * supplied namespace.
+	 * 
+	 * @param namespace The namespace
+	 * @return The prefix, or null if not found
+	 */
+	public String getPrefix(String namespace) {
+		String ret=null;
+		
+		org.w3c.dom.NamedNodeMap map=getDOMElement().getAttributes();
+		
+		for (int i=0; ret == null && i < map.getLength(); i++) {
+			org.w3c.dom.Node node=map.item(i);
+			
+			if (node instanceof org.w3c.dom.Attr) {
+				org.w3c.dom.Attr attr=(org.w3c.dom.Attr)node;
+				
+				if (attr.getNodeValue().equals(namespace) &&
+						attr.getNodeName().startsWith("xmlns:")) {
+					ret = attr.getNodeName().substring(6);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the namespace for the supplied prefix.
+	 * 
+	 * @param prefix The prefix
+	 * @return The namespace, or null if not found
+	 */
+	public String getNamespace(String prefix) {
+		String ret=null;
+		
+		org.w3c.dom.NamedNodeMap map=getDOMElement().getAttributes();
+		
+		for (int i=0; ret == null && i < map.getLength(); i++) {
+			org.w3c.dom.Node node=map.item(i);
+			
+			if (node instanceof org.w3c.dom.Attr) {
+				org.w3c.dom.Attr attr=(org.w3c.dom.Attr)node;
+				
+				if (attr.getNodeName().equals("xmlns:"+prefix) ||
+						attr.getNodeName().equals(prefix)) {
+					ret = attr.getNodeValue();
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method initialises the prefix associated with the supplied
+	 * namespace.
+	 * 
+	 * @param namespace
+	 * @param prefix
+	 */
+	public void initNamespace(String namespace, String prefix) {
+		getDOMElement().setAttribute("xmlns:"+prefix, namespace);
+	}
+	
+	/**
+	 * This method adds a new namespace and returns the
+	 * prefix allocated to it.
+	 * 
+	 * @param namespace The namespace to be added
+	 * @return The prefix
+	 */
+	public String addNamespace(String namespace) {
+		String ret=getPrefix(namespace);
+		int i=1;
+
+		while (ret == null) {
+			String prefix="ns"+(i++);
+			
+			if (getDOMElement().hasAttribute("xmlns:"+prefix) == false) {
+				ret = prefix;
+				
+				getDOMElement().setAttribute("xmlns:"+prefix, namespace);
+			}
+		}
+		
+		return(ret);
+	}
+		
+	/**
+	 * This method adds a variable to the scope.
+	 * 
+	 * @param var The variable to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addVariable(Variable var, int pos) {
+		
+		if (m_variablesElem == null) {
+			m_variablesElem = getDOMElement().getOwnerDocument().
+				createElementNS(BPEL_NS, "variables");
+			
+			// Add to parent
+			org.w3c.dom.Element insertBefore=
+					findChildElement("correlationSets");
+
+			if (insertBefore == null) {
+				insertBefore = findChildElement("faultHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("eventHandlers");
+			}
+			
+			if (insertBefore == null) {
+				BPELElement elem=findChildActivity();
+				
+				if (elem != null) {
+					insertBefore = elem.getDOMElement();
+				}
+			}
+			
+			if (insertBefore != null) {
+				getDOMElement().insertBefore(m_variablesElem, insertBefore);
+			} else {
+				getDOMElement().appendChild(m_variablesElem);
+			}
+		}
+		
+		if (pos == -1 || pos >= m_variables.size()) {
+			m_variables.add(var);
+			
+			setChildElement(m_variablesElem, null, var, null);
+		} else {
+			
+			Variable cur=m_variables.get(pos);
+			
+			m_variables.add(pos, var);
+			
+			if (cur != null) {
+				setChildElement(m_variablesElem, null, var,
+							cur.getDOMElement());
+			} else {
+				setChildElement(m_variablesElem, null, var, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an activity from the grouping
+	 * construct.
+	 * 
+	 * @param act The activity to be removed
+	 * @return Whether the activity was removed
+	 */
+	public boolean removeVariable(Variable var) {
+		boolean ret=m_variables.remove(var);
+		
+		if (ret) {
+			m_variablesElem.removeChild(var.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of variables.
+	 * 
+	 * @return The 
+	 */
+	public java.util.List<Variable> getVariables() {
+		return(m_variables);
+	}
+	
+	/**
+	 * This method returns the variable associated
+	 * with the supplied name.
+	 * 
+	 * @param name The name
+	 * @return The variable, or null if not found
+	 */
+	public Variable getVariable(String name) {
+		Variable ret=null;
+		
+		for (int i=0; ret == null && i < m_variables.size(); i++) {
+			if (m_variables.get(i).getName().equals(name)) {
+				ret = m_variables.get(i);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELActivity act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELActivity getActivity() {
+		return(m_activity);
+	}
+	
+	/**
+	 * This method sets the 'eventHandlers' path.
+	 * 
+	 * @param elem The 'eventHandlers' path
+	 */
+	public void setEventHandlers(EventHandlers elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_eventHandlers != null) {
+			existingElem = m_eventHandlers.getDOMElement();
+		}
+
+		m_eventHandlers = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'eventHandlers' path.
+	 * 
+	 * @return The 'eventHandlers' path
+	 */
+	public EventHandlers getEventHandlers() {
+		return(m_eventHandlers);
+	}
+	
+	/**
+	 * This method sets the 'faultHandlers' path.
+	 * 
+	 * @param elem The 'faultHandlers' path
+	 */
+	public void setFaultHandlers(FaultHandlers elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_faultHandlers != null) {
+			existingElem = m_faultHandlers.getDOMElement();
+		}
+
+		m_faultHandlers = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			insertBefore = findChildElement("eventHandlers");
+		}
+
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+				insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'faultHandlers' path.
+	 * 
+	 * @return The 'faultHandlers' path
+	 */
+	public FaultHandlers getFaultHandlers() {
+		return(m_faultHandlers);
+	}
+	
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	public void convert(java.util.List<Activity> activities,
+			ConversionContext context) {
+		
+		// Add variables to the context
+		for (int i=0; i < m_variables.size(); i++) {
+			context.addVariable(m_variables.get(i));
+		}
+		
+		// Count number of invoke activities
+		int invokeCount=InteractionUtil.countInvokes(getActivity().getDOMElement());
+		
+		// Check whether scope has been defined to represent
+		// an interaction with one or more fault responses and
+		// no event handlers
+		Invoke invoke=null;
+		
+		if (invokeCount == 1 &&
+				m_faultHandlers != null && (m_faultHandlers.getCatchPaths().size() > 0 ||
+				m_faultHandlers.getCatchAll() != null) &&
+				(m_eventHandlers == null || (m_eventHandlers.getOnEvents().size() == 0 &&
+						m_eventHandlers.getOnAlarms().size() == 0)) &&
+				(invoke = InteractionUtil.getInvoke(m_activity)) != null) {
+
+			invoke.convertRequest(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();
+			
+			invoke.convertResponse(cb.getBlock().getContents(), context);
+			
+			// Include remaining activities
+			if (m_activity instanceof Sequence) {
+				for (int i=1; i < ((Sequence)m_activity).getActivities().size(); i++) {
+					((Sequence)m_activity).getActivities().get(i).convert(cb.getBlock().getContents(), context);
+				}
+			}
+			
+			choice.getWhens().add(cb);
+			
+			// Process fault handlers
+			for (int i=0; i < m_faultHandlers.getCatchPaths().size(); i++) {
+				Catch catchBlock=m_faultHandlers.getCatchPaths().get(i);
+				
+				When fcb=new When();
+				
+				String mesgType=catchBlock.getFaultMessageType();
+				
+				if (mesgType == null) {
+					mesgType = catchBlock.getFaultMessageElement();
+				}
+				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
+				invoke.convertFaultResponse(fcb.getBlock().getContents(), catchBlock.getFaultVariable(),
+									mesgType, context);
+				
+				if (catchBlock.getActivity() != null) {
+					catchBlock.getActivity().convert(fcb.getBlock().getContents(), context);
+				}
+				
+				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 (getFaultHandlers() != null &&
+					(getFaultHandlers().getCatchPaths().size() > 0 ||
+							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 < getFaultHandlers().getCatchPaths().size(); i++) {
+					Catch catchPath=getFaultHandlers().getCatchPaths().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);
+					*/
+					
+					Variable faultVar=null;
+					
+					if (catchPath.getFaultVariable() != null) {
+						faultVar = new Variable(getModel());
+						faultVar.setName(catchPath.getFaultVariable());
+						faultVar.setMessageType(catchPath.getFaultMessageType());
+						faultVar.setElement(catchPath.getFaultMessageElement());			
+						context.addVariable(faultVar);
+					}
+					
+					if (catchPath.getActivity() != null) {
+						catchPath.getActivity().convert(cb.getBlock().getContents(), context);
+					}
+					
+					if (faultVar != null) {
+						context.removeVariable(faultVar);
+					}
+
+					te.getCatches().add(cb);
+				}
+			}
+			
+			// Convert normal activities in scope
+			if (getActivity() != null) {
+				getActivity().convert(acts, context);
+			}
+		}
+	}
+
+	/**
+	 * This method returns the conversion associated with the
+	 * BPEL process.
+	 * 
+	 * @param envContext The environment context
+	 * @return The conversation
+	 */
+	public Protocol convert(Context envContext) {
+		Protocol ret=new Protocol();
+		
+		ret.derivedFrom(this);
+		ret.getBlock().derivedFrom(this);
+		
+		// Configure model name
+		ret.setName(getName());
+				
+		// Define implements reference for conversation type
+		//String convType=getConversationType();
+		String role=null;
+		
+		/*
+		if (convType != null) {
+			int index=convType.indexOf('@');
+		
+			if (index != -1) {
+				// TODO: Need to think whether this should be
+				// 'implements' reference. If so, then need to change
+				// Java Lang Model parser and also Lang Model conformance
+				// rule.
+				ImplementsReference iref=
+					new ImplementsReference(ConversationNotation.NOTATION_CODE);
+			
+				role = convType.substring(index+1);
+				
+				iref.setLocatedRole(role);
+				
+				// Need to locate the model name
+				modelName.setRole(new Role(iref.getLocatedRole()));
+				
+				String mainpart=convType.substring(0, index);
+				
+				index = mainpart.lastIndexOf(".");
+				
+				if (index == -1) {
+					iref.setNamespace("");
+					iref.setLocalpart(mainpart);
+				} else {
+					iref.setNamespace(mainpart.substring(0, index));								
+					iref.setLocalpart(mainpart.substring(index+1));
+				}
+
+				ret.getImplements().add(iref);
+
+			} else {
+				logger.warn("Conversation type does not " +
+						"contain '@' located role separator");
+			}
+		}
+		*/
+
+		// Convert the process contents
+		DefaultConversionContext context=new DefaultConversionContext(role, this, envContext);
+		
+		// Add variables to the context
+		for (int i=0; i < m_variables.size(); i++) {
+			context.addVariable(m_variables.get(i));
+		}
+		
+		convert(ret.getBlock().getContents(), context);
+		
+		return(ret);
+	}
+
+	protected String getParentURI(BPELElement elem) {
+		String ret="//";
+		
+		if (elem instanceof BPELActivity) {
+			ret += "@activity";
+		} else if (elem instanceof FaultHandlers) {
+			ret += "@faultHandlers";
+		} else if (elem instanceof EventHandlers) {
+			ret += "@eventHandlers";
+		}
+		
+		return(ret);
+	}
+	
+	private static Log logger = LogFactory.getLog(Process.class);
+
+	private org.w3c.dom.Element m_partnerLinksElem=null;
+	//private org.w3c.dom.Element m_messageExchangesElem=null;
+	private org.w3c.dom.Element m_variablesElem=null;
+	//private org.w3c.dom.Element m_correlationSetsElem=null;
+	private java.util.List<Import> m_imports=new java.util.Vector<Import>();
+	private java.util.List<PartnerLink> m_partnerLinks=new java.util.Vector<PartnerLink>();
+	private java.util.List<Variable> m_variables=new java.util.Vector<Variable>();
+	private EventHandlers m_eventHandlers=null;
+	private FaultHandlers m_faultHandlers=null;
+	private BPELActivity m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Receive.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Receive.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Receive.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,170 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.util.TypeReferenceUtil;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *  
+ * @author gary
+ */
+public class Receive extends AbstractInteraction {
+
+	private static final String CREATE_INSTANCE = "createInstance";
+	private static final String VARIABLE = "variable";
+
+	public static final String RECEIVE = "receive";
+	
+	private static final long serialVersionUID = -3041725198724191842L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Receive(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Receive(BPELLanguageModel model) {
+		super(model, RECEIVE);
+	}
+
+	/**
+	 * This method sets the variable.
+	 * 
+	 * @param var The variable
+	 */
+	public void setVariable(String var) {		
+		getDOMElement().setAttribute(VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the variable.
+	 * 
+	 * @return The variable
+	 */
+	public String getVariable() {
+		return(getDOMElement().hasAttribute(VARIABLE)?
+				getDOMElement().getAttribute(VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the 'create instance'
+	 * attribute.
+	 * 
+	 * @param b Whether to create instance
+	 */
+	public void setCreateInstance(boolean b) {
+		String create=(b?"yes":"no");
+		
+		getDOMElement().setAttribute(CREATE_INSTANCE, create);
+	}
+	
+	/**
+	 * This method returns whether to create instance.
+	 * 
+	 * @return Whether to create instance
+	 */
+	public boolean getCreateInstance() {
+		boolean ret=false;
+		String create=
+			getDOMElement().getAttribute(CREATE_INSTANCE);
+
+		if (create != null &&
+				create.equals("yes")) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(Journal l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+									ConversionContext context) {
+		//getSource().setComponentURI(getURI());
+		
+		Interaction interaction=new Interaction();
+		interaction.derivedFrom(this);
+		
+		Variable var=context.getVariable(getVariable());
+		
+		String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+								context.getEnvironmentContext());
+		
+		TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+		
+		MessageSignature ms=new MessageSignature();
+		ms.derivedFrom(this);
+		
+		ms.setOperation(getOperation());
+		ms.getTypeReferences().add(tref);
+		
+		String fromRole=getServerPartnerRole();
+		
+		if (fromRole != null && fromRole.equals(context.getRole())) {
+			fromRole = getClientPartnerRole();
+		}
+		
+		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);
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/RepeatUntil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/RepeatUntil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/RepeatUntil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,160 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a RepeatUntil grouping activity.
+ *  
+ * @author gary
+ */
+public class RepeatUntil extends BPELGroupingConstruct {
+	
+	private static final long serialVersionUID = -4479515591509703188L;
+
+	public static final String REPEATUNTIL = "repeatUntil";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public RepeatUntil(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	
+		m_activity = findChildActivity();
+
+		org.w3c.dom.Element cond=
+			findChildElement(Condition.CONDITION);
+
+		if (cond == null) {
+			m_condition = new Condition(model);
+		} else {
+			m_condition = new Condition(model, cond);
+		}	
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public RepeatUntil(BPELLanguageModel model) {
+		super(model, REPEATUNTIL);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+	}
+
+	/**
+	 * This method sets the condition.
+	 * 
+	 * @param cond The condition
+	 */
+	public void setCondition(Condition cond) {
+		m_condition = cond;
+		
+		setChildElement(findChildElement(Condition.CONDITION),
+				cond, null);
+	}
+	
+	/**
+	 * This method returns the condition.
+	 * 
+	 * @return The condition
+	 */
+	public Condition getCondition() {
+		return(m_condition);
+	}
+
+	/**
+	 * This method sets the main 'if' activity.
+	 * 
+	 * @param act The activity associated with the 'if'
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_condition != null) {
+			insertBefore = m_condition.getDOMElement();
+		}
+		
+		setChildElement(existingElem, act,
+				insertBefore);
+	}
+
+	/**
+	 * This method returns the activity associated with
+	 * the 'if' path.
+	 * 
+	 * @return The 'if' activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private Condition m_condition=null;
+	private BPELElement m_activity=null;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Reply.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Reply.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Reply.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,155 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.util.TypeReferenceUtil;
+import org.scribble.conversation.model.ConversationInteraction;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a BPEL reply activity.
+ *  
+ * @author gary
+ */
+public class Reply extends AbstractInteraction {
+
+	private static final String VARIABLE = "variable";
+	private static final String FAULT_NAME = "faultName";
+
+	public static final String REPLY = "reply";
+	
+	private static final long serialVersionUID = 8582738107125170604L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Reply(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Reply(BPELLanguageModel model) {
+		super(model, REPLY);
+	}
+
+	/**
+	 * This method sets the variable.
+	 * 
+	 * @param var The variable
+	 */
+	public void setVariable(String var) {		
+		getDOMElement().setAttribute(VARIABLE, var);
+	}
+	
+	/**
+	 * This method returns the variable.
+	 * 
+	 * @return The variable
+	 */
+	public String getVariable() {
+		return(getDOMElement().hasAttribute(VARIABLE)?
+				getDOMElement().getAttribute(VARIABLE):null);
+	}
+
+	/**
+	 * This method sets the fault name.
+	 * 
+	 * @param fname The fault name
+	 */
+	public void setFaultName(String fname) {		
+		getDOMElement().setAttribute(FAULT_NAME, fname);
+	}
+	
+	/**
+	 * This method returns the fault name.
+	 * 
+	 * @return The fault name
+	 */
+	public String getFaultName() {
+		return(getDOMElement().hasAttribute(FAULT_NAME)?
+				getDOMElement().getAttribute(FAULT_NAME):null);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+
+		ConversationInteraction interaction=new ConversationInteraction();
+		interaction.derivedFrom(this);
+		
+		Variable var=context.getVariable(getVariable());
+		
+		String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+				context.getEnvironmentContext());
+
+		TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
+		
+		MessageSignature ms=new MessageSignature();
+		ms.derivedFrom(this);
+
+		ms.setOperation(getOperation());
+		ms.getTypes().add(tref);
+		
+		if (context.getRole() != null) {
+			interaction.setFromRole(new Role(context.getRole()));
+		}
+		
+		String toRole=getServerPartnerRole();
+		
+		if (toRole != null) {
+			interaction.setToRole(new Role(toRole));
+		}
+		
+		interaction.setMessageSignature(ms);
+		
+		activities.add(interaction);
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Rethrow.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Rethrow.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Rethrow.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,82 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the rethrow activity.
+ *  
+ * @author gary
+ */
+public class Rethrow extends BPELActivity {
+
+	private static final long serialVersionUID = 9187657888490480490L;
+
+	public static final String RETHROW = "rethrow";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Rethrow(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Rethrow(BPELLanguageModel model) {
+		super(model, RETHROW);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Scope.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Scope.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Scope.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,690 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.util.InteractionUtil;
+import org.savara.util.XMLUtils;
+import org.scribble.conversation.model.ConditionalBlock;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a scope grouping activity.
+ *  
+ * @author gary
+ */
+public class Scope extends BPELActivity implements ScopeActivity {
+
+	private static final long serialVersionUID = 7132062003047468101L;
+
+	public static final String SCOPE = "scope";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Scope(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_partnerLinksElem = findChildElement("partnerLinks");
+		
+		if (m_partnerLinksElem != null) {
+			java.util.List<BPELElement> elems=
+					findChildElements(m_partnerLinksElem,
+							PartnerLink.class);
+
+			for (int i=0; i < elems.size(); i++) {
+				m_partnerLinks.add((PartnerLink)elems.get(i));
+			}
+		}
+		
+		m_variablesElem = findChildElement("variables");
+
+		if (m_variablesElem != null) {
+			java.util.List<BPELElement> elems=
+					findChildElements(m_variablesElem,
+							Variable.class);
+
+			for (int i=0; i < elems.size(); i++) {
+				m_variables.add((Variable)elems.get(i));
+			}
+		}
+		
+		m_messageExchangesElem = findChildElement("messageExchanges");
+		m_correlationSetsElem = findChildElement("correlationSets");
+		
+		org.w3c.dom.Element ehs=findChildElement(EventHandlers.EVENTHANDLERS);
+		if (ehs != null) {
+			m_eventHandlers = new EventHandlers(model, ehs);
+		}
+		
+		org.w3c.dom.Element fhs=findChildElement(FaultHandlers.FAULTHANDLERS);
+		if (fhs != null) {
+			m_faultHandlers = new FaultHandlers(model, fhs);
+		}
+		
+		org.w3c.dom.Element ch=findChildElement(CompensationHandler.COMPENSATIONHANDLER);
+		if (ch != null) {
+			m_compensationHandler = new CompensationHandler(model, ch);
+		}
+		
+		org.w3c.dom.Element th=findChildElement(TerminationHandler.TERMINATIONHANDLER);
+		if (th != null) {
+			m_terminationHandler = new TerminationHandler(model, th);
+		}
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Scope(BPELLanguageModel model) {
+		super(model, SCOPE);
+	}
+
+	/**
+	 * This method adds a variable to the scope.
+	 * 
+	 * @param var The variable to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addVariable(Variable var, int pos) {
+		
+		if (m_variablesElem == null) {
+			m_variablesElem = getDOMElement().getOwnerDocument().
+				createElementNS(BPEL_NS, "variables");
+			
+			// Add to parent
+			org.w3c.dom.Element insertBefore=
+					findChildElement("partnerLinks");
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("messageExchanges");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("correlationSets");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("eventHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("faultHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("compensationHandler");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("terminationHandler");
+			}
+			
+			if (insertBefore == null) {
+				BPELElement elem=findChildActivity();
+				
+				if (elem != null) {
+					insertBefore = elem.getDOMElement();
+				}
+			}
+			
+			if (insertBefore != null) {
+				getDOMElement().insertBefore(m_variablesElem, insertBefore);
+			} else {
+				getDOMElement().appendChild(m_variablesElem);
+			}
+		}
+		
+		if (pos == -1 || pos >= m_variables.size()) {
+			m_variables.add(var);
+			
+			setChildElement(m_variablesElem, null, var, null);
+		} else {
+			
+			Variable cur=m_variables.get(pos);
+			
+			m_variables.add(pos, var);
+			
+			if (cur != null) {
+				setChildElement(m_variablesElem, null, var,
+							cur.getDOMElement());
+			} else {
+				setChildElement(m_variablesElem, null, var, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an activity from the grouping
+	 * construct.
+	 * 
+	 * @param act The activity to be removed
+	 * @return Whether the activity was removed
+	 */
+	public boolean removeVariable(Variable var) {
+		boolean ret=m_variables.remove(var);
+		
+		if (ret) {
+			m_variablesElem.removeChild(var.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of variables.
+	 * 
+	 * @return The 
+	 */
+	public java.util.List<Variable> getVariables() {
+		return(m_variables);
+	}
+	
+	/**
+	 * This method adds a partner link to the scope.
+	 * 
+	 * @param pl The partner link to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addPartnerLink(PartnerLink pl, int pos) {
+		
+		if (m_partnerLinksElem == null) {
+			m_partnerLinksElem = getDOMElement().getOwnerDocument().
+				createElementNS(BPEL_NS, "partnerLinks");
+			
+			// Add to parent
+			org.w3c.dom.Element insertBefore=
+					findChildElement("messageExchanges");
+
+			if (insertBefore == null) {
+				insertBefore = findChildElement("correlationSets");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("eventHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("faultHandlers");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("compensationHandler");
+			}
+			
+			if (insertBefore == null) {
+				insertBefore = findChildElement("terminationHandler");
+			}
+			
+			if (insertBefore == null) {
+				BPELElement elem=findChildActivity();
+				
+				if (elem != null) {
+					insertBefore = elem.getDOMElement();
+				}
+			}
+			
+			if (insertBefore != null) {
+				getDOMElement().insertBefore(m_partnerLinksElem, insertBefore);
+			} else {
+				getDOMElement().appendChild(m_partnerLinksElem);
+			}
+		}
+		
+		if (pos == -1 || pos >= m_partnerLinks.size()) {
+			m_partnerLinks.add(pl);
+			
+			setChildElement(m_partnerLinksElem, null, pl, null);
+		} else {
+			
+			PartnerLink cur=m_partnerLinks.get(pos);
+			
+			m_partnerLinks.add(pos, pl);
+			
+			if (cur != null) {
+				setChildElement(m_partnerLinksElem, null, pl,
+							cur.getDOMElement());
+			} else {
+				setChildElement(m_partnerLinksElem, null, pl, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes a partner link from the grouping
+	 * construct.
+	 * 
+	 * @param pl The partner link to be removed
+	 * @return Whether the partner link was removed
+	 */
+	public boolean removePartnerLink(PartnerLink pl) {
+		boolean ret=m_partnerLinks.remove(pl);
+		
+		if (ret) {
+			m_partnerLinksElem.removeChild(pl.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of partner links.
+	 * 
+	 * @return The partner links
+	 */
+	public java.util.List<PartnerLink> getPartnerLinks() {
+		return(m_partnerLinks);
+	}
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELActivity act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELActivity getActivity() {
+		return(m_activity);
+	}
+	
+	/**
+	 * This method sets the 'eventHandlers' path.
+	 * 
+	 * @param elem The 'eventHandlers' path
+	 */
+	public void setEventHandlers(EventHandlers elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_eventHandlers != null) {
+			existingElem = m_eventHandlers.getDOMElement();
+		}
+
+		m_eventHandlers = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			insertBefore = findChildElement("faultHandlers");
+		}
+
+		if (insertBefore == null) {
+			insertBefore = findChildElement("compensationHandler");
+		}
+
+		if (insertBefore == null) {
+			insertBefore = findChildElement("terminationHandler");
+		}
+		
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'eventHandlers' path.
+	 * 
+	 * @return The 'eventHandlers' path
+	 */
+	public EventHandlers getEventHandlers() {
+		return(m_eventHandlers);
+	}
+	
+	/**
+	 * This method sets the 'faultHandlers' path.
+	 * 
+	 * @param elem The 'faultHandlers' path
+	 */
+	public void setFaultHandlers(FaultHandlers elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_faultHandlers != null) {
+			existingElem = m_faultHandlers.getDOMElement();
+		}
+
+		m_faultHandlers = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			insertBefore = findChildElement("compensationHandler");
+		}
+
+		if (insertBefore == null) {
+			insertBefore = findChildElement("terminationHandler");
+		}
+		
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+				insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'faultHandlers' path.
+	 * 
+	 * @return The 'faultHandlers' path
+	 */
+	public FaultHandlers getFaultHandlers() {
+		return(m_faultHandlers);
+	}
+	
+	/**
+	 * This method sets the 'compensationHandler' path.
+	 * 
+	 * @param elem The 'compensationHandler' path
+	 */
+	public void setCompensationHandler(CompensationHandler elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_compensationHandler != null) {
+			existingElem = m_compensationHandler.getDOMElement();
+		}
+
+		m_compensationHandler = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			insertBefore = findChildElement("terminationHandler");
+		}
+		
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+				insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'compensationHandler' path.
+	 * 
+	 * @return The 'compensationHandler' path
+	 */
+	public CompensationHandler getCompensationHandler() {
+		return(m_compensationHandler);
+	}
+	
+	/**
+	 * This method sets the 'terminationHandler' path.
+	 * 
+	 * @param elem The 'terminationHandler' path
+	 */
+	public void setTerminationHandler(TerminationHandler elem) {
+		org.w3c.dom.Element existingElem=null;
+		
+		if (m_terminationHandler != null) {
+			existingElem = m_terminationHandler.getDOMElement();
+		}
+
+		m_terminationHandler = elem;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (insertBefore == null) {
+			BPELElement act=findChildActivity();
+			
+			if (elem != null) {
+				insertBefore = act.getDOMElement();
+			}
+		}
+
+		setChildElement(existingElem, elem,
+				insertBefore);
+	}
+	
+	/**
+	 * This method returns the 'terminationHandler' path.
+	 * 
+	 * @return The 'terminationHandler' path
+	 */
+	public TerminationHandler getTerminationHandler() {
+		return(m_terminationHandler);
+	}
+	
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+		
+		// Add variables to the context
+		for (int i=0; i < m_variables.size(); i++) {
+			context.addVariable(m_variables.get(i));
+		}
+		
+		// Count number of invoke activities
+		int invokeCount=InteractionUtil.countInvokes(getActivity().getDOMElement());
+		
+		// Check whether scope has been defined to represent
+		// an interaction with one or more fault responses and
+		// no event handlers
+		Invoke invoke=null;
+		
+		if (invokeCount == 1 &&
+				m_faultHandlers != null && (m_faultHandlers.getCatchPaths().size() > 0 ||
+				m_faultHandlers.getCatchAll() != null) &&
+				(m_eventHandlers == null || (m_eventHandlers.getOnEvents().size() == 0 &&
+						m_eventHandlers.getOnAlarms().size() == 0)) &&
+				(invoke = InteractionUtil.getInvoke(m_activity)) != null) {
+
+			invoke.convertRequest(activities, context);
+			
+			// Create choice with normal response and fault paths
+			org.scribble.conversation.model.If choice=new org.scribble.conversation.model.If();
+			
+			ConditionalBlock cb=new ConditionalBlock();
+			
+			invoke.convertResponse(cb.getContents(), context);
+			
+			// Include remaining activities
+			if (m_activity instanceof Sequence) {
+				for (int i=1; i < ((Sequence)m_activity).getActivities().size(); i++) {
+					((Sequence)m_activity).getActivities().get(i).convert(cb.getContents(), context);
+				}
+			}
+			
+			choice.getConditionalBlocks().add(cb);
+			
+			// Process fault handlers
+			for (int i=0; i < m_faultHandlers.getCatchPaths().size(); i++) {
+				Catch catchBlock=m_faultHandlers.getCatchPaths().get(i);
+				
+				ConditionalBlock fcb=new ConditionalBlock();
+				
+				String mesgType=catchBlock.getFaultMessageType();
+				
+				if (mesgType == null) {
+					mesgType = catchBlock.getFaultMessageElement();
+				}
+				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
+				invoke.convertFaultResponse(fcb.getContents(), catchBlock.getFaultVariable(),
+									mesgType, context);
+				
+				if (catchBlock.getActivity() != null) {
+					catchBlock.getActivity().convert(fcb.getContents(), context);
+				}
+				
+				choice.getConditionalBlocks().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 (getFaultHandlers() != null &&
+					(getFaultHandlers().getCatchPaths().size() > 0 ||
+							getFaultHandlers().getCatchAll() != null)) {
+				org.scribble.conversation.model.TryEscape te=
+						new org.scribble.conversation.model.TryEscape();
+				te.derivedFrom(this);
+				te.getBlock().derivedFrom(this);
+				
+				acts.add(te);
+				
+				acts = te.getBlock().getContents();
+		
+				for (int i=0; i < getFaultHandlers().getCatchPaths().size(); i++) {
+					Catch catchPath=getFaultHandlers().getCatchPaths().get(i);
+					
+					org.scribble.conversation.model.CatchBlock cb=
+						new org.scribble.conversation.model.CatchBlock();
+					cb.derivedFrom(catchPath);
+					
+					TypeReference tref=new TypeReference();
+					tref.setLocalpart(XMLUtils.getLocalname(catchPath.getFaultName()));
+					cb.setType(tref);
+					
+					Variable faultVar=null;
+					
+					if (catchPath.getFaultVariable() != null) {
+						faultVar = new Variable(getModel());
+						faultVar.setName(catchPath.getFaultVariable());
+						faultVar.setMessageType(catchPath.getFaultMessageType());
+						faultVar.setElement(catchPath.getFaultMessageElement());			
+						context.addVariable(faultVar);
+					}
+					
+					if (catchPath.getActivity() != null) {
+						catchPath.getActivity().convert(cb.getContents(), context);
+					}
+					
+					if (faultVar != null) {
+						context.removeVariable(faultVar);
+					}
+
+					te.getEscapeBlocks().add(cb);
+				}
+			}
+			
+			// Convert normal activities in scope
+			if (getActivity() != null) {
+				getActivity().convert(acts, context);
+			}
+		}
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret += "@activity";
+		} else if (elem instanceof FaultHandlers) {
+			ret += "@faultHandlers";
+		} else if (elem instanceof EventHandlers) {
+			ret += "@eventHandlers";
+		}
+		
+		return(ret);
+	}
+	
+	private org.w3c.dom.Element m_partnerLinksElem=null;
+	private org.w3c.dom.Element m_variablesElem=null;
+	private org.w3c.dom.Element m_messageExchangesElem=null;
+	private org.w3c.dom.Element m_correlationSetsElem=null;
+	private java.util.List<PartnerLink> m_partnerLinks=new java.util.Vector<PartnerLink>();
+	private java.util.List<Variable> m_variables=new java.util.Vector<Variable>();
+	private EventHandlers m_eventHandlers=null;
+	private FaultHandlers m_faultHandlers=null;
+	private CompensationHandler m_compensationHandler=null;
+	private TerminationHandler m_terminationHandler=null;
+	private BPELActivity m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ScopeActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ScopeActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/ScopeActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,129 @@
+/*
+ * 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.model.component;
+
+import org.scribble.common.logging.Journal;
+
+/**
+ * This interface represents a scope activity.
+ *  
+ * @author gary
+ */
+public interface ScopeActivity {
+
+	/**
+	 * This method adds a variable to the scope.
+	 * 
+	 * @param var The variable to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addVariable(Variable var, int pos);
+	
+	/**
+	 * This method removes an activity from the grouping
+	 * construct.
+	 * 
+	 * @param act The activity to be removed
+	 * @return Whether the activity was removed
+	 */
+	public boolean removeVariable(Variable var);
+	
+	/**
+	 * This method returns the list of variables.
+	 * 
+	 * @return The 
+	 */
+	public java.util.List<Variable> getVariables();
+	
+	/**
+	 * This method adds a partner link to the scope.
+	 * 
+	 * @param pl The partner link to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addPartnerLink(PartnerLink pl, int pos);
+	
+	/**
+	 * This method removes a partner link from the grouping
+	 * construct.
+	 * 
+	 * @param pl The partner link to be removed
+	 * @return Whether the partner link was removed
+	 */
+	public boolean removePartnerLink(PartnerLink pl);
+	
+	/**
+	 * This method returns the list of partner links.
+	 * 
+	 * @return The partner links
+	 */
+	public java.util.List<PartnerLink> getPartnerLinks() ;
+	
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELActivity act) ;
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELActivity getActivity() ;
+	
+	/**
+	 * This method sets the 'eventHandlers' path.
+	 * 
+	 * @param elem The 'eventHandlers' path
+	 */
+	public void setEventHandlers(EventHandlers elem);
+	
+	/**
+	 * This method returns the 'eventHandlers' path.
+	 * 
+	 * @return The 'eventHandlers' path
+	 */
+	public EventHandlers getEventHandlers();
+	
+	/**
+	 * This method sets the 'faultHandlers' path.
+	 * 
+	 * @param elem The 'faultHandlers' path
+	 */
+	public void setFaultHandlers(FaultHandlers elem);
+	
+	/**
+	 * This method returns the 'faultHandlers' path.
+	 * 
+	 * @return The 'faultHandlers' path
+	 */
+	public FaultHandlers getFaultHandlers();
+	
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	public void validate(ModelListener l);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Sequence.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Sequence.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Sequence.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,155 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a sequence grouping activity.
+ *  
+ * @author gary
+ */
+public class Sequence extends BPELActivity {
+
+	public static final String SEQUENCE = "sequence";
+	
+	private static final long serialVersionUID = 6656299352423612770L;
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Sequence(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		java.util.List<BPELElement> acts=
+					findChildElements(BPELActivity.class);
+		
+		for (int i=0; i < acts.size(); i++) {
+			if (acts.get(i).isActivity() &&
+					acts.get(i) instanceof BPELActivity) {
+				m_activities.add((BPELActivity)acts.get(i));
+			}
+		}
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Sequence(BPELLanguageModel model) {
+		super(model, SEQUENCE);
+	}
+
+	/**
+	 * This method adds an activity to the grouping construct.
+	 * 
+	 * @param act The activity to be added
+	 * @param pos The position to add, or -1 if at the end
+	 */
+	public void addActivity(BPELActivity act, int pos) {
+		if (pos == -1 || pos >= m_activities.size()) {
+			m_activities.add(act);
+			
+			setChildElement(null, act, null);
+		} else {
+			
+			BPELActivity cur=m_activities.get(pos);
+			
+			m_activities.add(pos, act);
+			
+			if (cur != null) {
+				setChildElement(null, act,
+							cur.getDOMElement());
+			} else {
+				setChildElement(null, act, null);
+			}
+		}
+	}
+	
+	/**
+	 * This method removes an activity from the grouping
+	 * construct.
+	 * 
+	 * @param act The activity to be removed
+	 * @return Whether the activity was removed
+	 */
+	public boolean removeActivity(BPELActivity act) {
+		boolean ret=m_activities.remove(act);
+		
+		if (ret) {
+			getDOMElement().removeChild(act.getDOMElement());
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of activities associated
+	 * with the grouping construct.
+	 * 
+	 * @return The list of activities
+	 */
+	public java.util.List<BPELActivity> getActivities() {
+		return(m_activities);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+		
+		for (int i=0; i < m_activities.size(); i++) {
+			m_activities.get(i).convert(activities, context);
+		}
+	}
+
+	protected String getLocalURIPart(BPELElement elem) {
+		int pos=getActivities().indexOf(elem);
+		return("@activities."+pos);
+	}
+	
+	private java.util.List<BPELActivity> m_activities=
+					new java.util.Vector<BPELActivity>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Source.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Source.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Source.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the BPEL source element, contained within
+ * any BPEL activity.
+ */
+public class Source extends BPELElement {
+
+	private static final long serialVersionUID = 4878669992635772776L;
+
+	private static final String LINK_NAME = "linkName";
+
+	public static final String SOURCE="source";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public Source(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Source(BPELLanguageModel model) {
+		super(model, SOURCE);
+	}
+
+	/**
+	 * This method returns the name associated
+	 * with the link.
+	 * 
+	 * @return The link name
+	 */
+	public String getLinkName() {
+		return(getDOMElement().getAttribute(LINK_NAME));
+	}
+	
+	/**
+	 * This method sets the link name.
+	 * 
+	 * @param name The name
+	 */
+	public void setLinkName(String name) {
+		getDOMElement().setAttribute(LINK_NAME, name);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Target.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Target.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Target.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the BPEL target element, contained within
+ * any BPEL activity.
+ */
+public class Target extends BPELElement {
+
+	private static final long serialVersionUID = -8813636777020840433L;
+
+	private static final String LINK_NAME = "linkName";
+
+	public static final String TARGET="target";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public Target(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Target(BPELLanguageModel model) {
+		super(model, TARGET);
+	}
+
+	/**
+	 * This method returns the name associated
+	 * with the link.
+	 * 
+	 * @return The link name
+	 */
+	public String getLinkName() {
+		return(getDOMElement().getAttribute(LINK_NAME));
+	}
+	
+	/**
+	 * This method sets the link name.
+	 * 
+	 * @param name The name
+	 */
+	public void setLinkName(String name) {
+		getDOMElement().setAttribute(LINK_NAME, name);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/TerminationHandler.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/TerminationHandler.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/TerminationHandler.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,96 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.scribble.protocol.model.Activity;
+
+/**
+ * This class represents the 'terminationHandler' construct contained
+ * within the 'scope' activity.
+ */
+public class TerminationHandler extends BPELElement {
+
+	private static final long serialVersionUID = 7316551859410369824L;
+
+	public static final String TERMINATIONHANDLER="terminationHandler";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the element
+	 */
+	public TerminationHandler(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+		
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public TerminationHandler(BPELLanguageModel model) {
+		super(model, TERMINATIONHANDLER);
+	}
+
+	/**
+	 * This method sets the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @param act The activity
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+	
+	/**
+	 * This method returns the activity associated with
+	 * the 'else' construct.
+	 * 
+	 * @return The activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	private BPELElement m_activity;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Throw.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Throw.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Throw.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,123 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the throw activity.
+ *  
+ * @author gary
+ */
+public class Throw extends BPELActivity {
+
+	private static final long serialVersionUID = 9187657888490480490L;
+
+	public static final String THROW = "throw";
+	
+	private static final String FAULT_NAME = "faultName";
+	private static final String FAULT_VARIABLE = "faultVariable";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Throw(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Throw(BPELLanguageModel model) {
+		super(model, THROW);
+	}
+
+	/**
+	 * This method sets the fault name.
+	 * 
+	 * @param faultName The fault name
+	 */
+	public void setFaultName(String faultName) {		
+		getDOMElement().setAttribute(FAULT_NAME, faultName);
+	}
+	
+	/**
+	 * This method returns the fault name.
+	 * 
+	 * @return The fault name
+	 */
+	public String getFaultName() {
+		return(getDOMElement().hasAttribute(FAULT_NAME)?
+				getDOMElement().getAttribute(FAULT_NAME):null);
+	}
+
+	/**
+	 * This method sets the fault variable.
+	 * 
+	 * @param faultVariable The fault variable
+	 */
+	public void setFaultVariable(String faultVariable) {		
+		getDOMElement().setAttribute(FAULT_VARIABLE, faultVariable);
+	}
+	
+	/**
+	 * This method returns the fault variable.
+	 * 
+	 * @return The fault variable
+	 */
+	public String getFaultVariable() {
+		return(getDOMElement().hasAttribute(FAULT_VARIABLE)?
+				getDOMElement().getAttribute(FAULT_VARIABLE):null);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Until.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Until.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Until.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,50 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+
+/**
+ * This class represents the BPEL 'until' element.
+ */
+public class Until extends AbstractCondition {
+
+	private static final long serialVersionUID = 5398291987513467996L;
+
+	public static final String UNTIL="until";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param elem The XML configuration details for the element
+	 */
+	public Until(BPELLanguageModel model,
+					org.w3c.dom.Element elem) {
+		super(model, elem);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Until(BPELLanguageModel model) {
+		super(model, UNTIL);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Variable.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Variable.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Variable.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,159 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the variable.
+ *  
+ * @author gary
+ */
+public class Variable extends BPELElement {
+
+	private static final long serialVersionUID = -3824104482191549444L;
+
+	public static final String VARIABLE = "variable";
+	
+	private static final String NAME = "name";
+	private static final String TYPE = "type";
+	private static final String ELEMENT = "element";
+	private static final String MESSAGE_TYPE = "messageType";
+	
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 * @param element The XML configuration details for the element
+	 */
+	public Variable(BPELLanguageModel  model,
+					org.w3c.dom.Element element) {
+		super(model, element);
+	}
+
+	/**
+	 * The constructor for the element.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Variable(BPELLanguageModel model) {
+		super(model, VARIABLE);
+	}
+
+	/**
+	 * This method sets the name.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {		
+		getDOMElement().setAttribute(NAME, name);
+	}
+	
+	/**
+	 * This method returns the name.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(getDOMElement().hasAttribute(NAME)?
+				getDOMElement().getAttribute(NAME):null);
+	}
+
+	/**
+	 * This method sets the variable type.
+	 * 
+	 * @param type The type
+	 */
+	public void setType(String type) {		
+		getDOMElement().setAttribute(TYPE, type);
+	}
+	
+	/**
+	 * This method returns the variable type.
+	 * 
+	 * @return The type
+	 */
+	public String getType() {
+		return(getDOMElement().hasAttribute(TYPE)?
+				getDOMElement().getAttribute(TYPE):null);
+	}
+
+	/**
+	 * This method sets the variable element.
+	 * 
+	 * @param element The element
+	 */
+	public void setElement(String element) {		
+		getDOMElement().setAttribute(ELEMENT, element);
+	}
+	
+	/**
+	 * This method returns the variable element.
+	 * 
+	 * @return The element
+	 */
+	public String getElement() {
+		return(getDOMElement().hasAttribute(ELEMENT)?
+				getDOMElement().getAttribute(ELEMENT):null);
+	}
+
+	/**
+	 * This method sets the variable message type.
+	 * 
+	 * @param type The message type
+	 */
+	public void setMessageType(String type) {		
+		getDOMElement().setAttribute(MESSAGE_TYPE, type);
+	}
+	
+	/**
+	 * This method returns the variable message type.
+	 * 
+	 * @return The message type
+	 */
+	public String getMessageType() {
+		return(getDOMElement().hasAttribute(MESSAGE_TYPE)?
+				getDOMElement().getAttribute(MESSAGE_TYPE):null);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method converts the BPEL activity into an equivalent
+	 * behavioural description for conformance checking.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	public void convert(java.util.List<Activity> activities,
+			ConversionContext context) {
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Wait.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Wait.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/Wait.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,148 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents the wait activity.
+ *  
+ * @author gary
+ */
+public class Wait extends BPELActivity {
+
+	private static final String FOR = "for";
+
+	private static final String UNTIL = "until";
+
+	private static final long serialVersionUID = -3934422332929710337L;
+
+	public static final String WAIT = "wait";
+	
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public Wait(BPELLanguageModel  model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public Wait(BPELLanguageModel model) {
+		super(model, WAIT);
+	}
+
+	/**
+	 * This method sets the 'until' condition.
+	 * 
+	 * @param cond The 'until' condition
+	 */
+	public void setUntil(Condition cond) {
+		setChildElement(findChildElement(UNTIL),
+				cond, null);
+		
+		org.w3c.dom.Element elem=findChildElement(FOR);
+		if (elem != null) {
+			getDOMElement().removeChild(elem);
+		}
+	}
+	
+	/**
+	 * This method returns the 'until' condition.
+	 * 
+	 * @return The 'until' condition
+	 */
+	public Condition getUntil() {
+		Condition ret=null;
+		
+		org.w3c.dom.Element elem=findChildElement(UNTIL);
+		if (elem != null) {
+			ret = new Condition(getModel(), elem);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method sets the 'for' condition.
+	 * 
+	 * @param cond The 'for' condition
+	 */
+	public void setFor(Condition cond) {
+		setChildElement(findChildElement(FOR),
+				cond, null);
+		
+		org.w3c.dom.Element elem=findChildElement(UNTIL);
+		if (elem != null) {
+			getDOMElement().removeChild(elem);
+		}
+	}
+	
+	/**
+	 * This method returns the 'for' condition.
+	 * 
+	 * @return The 'for' condition
+	 */
+	public Condition getFor() {
+		Condition ret=null;
+		
+		org.w3c.dom.Element elem=findChildElement(FOR);
+		if (elem != null) {
+			ret = new Condition(getModel(), elem);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+		// Don't validate unsupported actions
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/While.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/While.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/component/While.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,173 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.*;
+import org.scribble.protocol.model.*;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class represents a while grouping activity.
+ *  
+ * @author gary
+ */
+public class While extends BPELGroupingConstruct {
+
+	private static final long serialVersionUID = -4173984531470466407L;
+	
+	public static final String WHILE = "while";
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 * @param activity The XML configuration details for the activity
+	 */
+	public While(BPELLanguageModel model,
+					org.w3c.dom.Element activity) {
+		super(model, activity);
+	
+		org.w3c.dom.Element cond=
+			findChildElement(Condition.CONDITION);
+
+		if (cond == null) {
+			m_condition = new Condition(model);
+		} else {
+			m_condition = new Condition(model, cond);
+		}
+	
+		m_activity = findChildActivity();
+	}
+
+	/**
+	 * The constructor for the activity.
+	 * 
+	 * @param model The BPEL model
+	 */
+	public While(BPELLanguageModel model) {
+		super(model, WHILE);
+	}
+
+	/**
+	 * This method validates the BPEL activity and reports warnings or
+	 * errors to the supplied model listener.
+	 * 
+	 * @param l The model listener
+	 */
+	@Override
+	public void validate(ModelListener l) {
+	}
+	
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		getSource().setComponentURI(getURI());
+		
+		org.scribble.conversation.model.While elem=
+					new org.scribble.conversation.model.While();
+		
+		// TODO: Convert while expression
+		
+		if (getActivity() != null) {
+			getActivity().convert(elem.getBlock().getContents(), context);
+		}
+		
+		activities.add(elem);
+	}
+
+	/**
+	 * This method sets the condition.
+	 * 
+	 * @param cond The condition
+	 */
+	public void setCondition(Condition cond) {
+		m_condition = cond;
+		
+		org.w3c.dom.Element insertBefore=null;
+		
+		if (m_activity != null) {
+			insertBefore = m_activity.getDOMElement();
+		}
+
+		setChildElement(findChildElement(Condition.CONDITION),
+				cond, insertBefore);
+	}
+	
+	/**
+	 * This method returns the condition.
+	 * 
+	 * @return The condition
+	 */
+	public Condition getCondition() {
+		return(m_condition);
+	}
+
+	/**
+	 * This method sets the main 'if' activity.
+	 * 
+	 * @param act The activity associated with the 'if'
+	 */
+	public void setActivity(BPELElement act) {
+		m_activity = act;
+		
+		BPELElement existing=findChildActivity();
+		org.w3c.dom.Element existingElem=null;
+		
+		if (existing != null) {
+			existingElem = existing.getDOMElement();
+		}
+
+		org.w3c.dom.Element insertBefore=null;
+		
+		setChildElement(existingElem, act,
+						insertBefore);
+	}
+
+	/**
+	 * This method returns the activity associated with
+	 * the 'if' path.
+	 * 
+	 * @return The 'if' activity
+	 */
+	public BPELElement getActivity() {
+		return(m_activity);
+	}
+	
+	protected String getLocalURIPart(BPELElement elem) {
+		String ret="";
+		
+		if (elem instanceof BPELActivity) {
+			ret = "@activity";
+		}
+		
+		return(ret);
+	}
+	
+	private Condition m_condition=null;
+	private BPELElement m_activity=null;
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/InteractionUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/InteractionUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/InteractionUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,168 @@
+/*
+ * 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.model.util;
+
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Invoke;
+import org.savara.bpel.model.component.Sequence;
+import org.scribble.protocol.model.*;
+
+/**
+ * This class contains utility functions for dealing with Interactions.
+ */
+public class InteractionUtil {
+	
+	/**
+	 * This method returns the name associated with the interaction.
+	 * 
+	 * @param interaction The interaction
+	 * @return The name
+	 */
+	public static String getName(Interaction interaction) {
+		String ret=null;
+		
+		if (isSend(interaction)) {
+			ret = "Send";
+		} else {
+			ret = "Receive";
+		}
+		
+		for (TypeReference ref : interaction.getMessageSignature().getTypes()) {
+			ret += "_"+ref.getLocalpart();
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied interaction
+	 * is a send.
+	 * 
+	 * @param interaction The interaction
+	 * @return Whether the interaction is a send
+	 */
+	public static boolean isSend(Interaction interaction) {
+		boolean ret=false;
+		Role role=null;
+		
+		if (interaction.getEnclosingDefinition() != null) {
+			role = interaction.getEnclosingDefinition().
+						getLocatedName().getRole();
+		}
+		
+		if (role != null && ((interaction.getFromRole() != null &&
+				interaction.getFromRole().equals(
+						role)) ||
+			(interaction.getToRole() != null &&
+				interaction.getToRole().equals(
+						role) == false))) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied interaction
+	 * is a request.
+	 * 
+	 * @param interaction The interaction
+	 * @return Whether the interaction is a request
+	 */
+	public static boolean isRequest(Interaction interaction) {
+		boolean ret=false;
+
+		if (interaction.getRequestLabel() != null ||
+				interaction.getReplyToLabel() == null) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied interaction
+	 * is a response.
+	 * 
+	 * @param interaction The interaction
+	 * @return Whether the interaction is a response
+	 */
+	public static boolean isResponse(Interaction interaction) {
+		boolean ret=false;
+
+		if (interaction.getReplyToLabel() != null) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether this is the first interaction
+	 * associated with the conversation.
+	 * 
+	 * @param interaction The interaction
+	 * @return Whether the interaction is the first in the conversation
+	 */
+	/**
+	 * This method determines whether the supplied activity
+	 * is either an invoke, or a sequence that has an
+	 * invoke as its first element.
+	 * 
+	 * @param act The activity
+	 * @return The invoke, or null if not found
+	 */
+	public static Invoke getInvoke(BPELActivity act) {
+		Invoke ret=null;
+		
+		if (act instanceof Invoke) {
+			ret = (Invoke)act;
+		} else if (act instanceof Sequence &&
+				((Sequence)act).getActivities().size() > 0 &&
+				((Sequence)act).getActivities().get(0) instanceof Invoke) {
+			ret = (Invoke)((Sequence)act).getActivities().get(0);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method recursively counts the number of 'invoke' activities
+	 * contained within a DOM element.
+	 * 
+	 * @param elem The current element
+	 * @return The number of invokes contained within the element
+	 */
+	public static int countInvokes(org.w3c.dom.Element elem) {
+		int ret=0;
+		
+		if (elem.getLocalName().equals("invoke")) {
+			ret = 1;
+		} else {
+			org.w3c.dom.NodeList nl=elem.getChildNodes();
+			
+			for (int i=0; i < nl.getLength(); i++) {
+				if (nl.item(i) instanceof org.w3c.dom.Element) {
+					ret += countInvokes((org.w3c.dom.Element)nl.item(i));
+				}
+			}
+		}
+		
+		return(ret);
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/TypeReferenceUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/TypeReferenceUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/util/TypeReferenceUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,67 @@
+/*
+ * 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.model.util;
+
+import javax.xml.namespace.QName;
+
+import org.savara.bpel.model.component.ConversionContext;
+import org.scribble.protocol.model.TypeReference;
+
+public class TypeReferenceUtil {
+
+	public static TypeReference createTypeReference(String type, ConversionContext context) {
+		TypeReference ret=new TypeReference();
+		//ret.derivedFrom(this);
+		
+		// TODO: Need to set the namespace on the TypeReference
+		if (type != null) {
+			int index=-1;
+			
+			if (type.charAt(0) == '{') {
+				// Assume a qname
+				QName qname=QName.valueOf(type);
+				
+				ret.setName(qname.getLocalPart());
+				//ret.setLocalpart(qname.getLocalPart());
+				//ret.setNamespace(qname.getNamespaceURI());
+				
+			} else if ((index=type.indexOf(':')) == -1) {
+				ret.setName(type);
+				//ret.setLocalpart(type);
+				
+			} else {
+				ret.setName(type.substring(index+1));
+				//ret.setLocalpart(type.substring(index+1));
+				
+				/*
+				String prefix=type.substring(0, index);
+				String ns=context.getNamespace(prefix);
+				
+				if (ns != null) {
+					ret.setNamespace(ns);
+				} else {
+					// TODO: Log error
+				}
+				*/
+			}
+		}
+		
+		return(ret);	
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,30 @@
+package org.savara.bpel.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext context;
+
+	static BundleContext getContext() {
+		return context;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		Activator.context = bundleContext;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		Activator.context = null;
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELModelParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELModelParserRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELModelParserRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,111 @@
+/*
+ * 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;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.savara.bpel.model.BPELNotation;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.Model;
+import org.scribble.common.logging.Journal;
+import org.scribble.parser.ParserContext;
+import org.scribble.parser.ParserRule;
+import org.scribble.parser.Token;
+
+/**
+ * This class provides the model parser for the BPEL notation.
+ * 
+ */
+ at RegistryInfo(extension=ParserRule.class,notation=BPELNotation.NOTATION_CODE)
+public class BPELModelParserRule extends org.scribble.conversation.parser.ConversationModelParserRule {
+
+	/**
+	 * The default constructor.
+	 */
+	public BPELModelParserRule() {
+		//super(ParserRuleType.File);
+	}
+	
+	/**
+	 * This method determines whether the parser rules is
+	 * appropriate to return a model object of the required
+	 * type.
+	 * 
+	 * @param type The required type
+	 * @return Whether the parser rule returns a
+	 * 				model object of the required type
+	 */
+	public boolean isSupported(Class<?> type) {
+		return(type.isAssignableFrom(Model.class));
+	}
+	
+	/**
+	 * This method parses the description to obtain
+	 * a model object of the appropriate type.
+	 * 
+	 * @param context The context
+	 * @param l The listener
+	 * @return The model object
+	 */
+	public Object parse(ParserContext context, ModelListener l) {
+		DefaultBPELLanguageModel ret=null;
+		
+		Token t=context.nextToken();
+		
+		if (t != null && t.getObject() instanceof String) {
+			try {						
+				String str=(String)t.getObject();
+				
+				// Transform the text representation to DOM
+				DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+				fact.setNamespaceAware(true);
+				
+				DocumentBuilder builder=fact.newDocumentBuilder();
+				
+				// Need to load original input stream and then
+				// provide a second input stream, as some input stream
+				// implementations don't support 'reset' operation,
+				// and therefore this was the only way to extract the
+				// content and also provide the stream to the XML
+				// document builder.
+				java.io.ByteArrayInputStream bais=
+							new java.io.ByteArrayInputStream(str.getBytes());
+				
+				org.w3c.dom.Document doc=builder.parse(bais);
+				
+				// Identify the model associated with the
+				// changed resource
+				ret = new DefaultBPELLanguageModel(context.getSource(),
+						doc.getDocumentElement(), str, context.getEnvironmentContext());
+				
+			} catch(Exception e) {
+				logger.log(Level.SEVERE,
+						"Failed to load model", e);
+			}
+		}
+
+		return(ret);
+	}
+
+	private static Logger logger = Logger.getLogger("org.savara.tools.bpel.parser");
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELTokenizer.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELTokenizer.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELTokenizer.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+import org.savara.bpel.model.BPELNotation;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.ModelReference;
+import org.scribble.parser.*;
+
+/**
+ * This is the BPEL based implementation of the tokenizer
+ * interface.
+ */
+ at RegistryInfo(extension=Tokenizer.class,notation=BPELNotation.NOTATION_CODE)
+public class BPELTokenizer extends DefaultTokenizer {
+
+	/**
+	 * The default constructor.
+	 */
+	public BPELTokenizer() {
+	}
+	
+	/**
+	 * This method obtains a list of tokens based on the
+	 * contents of the input stream.
+	 * 
+	 * @param ref The model reference for the input source
+	 * @param is The input stream
+	 * @return The list of tokens
+	 * @throws java.io.IOException Failed to derive 
+	 */
+	public java.util.List<Token> getTokens(ModelReference ref,
+			java.io.InputStream is)	throws java.io.IOException {
+		java.util.List<Token> ret=new java.util.Vector<Token>();
+		
+		byte[] b=new byte[is.available()];
+		is.read(b);
+			
+		Token t=new Token(new String(b));
+		ret.add(t);
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/change/ModelChangeUtilsTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/change/ModelChangeUtilsTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/change/ModelChangeUtilsTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,272 @@
+/*
+ * 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.model.change;
+
+import org.savara.bpel.model.change.ModelChangeUtils;
+import org.savara.contract.model.*;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.conversation.model.Run;
+import org.scribble.protocol.model.*;
+import org.scribble.model.change.DefaultModelChangeContext;
+import org.scribble.model.change.ModelChangeContext;
+
+import junit.framework.TestCase;
+
+public class ModelChangeUtilsTest extends TestCase {
+
+	private static final String MY_ROLE = "MyRole";
+	private static final String MY_LOCATED_ROLE = "MyLocatedRole";
+	private static final String MY_OTHER_ROLE = "MyOtherRole";
+	private static final String MY_OTHER_LOCATED_ROLE = "MyOtherLocatedRole";
+
+	public void testInitialiseContracts() {
+		ModelChangeContext context=new DefaultModelChangeContext(null, null);
+		
+		Conversation conv=new Conversation();
+		LocatedName ln=new LocatedName();
+		Role r=new Role();
+		r.setName(MY_ROLE);
+		
+		Contract c=new Contract();
+		r.getAnnotations().put(Contract.class.getName(), c);
+		
+		ln.setRole(r);
+		conv.setLocatedName(ln);
+		
+		ModelChangeUtils.addContracts(context, conv, true);
+		
+		Contract c2=ModelChangeUtils.getContract(context, MY_ROLE);
+		
+		if (c2 == null) {
+			fail("Contract not found");
+		}
+		
+		if (c2 != c) {
+			fail("Contract not the same as the one stored");
+		}
+	}
+
+	public void testInitialiseContractsTwice() {
+		ModelChangeContext context=new DefaultModelChangeContext(null, null);
+		
+		Conversation conv=new Conversation();
+		LocatedName ln=new LocatedName();
+		Role r=new Role();
+		r.setName(MY_ROLE);
+		
+		Contract c=new Contract();
+		r.getAnnotations().put(Contract.class.getName(), c);
+		
+		ln.setRole(r);
+		conv.setLocatedName(ln);
+		
+		ModelChangeUtils.addContracts(context, conv, true);
+		
+		Conversation conv2=new Conversation();
+		LocatedName ln2=new LocatedName();
+		Role r2=new Role();
+		r2.setName(MY_OTHER_ROLE);
+
+		Contract c2=new Contract();
+		r2.getAnnotations().put(Contract.class.getName(), c2);
+		
+		ln2.setRole(r2);
+		conv2.setLocatedName(ln2);
+		
+		ModelChangeUtils.addContracts(context, conv2, true);
+		
+		Contract c3=ModelChangeUtils.getContract(context, MY_ROLE);
+		
+		if (c3 == null) {
+			fail("Contract not found");
+		}
+		
+		if (c3 != c) {
+			fail("Contract not the same as the one stored");
+		}
+		
+		Contract c4=ModelChangeUtils.getContract(context, MY_OTHER_ROLE);
+		
+		if (c4 == null) {
+			fail("Contract not found");
+		}
+		
+		if (c4 != c2) {
+			fail("Contract2 not the same as the one stored");
+		}
+	}
+	
+	public void testPushRoleContractMapping() {
+		ModelChangeContext context=new DefaultModelChangeContext(null, null);
+		
+		Conversation conv=new Conversation();
+		LocatedName ln=new LocatedName();
+		Role r1=new Role();
+		r1.setName(MY_LOCATED_ROLE);
+		ln.setRole(r1);
+		conv.setLocatedName(ln);
+		
+		Contract c1=new Contract();
+		r1.getAnnotations().put(Contract.class.getName(), c1);
+		
+		Role r2=new Role();
+		r2.setName(MY_ROLE);
+		
+		Contract c2=new Contract();
+		r2.getAnnotations().put(Contract.class.getName(), c2);
+				
+		RoleList rl=new RoleList();
+		rl.getRoles().add(r2);
+		conv.getBlock().getContents().add(rl);
+		
+		ModelChangeUtils.addContracts(context, conv, true);
+
+		Conversation subconv=new Conversation();
+		LocatedName subln=new LocatedName();
+		Role subr1=new Role();
+		subr1.setName(MY_OTHER_LOCATED_ROLE);
+		subln.setRole(subr1);
+		subconv.setLocatedName(subln);
+		
+		Run run=new Run();
+		conv.getBlock().getContents().add(run);
+		run.setInlineDefinition(subconv);
+		
+		DeclarationBinding db=new DeclarationBinding();
+		db.setDeclaration(r2);
+		db.setBoundName(MY_OTHER_ROLE);
+		run.getBindings().add(db);
+		
+		ModelChangeUtils.pushRoleContractMapping(context, run);
+		
+		Contract c3=ModelChangeUtils.getContract(context, MY_ROLE);
+		Contract c4=ModelChangeUtils.getContract(context, MY_OTHER_ROLE);
+		
+		if (c3 != null) {
+			fail("Contract for "+MY_ROLE+" should be null");
+		}
+		
+		if (c4 == null) {
+			fail("Contract for "+MY_OTHER_ROLE+" should NOT be null");
+		}
+		
+		Contract c5=ModelChangeUtils.getContract(context, MY_LOCATED_ROLE);
+		Contract c6=ModelChangeUtils.getContract(context, MY_OTHER_LOCATED_ROLE);
+		
+		if (c5 != null) {
+			fail("Contract for "+MY_LOCATED_ROLE+" should be null");
+		}
+		
+		if (c6 == null) {
+			fail("Contract for "+MY_OTHER_LOCATED_ROLE+" should NOT be null");
+		}
+		
+		if (c6 != c1) {
+			fail("Located role's Contract not the same as the one stored");
+		}
+		
+		if (c4 != c2) {
+			fail("Contract not the same as the one stored");
+		}
+	}
+	
+	public void testPopRoleContractMapping() {
+		ModelChangeContext context=new DefaultModelChangeContext(null, null);
+		
+		Conversation conv=new Conversation();
+		LocatedName ln=new LocatedName();
+		Role r1=new Role();
+		r1.setName(MY_LOCATED_ROLE);
+		
+		ln.setRole(r1);
+		conv.setLocatedName(ln);
+		
+		Role r2=new Role();
+		r2.setName(MY_ROLE);
+		
+		RoleList rl=new RoleList();
+		rl.getRoles().add(r2);
+		conv.getBlock().getContents().add(rl);
+		
+		Conversation subconv=new Conversation();
+		LocatedName subln=new LocatedName();
+		Role subr1=new Role();
+		subr1.setName(MY_OTHER_LOCATED_ROLE);
+		subln.setRole(subr1);
+		subconv.setLocatedName(subln);
+		
+		Contract c1=new Contract();
+		subr1.getAnnotations().put(Contract.class.getName(), c1);
+		
+		Role r3=new Role();
+		r3.setName(MY_OTHER_ROLE);
+		
+		Contract c2=new Contract();
+		r3.getAnnotations().put(Contract.class.getName(), c2);
+
+		RoleList rl2=new RoleList();
+		rl2.getRoles().add(r3);
+		subconv.getBlock().getContents().add(rl2);
+		
+		// Add contracts for subconv as if root, as normally
+		// this would be done by pushing the contracts, so this
+		// is just being used to setup the appropriate context
+		ModelChangeUtils.addContracts(context, subconv, true);
+
+		Run run=new Run();
+		conv.getBlock().getContents().add(run);
+		run.setInlineDefinition(subconv);
+		
+		DeclarationBinding db=new DeclarationBinding();
+		db.setDeclaration(r2);
+		db.setBoundName(MY_OTHER_ROLE);
+		run.getBindings().add(db);
+		
+		ModelChangeUtils.popRoleContractMapping(context, run);
+		
+		Contract c3=ModelChangeUtils.getContract(context, MY_ROLE);
+		Contract c4=ModelChangeUtils.getContract(context, MY_OTHER_ROLE);
+		
+		if (c3 == null) {
+			fail("Contract for "+MY_ROLE+" should NOT be null");
+		}
+		
+		if (c4 != null) {
+			fail("Contract for "+MY_OTHER_ROLE+" should be null");
+		}
+		
+		Contract c5=ModelChangeUtils.getContract(context, MY_LOCATED_ROLE);
+		Contract c6=ModelChangeUtils.getContract(context, MY_OTHER_LOCATED_ROLE);
+		
+		if (c5 == null) {
+			fail("Contract for "+MY_LOCATED_ROLE+" should NOT be null");
+		}
+		
+		if (c6 != null) {
+			fail("Contract for "+MY_OTHER_LOCATED_ROLE+" should be null");
+		}
+		
+		if (c3 != c2) {
+			fail("Contract not the same as the one stored");
+		}
+		
+		if (c5 != c1) {
+			fail("Contract not the same as the one stored");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/AbstractInteractionTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/AbstractInteractionTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/AbstractInteractionTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,144 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+
+import junit.framework.TestCase;
+
+public class AbstractInteractionTest extends TestCase {
+
+	public void testIsActivity() {
+		TestAbstractInteraction act=
+			new TestAbstractInteraction(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String op="testOp";
+		String portType="testPortType";
+		String partnerLink="testPartnerLink";
+		
+		String xml="<interaction xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "operation=\""+op+"\" "+
+		       "partnerLink=\""+partnerLink+"\" "+
+		       "portType=\""+portType+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestAbstractInteraction component=new TestAbstractInteraction(model, elem);		
+		
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+		
+		if (component.getPartnerLink().equals(partnerLink) == false) {
+			fail("PartnerLink not correct, expecting '"+partnerLink+"': "+
+							component.getPartnerLink());
+		}
+		
+		if (component.getPortType().equals(portType) == false) {
+			fail("Port type not correct, expecting '"+portType+"': "+
+							component.getPortType());
+		}
+	}
+	
+	public void testGetOperation() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String op="testOp";
+		
+		TestAbstractInteraction component=new TestAbstractInteraction(model);		
+		
+		if (component.getOperation() != null) {
+			fail("Should be null");
+		}
+		
+		component.setOperation(op);
+		
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+	}
+	
+	public void testGetPortType() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pt="testPortType";
+		
+		TestAbstractInteraction component=new TestAbstractInteraction(model);		
+		
+		if (component.getPortType() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPortType(pt);
+		
+		if (component.getPortType().equals(pt) == false) {
+			fail("Port type not correct, expecting '"+pt+"': "+
+							component.getPortType());
+		}
+	}
+	
+	public void testGetPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pl="testPartnerLink";
+		
+		TestAbstractInteraction component=new TestAbstractInteraction(model);		
+		
+		if (component.getPartnerLink() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPartnerLink(pl);
+		
+		if (component.getPartnerLink().equals(pl) == false) {
+			fail("Partner link not correct, expecting '"+pl+"': "+
+							component.getPartnerLink());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELActivityTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELActivityTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELActivityTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,191 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+
+import junit.framework.TestCase;
+
+public class BPELActivityTest extends TestCase {
+
+	public void testIsActivity() {
+		TestBPELActivity act=
+			new TestBPELActivity(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testGetNameFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String name="testName";
+		
+		String xml="<activity xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "name=\""+name+"\" />";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELActivity component=new TestBPELActivity(model, elem);		
+		
+		if (component.getName().equals(name) == false) {
+			fail("Name not correct, expecting '"+name+"': "+
+							component.getName());
+		}
+	}
+	
+	public void testGetName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String name="testName";
+		
+		TestBPELActivity component=new TestBPELActivity(model);		
+		
+		if (component.getName() != null) {
+			fail("Should be null");
+		}
+		
+		component.setName(name);
+		
+		if (component.getName().equals(name) == false) {
+			fail("Name not correct, expecting '"+name+"': "+
+							component.getName());
+		}
+	}
+
+	public void testSuppressJoinFailureFromDOMTrue() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String value="yes";
+		
+		String xml="<activity xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "suppressJoinFailure=\""+value+"\" />";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELActivity component=new TestBPELActivity(model, elem);		
+		
+		if (component.getSuppressJoinFailure() == false) {
+			fail("'Suppress Join Failure' not correct, expecting 'true': "+
+							component.getSuppressJoinFailure());
+		}
+	}
+	
+	public void testSuppressJoinFailureFromDOMFalse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String value="no";
+		
+		String xml="<activity xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "suppressJoinFailure=\""+value+"\" />";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELActivity component=new TestBPELActivity(model, elem);		
+		
+		if (component.getSuppressJoinFailure() == true) {
+			fail("'Suppress Join Failure' not correct, expecting 'false': "+
+							component.getSuppressJoinFailure());
+		}
+	}
+	
+	public void testGetSuppressJoinFailureTrue() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		TestBPELActivity component=new TestBPELActivity(model);		
+		
+		component.setSuppressJoinFailure(true);
+		
+		if (component.getSuppressJoinFailure() == false) {
+			fail("'Suppress Join Failure' not correct, expecting 'true': "+
+							component.getSuppressJoinFailure());
+		}
+	}
+	
+	public void testGetSuppressJoinFailureFalse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		TestBPELActivity component=new TestBPELActivity(model);		
+		
+		component.setSuppressJoinFailure(false);
+		
+		if (component.getSuppressJoinFailure() == true) {
+			fail("'Suppress Join Failure' not correct, expecting 'false': "+
+							component.getSuppressJoinFailure());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELElementTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELElementTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/BPELElementTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,401 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELElement;
+import org.savara.bpel.model.component.Condition;
+import org.savara.bpel.model.component.Else;
+import org.savara.bpel.model.component.If;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class BPELElementTest extends TestCase {
+
+	public void testFindChildElements() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<elem xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<first/>"+
+				"<else/>"+
+				"<sequence/>"+
+				"<second/>"+
+				"<if/>"+
+				"</elem>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELElement top=new TestBPELElement(model, elem);		
+
+		java.util.List<BPELElement> elems=
+				top.findChildElements(BPELElement.class);
+		
+		if (elems == null) {
+			fail("Null list");
+		}
+		
+		if (elems.size() != 3) {
+			fail("Expecting three child elements: "+elems.size());
+		}
+		
+		if ((elems.get(0) instanceof Else) == false) {
+			fail("Element 0 not else: "+elems.get(0));
+		}
+		
+		if ((elems.get(1) instanceof Sequence) == false) {
+			fail("Element 1 not sequence: "+elems.get(1));
+		}
+		
+		if ((elems.get(2) instanceof If) == false) {
+			fail("Element 2 not 'if': "+elems.get(2));
+		}
+
+		elems = top.findChildElements(Sequence.class);
+	
+		if (elems == null) {
+			fail("Null sequence list");
+		}
+		
+		if (elems.size() != 1) {
+			fail("Expecting one child element: "+elems.size());
+		}
+	
+		if ((elems.get(0) instanceof Sequence) == false) {
+			fail("Element 0 not sequence: "+elems.get(0));
+		}
+	}
+		
+	public void testFindChildActivity() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<elem xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<first/>"+
+				"<else/>"+
+				"<sequence/>"+
+				"<second/>"+
+				"<if/>"+
+				"</elem>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELElement top=new TestBPELElement(model, elem);		
+
+		BPELElement act=top.findChildActivity();
+		
+		if (act == null) {
+			fail("Null activity");
+		}
+		
+		if ((act instanceof Sequence) == false) {
+			fail("Activity not sequence");
+		}
+	}
+	
+	public void testSetChildElement() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		TestBPELElement top=new TestBPELElement(model);
+		
+		org.w3c.dom.Element newElem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+
+			newElem = builder.newDocument().createElement("newelem");
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		if (top.getDOMElement().getFirstChild() != null) {
+			fail("Child element not expected");
+		}
+		
+		TestBPELElement telem=new TestBPELElement(model, newElem);
+		
+		top.setChildElement(null, telem, null);
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("Should only be 1 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (top.getDOMElement().getChildNodes().item(0).getNodeName().
+						equals(newElem.getNodeName()) == false) {
+			fail("Node name of new child element not correct");
+		}
+	}
+	
+	public void testSetChildElementAtBeginning() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<elem>"+
+				"<first/>"+
+				"<second/>"+
+				"<third/>"+
+				"</elem>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELElement top=new TestBPELElement(model, elem);
+
+		org.w3c.dom.Element newElem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+
+			newElem = builder.newDocument().createElement("newelem");
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Should only be 3 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		TestBPELElement telem=new TestBPELElement(model, newElem);
+		
+		top.setChildElement(null, telem, top.getDOMElement().getFirstChild());
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Should only be 4 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (top.getDOMElement().getChildNodes().item(0).getNodeName().
+						equals(newElem.getNodeName()) == false) {
+			fail("Node name of new child element not correct");
+		}
+	}
+	
+	public void testSetChildElementAtEnd() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<elem>"+
+				"<first/>"+
+				"<second/>"+
+				"<third/>"+
+				"</elem>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELElement top=new TestBPELElement(model, elem);
+
+		org.w3c.dom.Element newElem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+
+			newElem = builder.newDocument().createElement("newelem");
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Should only be 3 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		TestBPELElement telem=new TestBPELElement(model, newElem);
+		
+		top.setChildElement(null, telem, null);
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Should only be 4 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (top.getDOMElement().getChildNodes().item(3).getNodeName().
+						equals(newElem.getNodeName()) == false) {
+			fail("Node name of new child element not correct");
+		}
+	}
+	
+	public void testSetChildElementReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String first="first";
+		String second="second";
+		
+		String xml="<elem>"+
+				"<newelem name=\""+first+"\" />"+
+				"</elem>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TestBPELElement top=new TestBPELElement(model, elem);
+		
+		org.w3c.dom.Element newElem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+
+			newElem = builder.newDocument().createElement("newelem");
+			newElem.setAttribute("name", second);
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		if (top.getDOMElement().getFirstChild() == null) {
+			fail("First child element expected");
+		}
+		
+		if ((top.getDOMElement().getFirstChild() instanceof 
+						org.w3c.dom.Element) == false) {
+			fail("First child is not an element");
+		}
+		
+		TestBPELElement telem=new TestBPELElement(model, newElem);
+		
+		top.setChildElement((org.w3c.dom.Element)
+				top.getDOMElement().getFirstChild(),
+							telem, null);
+		
+		if (top.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("Should only be 1 child node: "+top.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (top.getDOMElement().getChildNodes().item(0).getNodeName().
+						equals(newElem.getNodeName()) == false) {
+			fail("Node name of new child element not correct");
+		}
+		
+		if (((org.w3c.dom.Element)top.getDOMElement().getChildNodes().
+				item(0)).getAttribute("name").equals(second) == false) {
+			fail("Attribute is not as expected");
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchAllTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchAllTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchAllTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,75 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.CatchAll;
+import org.savara.bpel.model.component.Else;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class CatchAllTest extends TestCase {
+
+	public void testIsActivity() {
+		CatchAll act=new CatchAll(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildCatchAll() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<catchAll xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<sequence/></catchAll>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		CatchAll construct=new CatchAll(model, elem);		
+		
+		if (construct.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((construct.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CatchTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,117 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Catch;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class CatchTest extends TestCase {
+
+	public void testIsActivity() {
+		Catch act=new Catch(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildCatchAll() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String fault="testFault";
+
+		String xml="<catch xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" " +
+			       "faultVariable=\""+var+"\" "+
+			       "faultName=\""+fault+"\" >"+
+				"<sequence/></catch>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Catch construct=new Catch(model, elem);		
+		
+		if (construct.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((construct.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+
+	public void testGetFaultVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Catch component=new Catch(model);		
+		
+		if (component.getFaultVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setFaultVariable(var);
+		
+		if (component.getFaultVariable().equals(var) == false) {
+			fail("Fault Variable not correct, expecting '"+var+"': "+
+							component.getFaultVariable());
+		}
+	}
+
+	public void testGetFaultName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String fault="testFault";
+		
+		Catch component=new Catch(model);		
+		
+		if (component.getFaultName() != null) {
+			fail("Should be null");
+		}
+		
+		component.setFaultName(fault);
+		
+		if (component.getFaultName().equals(fault) == false) {
+			fail("Fault name not correct, expecting '"+fault+"': "+
+							component.getFaultName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CompensationHandlerTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CompensationHandlerTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/CompensationHandlerTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,75 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.CompensationHandler;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class CompensationHandlerTest extends TestCase {
+
+	public void testIsActivity() {
+		CompensationHandler act=
+				new CompensationHandler(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildCompensationHandler() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<compensationHandler xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<sequence/></compensationHandler>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		CompensationHandler construct=new CompensationHandler(model, elem);		
+		
+		if (construct.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((construct.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ConditionTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ConditionTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ConditionTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,167 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Condition;
+
+import junit.framework.TestCase;
+
+public class ConditionTest extends TestCase {
+
+	public void testIsActivity() {
+		Condition act=new Condition(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testGetExpression() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+		Condition condition=new Condition(model);
+		
+		String expr="Test Expression";
+		
+		if (condition.getExpression() != null) {
+			fail("Should be null");
+		}
+		
+		condition.setExpression(expr);
+		
+		String result=condition.getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr+"' but got '"+result+"'");
+		}
+	}
+	
+	public void testGetExpressionFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr="Test Expression";
+		
+		String xml="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+expr+"</condition>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);		
+		
+		String result=condition.getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr+"' but got '"+result+"'");
+		}		
+	}
+
+	public void testGetExpressionLanguage() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+		Condition condition=new Condition(model);
+		
+		String lang="Test Language";
+		
+		if (condition.getExpressionLanguage() != null) {
+			fail("Should be null");
+		}
+		
+		condition.setExpressionLanguage(lang);
+		
+		String result=condition.getExpressionLanguage();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(lang) == false) {
+			fail("Expression language is not valid: expecting '"+
+					lang+"' but got '"+result+"'");
+		}
+	}
+	
+	public void testGetExpressionLanguageFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String lang="TestLanguage";
+		
+		String xml="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\"" +
+				" expressionLanguage=\""+lang+"\"></condition>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);		
+		
+		String result=condition.getExpressionLanguage();
+		
+		if (result == null) {
+			fail("Expression language is null");
+		}
+		
+		if (result.equals(lang) == false) {
+			fail("Expression language is not valid: expecting '"+
+					lang+"' but got '"+result+"'");
+		}		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseIfTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseIfTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseIfTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,91 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Elseif;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class ElseIfTest extends TestCase {
+
+	public void testIsActivity() {
+		Elseif act=new Elseif(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildElseIf() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr="Test Expression";
+		
+		String xml="<elseif xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<condition>"+expr+"</condition><sequence/></elseif>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Elseif elseif=new Elseif(model, elem);		
+		
+		if (elseif.getCondition() == null) {
+			fail("No condition");
+		}
+		
+		if (elseif.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		String result=elseif.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr+"' but got '"+result+"'");
+		}				
+		
+		if ((elseif.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ElseTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,74 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Else;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class ElseTest extends TestCase {
+
+	public void testIsActivity() {
+		Else act=new Else(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildElse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<else xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<sequence/></else>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Else construct=new Else(model, elem);		
+		
+		if (construct.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((construct.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/EventHandlersTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/EventHandlersTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/EventHandlersTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,417 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.EventHandlers;
+import org.savara.bpel.model.component.OnAlarm;
+import org.savara.bpel.model.component.OnEvent;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Scope;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class EventHandlersTest extends TestCase {
+
+	public void testIsActivity() {
+		EventHandlers act=new EventHandlers(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testEventHandlersFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<eventHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<onEvent/>"+
+		       "<onEvent/>"+
+		       "<onAlarm/>"+
+		       "</eventHandlers>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		EventHandlers component=new EventHandlers(model, elem);		
+		
+		if (component.getOnEvents().size() != 2) {
+			fail("Expecting 2 onEvent: "+
+							component.getOnEvents().size());
+		}
+		
+		if (component.getOnAlarms().size() != 1) {
+			fail("Expecting 1 onAlarm: "+
+							component.getOnAlarms().size());
+		}
+	}
+
+	public void testAddOnMessageToEventHandlersInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<eventHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<onAlarm/>"+
+	       		"<onAlarm/>"+
+	       		"</eventHandlers>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		EventHandlers component=new EventHandlers(model, elem);		
+		
+		if (component.getOnAlarms().size() != 2) {
+			fail("Expecting 2 onAlarms: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getOnEvents().size() != 0) {
+			fail("Expecting 0 onEvents: "+
+							component.getOnEvents().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		OnEvent sub=new OnEvent(model);
+		
+		component.addOnEvent(sub, 0);
+		
+		if (component.getOnEvents().size() != 1) {
+			fail("Expecting 1 onEvent: "+
+							component.getOnEvents().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(OnEvent.ONEVENT) == false) {
+			fail("Second element was not a 'onEvent': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+
+	public void testAddOnAlarmToEventHandlersInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<eventHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<onEvent/>"+
+	       		"<onEvent/>"+
+	       		"</eventHandlers>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		EventHandlers component=new EventHandlers(model, elem);		
+		
+		if (component.getOnEvents().size() != 2) {
+			fail("Expecting 2 onEvents: "+
+							component.getOnEvents().size());
+		}
+		
+		if (component.getOnAlarms().size() != 0) {
+			fail("Expecting 0 onAlarms: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		OnAlarm sub=new OnAlarm(model);
+		
+		component.addOnAlarm(sub, 0);
+		
+		if (component.getOnAlarms().size() != 1) {
+			fail("Expecting 1 onAlarm: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(3).
+				getLocalName().equals(OnAlarm.ONALARM) == false) {
+			fail("Second element was not a 'onAlarm': "+
+					component.getDOMElement().getChildNodes().item(3).
+									getLocalName());
+		}
+	}
+	
+	public void testGetURIOnEvent() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<scope>"+
+		       		"<eventHandlers>"+
+						"<onEvent>"+
+							"<scope>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+			       			"</scope>"+
+						"</onEvent>"+
+			       "</eventHandlers>"+
+			       "<sequence/>"+
+	       		"</scope>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+				new org.savara.bpel.model.component.Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Scope) == false) {
+			fail("Top level activity is not scope");
+		}
+		
+		Scope scope=(Scope)topact;
+		
+		if (scope.getEventHandlers() == null) {
+			fail("Event handlers not set");
+		}
+		
+		if (scope.getEventHandlers().getOnEvents().size() != 1) {
+			fail("Event handlers should have 1 onEvent: "+scope.getEventHandlers().getOnEvents().size());
+		}
+		
+		OnEvent one=scope.getEventHandlers().getOnEvents().get(0);
+		
+		Scope innerScope=one.getScope();
+		
+		if (innerScope == null) {
+			fail("Inner scope not set");
+		}
+		
+		if ((innerScope.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)innerScope.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@eventHandlers/@onEvent.0/@scope/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+	
+	public void testGetURIOnAlarm() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<scope>"+
+		       		"<eventHandlers>"+
+						"<onAlarm>"+
+							"<scope>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+			       			"</scope>"+
+						"</onAlarm>"+
+			       "</eventHandlers>"+
+			       "<sequence/>"+
+	       		"</scope>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Scope) == false) {
+			fail("Top level activity is not scope");
+		}
+		
+		Scope scope=(Scope)topact;
+		
+		if (scope.getEventHandlers() == null) {
+			fail("Event handlers not set");
+		}
+		
+		if (scope.getEventHandlers().getOnAlarms().size() != 1) {
+			fail("Event handlers should have 1 onAlarm: "+scope.getEventHandlers().getOnAlarms().size());
+		}
+		
+		OnAlarm one=scope.getEventHandlers().getOnAlarms().get(0);
+		
+		if ((one.getActivity() instanceof Scope) == false) {
+			fail("Activity is not Scope");
+		}
+		
+		Scope innerScope=(Scope)one.getActivity();
+		
+		if (innerScope == null) {
+			fail("Inner scope not set");
+		}
+		
+		if ((innerScope.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)innerScope.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@eventHandlers/@onAlarm.0/@scope/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ExitTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ExitTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ExitTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,35 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Exit;
+
+import junit.framework.TestCase;
+
+public class ExitTest extends TestCase {
+
+	public void testIsActivity() {
+		Exit act=
+			new Exit(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FaultHandlersTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FaultHandlersTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FaultHandlersTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,396 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Catch;
+import org.savara.bpel.model.component.CatchAll;
+import org.savara.bpel.model.component.FaultHandlers;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class FaultHandlersTest extends TestCase {
+
+	public void testIsActivity() {
+		FaultHandlers act=new FaultHandlers(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testFaultHandlersCatchFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<faultHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<catch/>"+
+				"<catch/>"+
+		       "</faultHandlers>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		FaultHandlers component=new FaultHandlers(model, elem);		
+		
+		if (component.getCatchAll() != null) {
+			fail("CatchAll path should be null");
+		}
+		
+		if (component.getCatchPaths().size() != 2) {
+			fail("Should have 2 catch paths: "+component.getCatchPaths().size());
+		}
+	}
+
+	public void testFaultHandlersCatchAllFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<faultHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<catchAll/>"+
+		       "</faultHandlers>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		FaultHandlers component=new FaultHandlers(model, elem);		
+		
+		if (component.getCatchAll() == null) {
+			fail("CatchAll path should NOT be null");
+		}
+		
+		if (component.getCatchPaths().size() != 0) {
+			fail("Should have 0 catch paths: "+component.getCatchPaths().size());
+		}
+	}
+	
+	public void testAddCatch() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<faultHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "</faultHandlers>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		FaultHandlers component=new FaultHandlers(model, ifelem);
+
+		if (component.getCatchPaths().size() != 0) {
+			fail("Should be no catch paths");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 0) {
+			fail("Zero child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		Catch elem=new Catch(model);
+		elem.setActivity(seq);
+		
+		component.addCatch(elem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("One child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(Catch.CATCH) == false) {
+			fail("First element was not a catch: "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+	}	
+	
+	public void testAddCatchInsertBeforeCatchAll() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<faultHandlers xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<catchAll>"+
+		       "<sequence/>"+
+		       "</catchAll>"+
+		       "</faultHandlers>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		FaultHandlers component=new FaultHandlers(model, ifelem);
+
+		if (component.getCatchPaths().size() != 0) {
+			fail("Should be no catch paths");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("One child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		Catch catchElem=new Catch(model);
+		catchElem.setActivity(seq);
+		
+		component.addCatch(catchElem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(Catch.CATCH) == false) {
+			fail("First element was not a catch: "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+	}	
+	
+	public void testGetURICatch() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<faultHandlers>"+
+					"<catch>"+
+			       		"<sequence>"+
+			       			"<receive/>"+
+		       			"</sequence>"+
+					"</catch>"+
+		       "</faultHandlers>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		FaultHandlers fhs=component.getFaultHandlers();
+		
+		if (fhs == null) {
+			fail("No fault handlers");
+		}
+		
+		if (fhs.getCatchPaths().size() != 1) {
+			fail("Expecting one catch: "+fhs.getCatchPaths().size());
+		}
+		
+		Catch c=fhs.getCatchPaths().get(0);
+		
+		BPELActivity act=c.getActivity();
+		
+		if ((act instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)act;
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@faultHandlers/@catch.0/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+
+	public void testGetURICatchAll() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<faultHandlers>"+
+					"<catchAll>"+
+			       		"<sequence>"+
+			       			"<receive/>"+
+		       			"</sequence>"+
+					"</catchAll>"+
+		       "</faultHandlers>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		FaultHandlers fhs=component.getFaultHandlers();
+		
+		if (fhs == null) {
+			fail("No fault handlers");
+		}
+		
+		if (fhs.getCatchAll() == null) {
+			fail("CatchAll not set");
+		}
+		
+		CatchAll c=fhs.getCatchAll();
+		
+		BPELActivity act=c.getActivity();
+		
+		if ((act instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)act;
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@faultHandlers/@catchAll/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FlowTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FlowTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/FlowTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,398 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Flow;
+import org.savara.bpel.model.component.Link;
+import org.savara.bpel.model.component.While;
+
+import junit.framework.TestCase;
+
+public class FlowTest extends TestCase {
+
+	public void testIsActivity() {
+		Flow act=new Flow(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testFlowFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String link1="link1Name";
+		String link2="link2Name";
+		
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<links>"+
+				"<link name=\""+link1+"\" />"+
+				"<link name=\""+link2+"\" />"+
+				"</links>"+
+		       "<if/>"+
+		       "<if/>"+
+		       "</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);		
+		
+		if (component.getLinks().size() != 2) {
+			fail("Expecting 2 child links: "+
+							component.getLinks().size());
+		}
+		
+		if (component.getLinks().get(0).getName().equals(link1) == false) {
+			fail("First link name incorrect");
+		}
+		
+		if (component.getLinks().get(1).getName().equals(link2) == false) {
+			fail("Second link name incorrect");
+		}
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+	}
+
+	public void testAddLinkToFlowFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String link1="link1Name";
+		
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<if/>"+
+		       "</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);
+		
+		if (component.getLinks().size() != 0) {
+			fail("Should be no links");
+		}
+		
+		org.w3c.dom.Element links=
+				component.findChildElement(Flow.LINKS);
+		
+		if (links != null) {
+			fail("Links element should not be found");
+		}
+
+		Link l1=new Link(model);
+		l1.setName(link1);
+		
+		component.addLink(l1, -1);
+		
+		links = component.findChildElement(Flow.LINKS);
+
+		if (links == null) {
+			fail("Links element not found");
+		}
+	}
+
+	public void testRemoveLinkFromFlowFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String link1="link1Name";
+		
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<links>"+
+				"<link name=\""+link1+"\" />"+
+				"</links>"+
+		       "<if/>"+
+		       "</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);
+		
+		if (component.getLinks().size() != 1) {
+			fail("Should be one link: "+component.getLinks().size());
+		}
+		
+		org.w3c.dom.Element links=
+				component.findChildElement(Flow.LINKS);
+		
+		if (links == null) {
+			fail("Links element is null");
+		}
+
+		Link l1=component.getLinks().get(0);
+		
+		component.removeLink(l1);
+		
+		links = component.findChildElement(Flow.LINKS);
+		
+		if (links != null) {
+			fail("Links element should now be null");
+		}
+	}
+
+	public void testAddFirstActToFlowInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, 0);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+	public void testAddSecondActToFlowInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, 1);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+	}
+
+	public void testAddLastActToFlowInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<flow xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</flow>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Flow component=new Flow(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, -1);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(3).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(3).
+									getLocalName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ForEachTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ForEachTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ForEachTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,217 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.ForEach;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Scope;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class ForEachTest extends TestCase {
+
+	public void testIsActivity() {
+		ForEach act=new ForEach(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testForEachFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<forEach xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<startCounterValue/>"+
+			"<finalCounterValue/>"+
+			"<completionCondition/>"+
+			"<scope/>"+
+			"</forEach>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		ForEach component=new ForEach(model, elem);		
+		
+		if (component.getScope() == null) {
+			fail("Scope not set");
+		}
+	}
+
+	public void testSetScopeInInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<forEach xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<startCounterValue/>"+
+			"<finalCounterValue/>"+
+			"<completionCondition/>"+
+			"</forEach>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		ForEach component=new ForEach(model, elem);		
+		
+		if (component.getScope() == null) {
+			fail("Scope should not be null");
+		}
+		
+		Scope scope=new Scope(model);
+		component.setScope(scope);
+		
+		if (component.getScope() == null) {
+			fail("Scope should still not be null");
+		}
+
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(3).
+				getLocalName().equals(Scope.SCOPE) == false) {
+			fail("Second element was not a 'scope': "+
+					component.getDOMElement().getChildNodes().item(3).
+									getLocalName());
+		}
+	}
+	
+	public void testGetURI() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       		"<forEach xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+						"<startCounterValue/>"+
+						"<finalCounterValue/>"+
+						"<completionCondition/>"+
+						"<scope>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+		       			"</scope>"+
+					"</forEach>"+
+			       "<sequence/>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof ForEach) == false) {
+			fail("Top level activity is not ForEach");
+		}
+		
+		ForEach fe=(ForEach)topact;
+		
+		Scope innerScope=fe.getScope();
+		
+		if (innerScope == null) {
+			fail("Inner scope not set");
+		}
+		
+		if ((innerScope.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)innerScope.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@scope/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/IfTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/IfTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/IfTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,1192 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Condition;
+import org.savara.bpel.model.component.Else;
+import org.savara.bpel.model.component.Elseif;
+import org.savara.bpel.model.component.If;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Reply;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.Throw;
+
+import junit.framework.TestCase;
+
+public class IfTest extends TestCase {
+
+	public void testIsActivity() {
+		If act=new If(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testIfFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition>"+expr1+"</condition>"+
+		       "<sequence/>"+
+		       "</if>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not set");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity not a sequence");
+		}
+		
+		if (component.getElsePath() != null) {
+			fail("Else path should be null");
+		}
+		
+		if (component.getElseIfPaths().size() > 0) {
+			fail("No elseif paths should be set");
+		}
+	}
+
+	public void testIfElseFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition>"+expr1+"</condition>"+
+		       "<sequence/>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not set");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity not a sequence");
+		}
+		
+		if (component.getElsePath() == null) {
+			fail("Else path is not set");
+		}
+		
+		if ((component.getElsePath().getActivity() instanceof Sequence) == false) {
+			fail("Else path Activity not a sequence");
+		}
+		
+	}
+
+	public void testIfElseIfsElseFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		String expr3="Test Expression 3";
+		
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition>"+expr1+"</condition>"+
+		       "<sequence/>"+
+		       "<elseif>"+
+		       "<condition>"+expr2+"</condition>"+
+		       "<sequence/>"+
+		       "</elseif>"+
+		       "<elseif>"+
+		       "<condition>"+expr3+"</condition>"+
+		       "<sequence/>"+
+		       "</elseif>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not set");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity not a sequence");
+		}
+		
+		if (component.getElsePath() == null) {
+			fail("Else path is not set");
+		}
+		
+		if ((component.getElsePath().getActivity() instanceof Sequence) == false) {
+			fail("Else path Activity not a sequence");
+		}
+		
+		if (component.getElseIfPaths().size() != 2) {
+			fail("Two elseif paths expected: "+component.getElseIfPaths().size());
+		}
+		
+		if (component.getElseIfPaths().get(0).getCondition() == null) {
+			fail("Elseif 0 no condition");
+		}
+		
+		result=component.getElseIfPaths().get(0).getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Elseif 0 Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Elseif 0 Expression is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+
+		if (component.getElseIfPaths().get(0).getActivity() == null) {
+			fail("Elseif 0 no activity");
+		}
+		
+		if ((component.getElseIfPaths().get(0).getActivity() instanceof Sequence) == false) {
+			fail("Elseif 0 Activity not a sequence");
+		}
+
+		if (component.getElseIfPaths().get(1).getCondition() == null) {
+			fail("Elseif 1 no condition");
+		}
+
+		result=component.getElseIfPaths().get(1).getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Elseif 1 Expression is null");
+		}
+		
+		if (result.equals(expr3) == false) {
+			fail("Elseif 1 Expression is not valid: expecting '"+
+					expr3+"' but got '"+result+"'");
+		}
+
+		if (component.getElseIfPaths().get(1).getActivity() == null) {
+			fail("Elseif 1 no activity");
+		}
+		
+		if ((component.getElseIfPaths().get(1).getActivity() instanceof Sequence) == false) {
+			fail("Elseif 1 Activity not a sequence");
+		}
+	}
+	
+	public void testSetConditionNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</condition>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);
+		
+		If component=new If(model);
+		
+		component.setCondition(condition);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetConditionReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</condition>";
+	
+		String xml2="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</condition>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		If component=new If(model);
+		
+		component.setCondition(condition1);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setCondition(condition2);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetActivityInsertBeforeElse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Activity should be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		
+		component.setActivity(seq);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("Second element was not a sequence: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}	
+	
+	public void testSetConditionInsertBeforeElse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<sources/>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		String expr1="Test Expression 1";
+
+		Condition cond=new Condition(model);
+		cond.setExpression(expr1);
+		
+		component.setCondition(cond);
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression not set");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression not same");
+		}
+		
+		// Check position of condition
+		org.w3c.dom.NodeList nl=component.getDOMElement().getChildNodes();
+		
+		if (nl.item(1).getLocalName().equals(Condition.CONDITION) == false) {
+			fail("Second child not is not condition: "+nl.item(1).getLocalName());
+		}
+	}	
+
+	public void testSetActivityInsertBeforeElseIf() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<elseif>"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "</elseif>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Activity should be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		
+		component.setActivity(seq);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("Second element was not a sequence: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}	
+	
+	public void testAddElseIf() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getElseIfPaths().size() != 0) {
+			fail("Should be no elseif paths");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		Elseif elseif=new Elseif(model);
+		elseif.setActivity(seq);
+		
+		component.addElseIfPath(elseif);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(Elseif.ELSEIF) == false) {
+			fail("Third element was not an elseif: "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+	}	
+	
+	public void testAddElseIfInsertBeforeElse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getElseIfPaths().size() != 0) {
+			fail("Should be no elseif paths");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		Elseif elseif=new Elseif(model);
+		elseif.setActivity(seq);
+		
+		component.addElseIfPath(elseif);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(Elseif.ELSEIF) == false) {
+			fail("Third element was not an elseif: "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+	}	
+
+	public void testSetElseNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getElsePath() != null) {
+			fail("Should be no else path");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		Else elseElem=new Else(model);
+		elseElem.setActivity(seq);
+		
+		component.setElsePath(elseElem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(Else.ELSE) == false) {
+			fail("Third element was not an else: "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+	}	
+	
+
+	public void testSetElseReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "<else>"+
+		       "<sequence/>"+
+		       "</else>"+
+		       "</if>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		If component=new If(model, ifelem);
+
+		if (component.getElsePath() == null) {
+			fail("Should have else path");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		If sub=new If(model);
+		Else elseElem=new Else(model);
+		elseElem.setActivity(sub);
+		
+		component.setElsePath(elseElem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(Else.ELSE) == false) {
+			fail("Third element was not an else: "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(2).getFirstChild() == null) {
+			fail("Third element has no child");
+		}
+
+		if (component.getDOMElement().getChildNodes().item(2).getFirstChild().
+				getLocalName().equals(If.IF) == false) {
+			fail("Third element child was not an if: "+
+					component.getDOMElement().getChildNodes().item(2).
+							getFirstChild().getLocalName());
+		}
+	}	
+	
+	public void testGetURIIf() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+					"<sequence>"+
+		       		"<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				       "<condition/>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+				       "<elseif>"+
+				       "<condition/>"+
+			       			"<sequence>"+
+			       				"<invoke/>"+
+			       			"</sequence>"+
+				       "</elseif>"+
+				       "<elseif>"+
+				       "<condition/>"+
+		       				"<sequence>"+
+		       					"<reply/>"+
+		       				"</sequence>"+
+				       "</elseif>"+
+				       "<else>"+
+		       				"<sequence>"+
+		       					"<throw/>"+
+		       				"</sequence>"+
+				       "</else>"+
+				     "</if>"+
+			       "</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Sequence) == false) {
+			fail("Top level activity is not Sequence");
+		}
+		
+		Sequence seq=(Sequence)topact;
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Should have 1 activity: "+seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof If) == false) {
+			fail("Activty should be If");
+		}
+		
+		If ifelem=(If)seq.getActivities().get(0);
+		
+		if ((ifelem.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence innerseq=(Sequence)ifelem.getActivity();
+		
+		if (innerseq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+					innerseq.getActivities().size());
+		}
+		
+		if ((innerseq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)innerseq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.0/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+
+	public void testGetURIIfElseIf() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+					"<sequence>"+
+		       		"<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				       "<condition/>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+				       "<elseif>"+
+				       "<condition/>"+
+			       			"<sequence>"+
+			       				"<invoke/>"+
+			       			"</sequence>"+
+				       "</elseif>"+
+				       "<elseif>"+
+				       "<condition/>"+
+		       				"<sequence>"+
+		       					"<reply/>"+
+		       				"</sequence>"+
+				       "</elseif>"+
+				       "<else>"+
+		       				"<sequence>"+
+		       					"<throw/>"+
+		       				"</sequence>"+
+				       "</else>"+
+				     "</if>"+
+			       "</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Sequence) == false) {
+			fail("Top level activity is not Sequence");
+		}
+		
+		Sequence seq=(Sequence)topact;
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Should have 1 activity: "+seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof If) == false) {
+			fail("Activty should be If");
+		}
+		
+		If ifelem=(If)seq.getActivities().get(0);
+
+		if (ifelem.getElseIfPaths().size() != 2) {
+			fail("Expecting 2 elseIf paths: "+ifelem.getElseIfPaths().size());
+		}
+		
+		Elseif eif=ifelem.getElseIfPaths().get(1);
+		
+		if ((eif.getActivity() instanceof Sequence) == false) {
+			fail("ElseIf activity not a sequence");
+		}
+		
+		Sequence innerseq=(Sequence)eif.getActivity();
+		
+		if (innerseq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+					innerseq.getActivities().size());
+		}
+		
+		if ((innerseq.getActivities().get(0) instanceof Reply) == false) {
+			fail("First activity should be Reply");
+		}
+		
+		Reply reply=(Reply)innerseq.getActivities().get(0);
+		
+		String uri=reply.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.0/@elseif.1/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+
+	public void testGetURIIfElse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+					"<sequence>"+
+		       		"<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				       "<condition/>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+				       "<elseif>"+
+				       "<condition/>"+
+			       			"<sequence>"+
+			       				"<invoke/>"+
+			       			"</sequence>"+
+				       "</elseif>"+
+				       "<elseif>"+
+				       "<condition/>"+
+		       				"<sequence>"+
+		       					"<reply/>"+
+		       				"</sequence>"+
+				       "</elseif>"+
+				       "<else>"+
+		       				"<sequence>"+
+		       					"<throw/>"+
+		       				"</sequence>"+
+				       "</else>"+
+				     "</if>"+
+			       "</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Sequence) == false) {
+			fail("Top level activity is not Sequence");
+		}
+		
+		Sequence seq=(Sequence)topact;
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Should have 1 activity: "+seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof If) == false) {
+			fail("Activty should be If");
+		}
+		
+		If ifelem=(If)seq.getActivities().get(0);
+
+		if (ifelem.getElsePath() == null) {
+			fail("Else not set");
+		}
+		
+		Else els=ifelem.getElsePath();
+		
+		if ((els.getActivity() instanceof Sequence) == false) {
+			fail("Else activity not a sequence");
+		}
+		
+		Sequence innerseq=(Sequence)els.getActivity();
+		
+		if (innerseq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+					innerseq.getActivities().size());
+		}
+		
+		if ((innerseq.getActivities().get(0) instanceof Throw) == false) {
+			fail("First activity should be Throw");
+		}
+		
+		Throw thr=(Throw)innerseq.getActivities().get(0);
+		
+		String uri=thr.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.0/@else/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/InvokeTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/InvokeTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/InvokeTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,119 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Invoke;
+
+import junit.framework.TestCase;
+
+public class InvokeTest extends TestCase {
+
+	public void testIsActivity() {
+		Invoke act=
+			new Invoke(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String iv="testIV";
+		String ov="testOV";
+		
+		String xml="<invoke xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "inputVariable=\""+iv+"\" "+
+		       "outputVariable=\""+ov+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Invoke component=new Invoke(model, elem);		
+		
+		if (component.getInputVariable().equals(iv) == false) {
+			fail("Input variable not correct, expecting '"+iv+"': "+
+							component.getInputVariable());
+		}
+		
+		if (component.getOutputVariable().equals(ov) == false) {
+			fail("Output variable not correct, expecting '"+ov+"': "+
+							component.getOutputVariable());
+		}
+	}
+	
+	public void testGetInputVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Invoke component=new Invoke(model);		
+		
+		if (component.getInputVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setInputVariable(var);
+		
+		if (component.getInputVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getInputVariable());
+		}
+	}
+	
+	public void testGetOutputVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Invoke component=new Invoke(model);		
+		
+		if (component.getOutputVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setOutputVariable(var);
+		
+		if (component.getOutputVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getOutputVariable());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnAlarmTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnAlarmTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnAlarmTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,914 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.For;
+import org.savara.bpel.model.component.OnAlarm;
+import org.savara.bpel.model.component.Scope;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.Until;
+
+import junit.framework.TestCase;
+
+public class OnAlarmTest extends TestCase {
+
+	public void testIsActivity() {
+		OnAlarm act=new OnAlarm(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildOnAlarmUntil() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+	       		"<until>"+expr1+"</until>"+
+				"<scope/></onAlarm>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should is set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+	}
+	
+	public void testBuildOnAlarmFor() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<for>"+expr1+"</for>"+
+		       "<scope/>"+
+		       "</onAlarm>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("For condition should is set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+	}
+
+	public void testSetUntilNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</until>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Until condition=new Until(model, elem);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setUntil(condition);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetUntilReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</until>";
+	
+		String xml2="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</until>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Until condition1=new Until(model, elem1);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setUntil(condition1);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Until condition2=new Until(model, elem2);
+		
+		component.setUntil(condition2);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getFor() != null) {
+			fail("For condition should still not be set");
+		}
+		
+		result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetForNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</for>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		For condition=new For(model, elem);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setFor(condition);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetForReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</for>";
+	
+		String xml2="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</for>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		For condition1=new For(model, elem1);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setFor(condition1);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		For condition2=new For(model, elem2);
+		
+		component.setFor(condition2);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getUntil() != null) {
+			fail("Until condition should still not be set");
+		}
+		
+		result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetForThenUntil() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</for>";
+	
+		String xml2="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</until>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		For condition1=new For(model, elem1);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setFor(condition1);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Until condition2=new Until(model, elem2);
+		
+		component.setUntil(condition2);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getFor() != null) {
+			fail("For condition should still not be set");
+		}
+		
+		result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetUntilThenFor() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</until>";
+	
+		String xml2="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</for>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Until condition1=new Until(model, elem1);
+		
+		OnAlarm component=new OnAlarm(model);
+		
+		component.setUntil(condition1);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		For condition2=new For(model, elem2);
+		
+		component.setFor(condition2);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getUntil() != null) {
+			fail("Until condition should still not be set");
+		}
+		
+		result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testAddActivityOnAlarmUntil() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+	       		"<until>"+expr1+"</until>"+
+				"</onAlarm>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should is set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		Scope sub=new Scope(model);
+		component.setActivity(sub);
+
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Scope.SCOPE) == false) {
+			fail("Second element was not a scope: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+	public void testAddActivityOnAlarmFor() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+	       		"<for>"+expr1+"</for>"+
+				"</onAlarm>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should is set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		Scope sub=new Scope(model);
+		component.setActivity(sub);
+
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Scope.SCOPE) == false) {
+			fail("Second element was not a Scope: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+	public void testAddForOnAlarm() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<scope/>"+
+				"</onAlarm>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		For cond=new For(model);
+		cond.setExpression(expr1);
+		
+		component.setFor(cond);
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(For.FOR) == false) {
+			fail("First element was not a 'for': "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Scope.SCOPE) == false) {
+			fail("Second element was not a Scope: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+	public void testAddUntilOnAlarm() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<scope/>"+
+				"</onAlarm>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnAlarm component=new OnAlarm(model, elem);		
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		Until cond=new Until(model);
+		cond.setExpression(expr1);
+		
+		component.setUntil(cond);
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(Until.UNTIL) == false) {
+			fail("First element was not a 'until': "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Scope.SCOPE) == false) {
+			fail("Second element was not a Scope: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnEventTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnEventTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnEventTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.OnEvent;
+
+import junit.framework.TestCase;
+
+public class OnEventTest extends TestCase {
+
+	public void testIsActivity() {
+		OnEvent act=new OnEvent(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildEHOnEvent() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String op="testOp";
+		String portType="testPortType";
+		String partnerLink="testPartnerLink";
+
+		String xml="<onEvent xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" " +
+			       "operation=\""+op+"\" "+
+			       "partnerLink=\""+partnerLink+"\" "+
+			       "portType=\""+portType+"\" "+
+	       			"variable=\""+var+"\" "+
+	       			" >"+
+				"<scope/></onEvent>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnEvent component=new OnEvent(model, elem);		
+		
+		if (component.getScope() == null) {
+			fail("No scope");
+		}
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+		
+		if (component.getPartnerLink().equals(partnerLink) == false) {
+			fail("PartnerLink not correct, expecting '"+partnerLink+"': "+
+							component.getPartnerLink());
+		}
+		
+		if (component.getPortType().equals(portType) == false) {
+			fail("Port type not correct, expecting '"+portType+"': "+
+							component.getPortType());
+		}
+	}
+
+	public void testGetVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		OnEvent component=new OnEvent(model);		
+		
+		if (component.getVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setVariable(var);
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+	}
+
+	public void testGetOperation() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String op="testOp";
+		
+		OnEvent component=new OnEvent(model);		
+		
+		if (component.getOperation() != null) {
+			fail("Should be null");
+		}
+		
+		component.setOperation(op);
+		
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+	}
+	
+	public void testGetPortType() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pt="testPortType";
+		
+		OnEvent component=new OnEvent(model);		
+		
+		if (component.getPortType() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPortType(pt);
+		
+		if (component.getPortType().equals(pt) == false) {
+			fail("Port type not correct, expecting '"+pt+"': "+
+							component.getPortType());
+		}
+	}
+	
+	public void testGetPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pl="testPartnerLink";
+		
+		OnEvent component=new OnEvent(model);		
+		
+		if (component.getPartnerLink() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPartnerLink(pl);
+		
+		if (component.getPartnerLink().equals(pl) == false) {
+			fail("Partner link not correct, expecting '"+pl+"': "+
+							component.getPartnerLink());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnMessageTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnMessageTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/OnMessageTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,180 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.OnMessage;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class OnMessageTest extends TestCase {
+
+	public void testIsActivity() {
+		OnMessage act=new OnMessage(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildOnMessage() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String op="testOp";
+		String portType="testPortType";
+		String partnerLink="testPartnerLink";
+
+		String xml="<onMessage xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" " +
+			       "operation=\""+op+"\" "+
+			       "partnerLink=\""+partnerLink+"\" "+
+			       "portType=\""+portType+"\" "+
+	       			"variable=\""+var+"\" "+
+	       			" >"+
+				"<sequence/></onMessage>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		OnMessage component=new OnMessage(model, elem);		
+		
+		if (component.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+		
+		if (component.getPartnerLink().equals(partnerLink) == false) {
+			fail("PartnerLink not correct, expecting '"+partnerLink+"': "+
+							component.getPartnerLink());
+		}
+		
+		if (component.getPortType().equals(portType) == false) {
+			fail("Port type not correct, expecting '"+portType+"': "+
+							component.getPortType());
+		}
+	}
+
+	public void testGetVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		OnMessage component=new OnMessage(model);		
+		
+		if (component.getVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setVariable(var);
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+	}
+
+	public void testGetOperation() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String op="testOp";
+		
+		OnMessage component=new OnMessage(model);		
+		
+		if (component.getOperation() != null) {
+			fail("Should be null");
+		}
+		
+		component.setOperation(op);
+		
+		if (component.getOperation().equals(op) == false) {
+			fail("Operation not correct, expecting '"+op+"': "+
+							component.getOperation());
+		}
+	}
+	
+	public void testGetPortType() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pt="testPortType";
+		
+		OnMessage component=new OnMessage(model);		
+		
+		if (component.getPortType() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPortType(pt);
+		
+		if (component.getPortType().equals(pt) == false) {
+			fail("Port type not correct, expecting '"+pt+"': "+
+							component.getPortType());
+		}
+	}
+	
+	public void testGetPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pl="testPartnerLink";
+		
+		OnMessage component=new OnMessage(model);		
+		
+		if (component.getPartnerLink() != null) {
+			fail("Should be null");
+		}
+		
+		component.setPartnerLink(pl);
+		
+		if (component.getPartnerLink().equals(pl) == false) {
+			fail("Partner link not correct, expecting '"+pl+"': "+
+							component.getPartnerLink());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PartnerLinkTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PartnerLinkTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PartnerLinkTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,170 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.PartnerLink;
+
+import junit.framework.TestCase;
+
+public class PartnerLinkTest extends TestCase {
+
+	public void testIsActivity() {
+		PartnerLink act=new PartnerLink(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String partnerRole="testPartnerRole";
+		String name="testName";
+		String myRole="testMyRole";
+		String partnerLinkType="testPartnerLinkType";
+
+		String xml="<partnerLink xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" " +
+			       "name=\""+name+"\" "+
+			       "partnerLinkType=\""+partnerLinkType+"\" "+
+			       "myRole=\""+myRole+"\" "+
+	       			"partnerRole=\""+partnerRole+"\" "+
+	       			" />";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		PartnerLink component=new PartnerLink(model, elem);		
+		
+		if (component.getPartnerRole().equals(partnerRole) == false) {
+			fail("PartnerRole not correct, expecting '"+partnerRole+"': "+
+							component.getPartnerRole());
+		}
+
+		if (component.getName().equals(name) == false) {
+			fail("Name not correct, expecting '"+name+"': "+
+							component.getName());
+		}
+		
+		if (component.getPartnerLinkType().equals(partnerLinkType) == false) {
+			fail("PartnerLinkType not correct, expecting '"+partnerLinkType+"': "+
+							component.getPartnerLinkType());
+		}
+		
+		if (component.getMyRole().equals(myRole) == false) {
+			fail("MyRole not correct, expecting '"+myRole+"': "+
+							component.getMyRole());
+		}
+	}
+
+	public void testGetName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String name="testName";
+		
+		PartnerLink component=new PartnerLink(model);		
+		
+		if (component.getName() != null) {
+			fail("Name should be null");
+		}
+		
+		component.setName(name);
+		
+		if (component.getName().equals(name) == false) {
+			fail("Name not correct, expecting '"+name+"': "+
+							component.getName());
+		}
+	}
+
+	public void testGetPartnerLinkType() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String plt="testPartnerLinkType";
+		
+		PartnerLink component=new PartnerLink(model);	
+		
+		if (component.getPartnerLinkType() != null) {
+			fail("Partner link type should be null");
+		}
+		
+		component.setPartnerLinkType(plt);
+		
+		if (component.getPartnerLinkType().equals(plt) == false) {
+			fail("PartnerLinkType not correct, expecting '"+plt+"': "+
+							component.getPartnerLinkType());
+		}
+	}
+	
+	public void testGetMyRole() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String mr="testMyRole";
+		
+		PartnerLink component=new PartnerLink(model);
+		
+		if (component.getMyRole() != null) {
+			fail("My role is not null");
+		}
+		
+		component.setMyRole(mr);
+		
+		if (component.getMyRole().equals(mr) == false) {
+			fail("MyRole not correct, expecting '"+mr+"': "+
+							component.getMyRole());
+		}
+	}
+	
+	public void testGetPartnerRole() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String pr="testPartnerRole";
+		
+		PartnerLink component=new PartnerLink(model);	
+		
+		if (component.getPartnerRole() != null) {
+			fail("Partner role should be null");
+		}
+		
+		component.setPartnerRole(pr);
+		
+		if (component.getPartnerRole().equals(pr) == false) {
+			fail("PartnerRole not correct, expecting '"+pr+"': "+
+							component.getPartnerRole());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PickTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PickTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/PickTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,423 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.OnAlarm;
+import org.savara.bpel.model.component.OnMessage;
+import org.savara.bpel.model.component.Pick;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Scope;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class PickTest extends TestCase {
+
+	public void testIsActivity() {
+		Pick act=new Pick(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testPickFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<pick xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<onMessage/>"+
+		       "<onMessage/>"+
+		       "<onAlarm/>"+
+		       "</pick>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Pick component=new Pick(model, elem);		
+		
+		if (component.getOnMessages().size() != 2) {
+			fail("Expecting 2 onMessage: "+
+							component.getOnMessages().size());
+		}
+		
+		if (component.getOnAlarms().size() != 1) {
+			fail("Expecting 1 onAlarm: "+
+							component.getOnAlarms().size());
+		}
+	}
+
+	public void testAddOnMessageToPickInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<pick xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<onAlarm/>"+
+	       		"<onAlarm/>"+
+	       		"</pick>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Pick component=new Pick(model, elem);		
+		
+		if (component.getOnAlarms().size() != 2) {
+			fail("Expecting 2 onAlarms: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getOnMessages().size() != 0) {
+			fail("Expecting 0 onMessages: "+
+							component.getOnMessages().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		OnMessage sub=new OnMessage(model);
+		
+		component.addOnMessage(sub, 0);
+		
+		if (component.getOnMessages().size() != 1) {
+			fail("Expecting 1 onMessage: "+
+							component.getOnMessages().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(OnMessage.ONMESSAGE) == false) {
+			fail("Second element was not a 'onMessage': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+
+	public void testAddOnAlarmToPickInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<pick xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<onMessage/>"+
+	       		"<onMessage/>"+
+	       		"</pick>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Pick component=new Pick(model, elem);		
+		
+		if (component.getOnMessages().size() != 2) {
+			fail("Expecting 2 onMessages: "+
+							component.getOnMessages().size());
+		}
+		
+		if (component.getOnAlarms().size() != 0) {
+			fail("Expecting 0 onAlarms: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		OnAlarm sub=new OnAlarm(model);
+		
+		component.addOnAlarm(sub, 0);
+		
+		if (component.getOnAlarms().size() != 1) {
+			fail("Expecting 1 onAlarm: "+
+							component.getOnAlarms().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(3).
+				getLocalName().equals(OnAlarm.ONALARM) == false) {
+			fail("Second element was not a 'onAlarm': "+
+					component.getDOMElement().getChildNodes().item(3).
+									getLocalName());
+		}
+	}
+	
+	public void testGetURIOnAlarm() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<sequence>"+
+		       		"<pick>"+
+						"<onAlarm>"+
+							"<scope>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+			       			"</scope>"+
+						"</onAlarm>"+
+			       "</pick>"+
+	       		"</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Sequence) == false) {
+			fail("Top level activity is not Sequence");
+		}
+		
+		Sequence topseq=(Sequence)topact;
+		
+		if (topseq.getActivities().size() != 1) {
+			fail("Top sequence should have 1 activity");
+		}
+		
+		if ((topseq.getActivities().get(0) instanceof Pick) == false) {
+			fail("Activity is not Pick");
+		}
+		
+		Pick pick=(Pick)topseq.getActivities().get(0);
+		
+		OnAlarm one=pick.getOnAlarms().get(0);
+		
+		if ((one.getActivity() instanceof Scope) == false) {
+			fail("Activity is not scope");
+		}
+		
+		Scope innerScope=(Scope)one.getActivity();
+		
+		if (innerScope == null) {
+			fail("Inner scope not set");
+		}
+		
+		if ((innerScope.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)innerScope.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.0/@onAlarm.0/@scope/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+	
+	public void testGetURIOnMessage() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<sequence>"+
+		       		"<pick>"+
+						"<onMessage>"+
+							"<scope>"+
+				       		"<sequence>"+
+				       			"<receive/>"+
+			       			"</sequence>"+
+			       			"</scope>"+
+						"</onMessage>"+
+			       "</pick>"+
+	       		"</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof Sequence) == false) {
+			fail("Top level activity is not Sequence");
+		}
+		
+		Sequence topseq=(Sequence)topact;
+		
+		if (topseq.getActivities().size() != 1) {
+			fail("Top sequence should have 1 activity");
+		}
+		
+		if ((topseq.getActivities().get(0) instanceof Pick) == false) {
+			fail("Activity is not Pick");
+		}
+		
+		Pick pick=(Pick)topseq.getActivities().get(0);
+		
+		OnMessage one=pick.getOnMessages().get(0);
+		
+		if ((one.getActivity() instanceof Scope) == false) {
+			fail("Activity is not scope");
+		}
+		
+		Scope innerScope=(Scope)one.getActivity();
+		
+		if (innerScope == null) {
+			fail("Inner scope not set");
+		}
+		
+		if ((innerScope.getActivity() instanceof Sequence) == false) {
+			fail("Inner scope activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)innerScope.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Expecting 1 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.0/@onMessage.0/@activity/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ProcessTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ProcessTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ProcessTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,440 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.EventHandlers;
+import org.savara.bpel.model.component.FaultHandlers;
+import org.savara.bpel.model.component.PartnerLink;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.Variable;
+
+import junit.framework.TestCase;
+
+public class ProcessTest extends TestCase {
+
+	public void testIsActivity() {
+		Process act=new Process(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testProcessFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<messageExchanges/>"+
+				"<variables><variable/></variables>"+
+				"<correlationSets/>"+
+				"<faultHandlers/>"+
+				"<eventHandlers/>"+
+				"<sequence/>"+
+	       "</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);
+		
+		if (component.getPartnerLinks().size() != 1) {
+			fail("Expecting 1 partner link: "+component.getPartnerLinks().size());
+		}
+		
+		if (component.getVariables().size() != 1) {
+			fail("Expecting 1 variable: "+component.getVariables().size());
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not defined");
+		}
+		
+		if (component.getEventHandlers() == null) {
+			fail("Event handlers not defined");
+		}
+		
+		if (component.getFaultHandlers() == null) {
+			fail("Fault handlers not defined");
+		}
+	}
+	
+	public void testAddVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<partnerLinks><partnerLink/></partnerLinks>"+
+			"<messageExchanges/>"+
+			"<correlationSets/>"+
+			"<faultHandlers/>"+
+			"<eventHandlers/>"+
+			"<sequence/>"+
+		   "</process>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, ifelem);
+
+		if (component.getVariables().size() != 0) {
+			fail("Should be no variables");
+		}
+		
+		Variable var=new Variable(model);
+		component.addVariable(var, 0);
+		
+		if (component.getVariables().size() != 1) {
+			fail("Should be one variable: "+component.getVariables().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(2).getLocalName().equals("variables") == false) {
+			fail("Child 2 not as expected: "+component.getDOMElement().getChildNodes().
+					item(2).getLocalName());
+		}
+	}	
+	
+	public void testAddPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<messageExchanges/>"+
+			"<variables><variable/></variables>"+
+			"<correlationSets/>"+
+			"<faultHandlers/>"+
+			"<eventHandlers/>"+
+			"<sequence/>"+
+		   "</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);
+
+		if (component.getPartnerLinks().size() != 0) {
+			fail("Should be no partner links");
+		}
+		
+		PartnerLink pl=new PartnerLink(model);
+		component.addPartnerLink(pl, 0);
+		
+		if (component.getPartnerLinks().size() != 1) {
+			fail("Should be one partner link: "+component.getPartnerLinks().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(0).getLocalName().equals("partnerLinks") == false) {
+			fail("Child 0 not as expected: "+component.getDOMElement().getChildNodes().
+					item(0).getLocalName());
+		}
+	}	
+	
+	public void testGetPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Process component=new Process(model);
+		String name="testName";
+		
+		PartnerLink pl=new PartnerLink(model);
+		pl.setName(name);
+		
+		component.addPartnerLink(pl, 0);
+		
+		if (component.getPartnerLink(name) == null) {
+			fail("Failed to get partner link for '"+name+"'");
+		}
+		
+		if (component.getPartnerLink("unknown") != null) {
+			fail("Should not have returned a partner link");
+		}
+	}	
+
+	public void testSetEventHandlers() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<partnerLinks><partnerLink/></partnerLinks>"+
+			"<messageExchanges/>"+
+			"<variables><variable/></variables>"+
+			"<correlationSets/>"+
+			"<faultHandlers/>"+
+			"<sequence/>"+
+		   "</process>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, ifelem);
+
+		if (component.getEventHandlers() != null) {
+			fail("Should be null");
+		}
+		
+		EventHandlers elem=new EventHandlers(model);
+		component.setEventHandlers(elem);
+		
+		if (component.getEventHandlers() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(5).getLocalName().equals("eventHandlers") == false) {
+			fail("Child 5 not as expected: "+component.getDOMElement().getChildNodes().
+					item(5).getLocalName());
+		}
+	}	
+	
+	public void testSetFaultHandlers() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			"<partnerLinks><partnerLink/></partnerLinks>"+
+			"<messageExchanges/>"+
+			"<variables><variable/></variables>"+
+			"<correlationSets/>"+
+			"<eventHandlers/>"+
+			"<sequence/>"+
+		   "</process>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, ifelem);
+
+		if (component.getFaultHandlers() != null) {
+			fail("Should be null");
+		}
+		
+		FaultHandlers elem=new FaultHandlers(model);
+		component.setFaultHandlers(elem);
+		
+		if (component.getFaultHandlers() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(4).getLocalName().equals("faultHandlers") == false) {
+			fail("Child 4 not as expected: "+component.getDOMElement().getChildNodes().
+					item(4).getLocalName());
+		}
+	}	
+
+	public void testSetActivity() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<messageExchanges/>"+
+				"<variables><variable/></variables>"+
+				"<correlationSets/>"+
+				"<faultHandlers/>"+
+				"<eventHandlers/>"+
+		   "</process>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Should be null");
+		}
+		
+		Sequence elem=new Sequence(model);
+		component.setActivity(elem);
+		
+		if (component.getActivity() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(6).getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("Child 6 not as expected: "+component.getDOMElement().getChildNodes().
+					item(6).getLocalName());
+		}
+	}	
+
+	public void testAddDistinctNamespaces() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Process component=new Process(model);
+
+		String prefix1=component.addNamespace("namespace1");
+		String prefix2=component.addNamespace("namespace2");
+		
+		if (prefix1 == null) {
+			fail("First prefix is null");
+		}
+		
+		if (prefix2 == null) {
+			fail("Second prefix is null");
+		}
+		
+		if (prefix1.equals(prefix2)) {
+			fail("Prefixes should be different: "+prefix1+" "+prefix2);
+		}
+	}
+	
+	public void testAddSameNamespaces() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Process component=new Process(model);
+
+		String prefix1=component.addNamespace("namespace1");
+		String prefix2=component.addNamespace("namespace1");
+		
+		if (prefix1 == null) {
+			fail("First prefix is null");
+		}
+		
+		if (prefix2 == null) {
+			fail("Second prefix is null");
+		}
+		
+		if (prefix1.equals(prefix2) == false) {
+			fail("Prefixes should be same: "+prefix1+" "+prefix2);
+		}
+	}
+	
+	public void testDefaultNamesapces() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Process component=new Process(model);
+		
+		String ns=component.getNamespace(Process.BPEL_PREFIX);
+		
+		if (ns == null) {
+			fail("Namespace not found");
+		}
+		
+		if (ns.equals(Process.BPEL_NS) == false) {
+			fail("Namespace is wrong: "+ns+" was expecting "+Process.BPEL_NS);
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReceiveTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReceiveTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReceiveTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,200 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Receive;
+
+import junit.framework.TestCase;
+
+public class ReceiveTest extends TestCase {
+
+	public void testIsActivity() {
+		Receive act=
+			new Receive(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String create="yes";
+		
+		String xml="<receive xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "variable=\""+var+"\" "+
+		       "createInstance=\""+create+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Receive component=new Receive(model, elem);		
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+		
+		if (component.getCreateInstance() == false) {
+			fail("createInstance not correct, expecting 'true': "+
+							component.getCreateInstance());
+		}
+	}
+
+	public void testGetVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Receive component=new Receive(model);		
+		
+		if (component.getVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setVariable(var);
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+	}
+
+	public void testCreateInstanceFromDOMTrue() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String value="yes";
+		
+		String xml="<activity xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "createInstance=\""+value+"\" />";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Receive component=new Receive(model, elem);		
+		
+		if (component.getCreateInstance() == false) {
+			fail("'Suppress Join Failure' not correct, expecting 'true': "+
+							component.getCreateInstance());
+		}
+	}
+	
+	public void testCreateInstanceFromDOMFalse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String value="no";
+		
+		String xml="<activity xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "createInstance=\""+value+"\" />";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Receive component=new Receive(model, elem);		
+		
+		if (component.getCreateInstance() == true) {
+			fail("'Suppress Join Failure' not correct, expecting 'false': "+
+							component.getCreateInstance());
+		}
+	}
+	
+	public void testGetCreateInstanceTrue() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Receive component=new Receive(model);		
+		
+		component.setCreateInstance(true);
+		
+		if (component.getCreateInstance() == false) {
+			fail("'Suppress Join Failure' not correct, expecting 'true': "+
+							component.getCreateInstance());
+		}
+	}
+	
+	public void testGetCreateInstanceFalse() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		Receive component=new Receive(model);		
+		
+		component.setCreateInstance(false);
+		
+		if (component.getCreateInstance() == true) {
+			fail("'Suppress Join Failure' not correct, expecting 'false': "+
+							component.getCreateInstance());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RepeatUntilTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RepeatUntilTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RepeatUntilTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,480 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Condition;
+import org.savara.bpel.model.component.If;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.RepeatUntil;
+import org.savara.bpel.model.component.Sequence;
+
+import junit.framework.TestCase;
+
+public class RepeatUntilTest extends TestCase {
+
+	public void testIsActivity() {
+		RepeatUntil act=new RepeatUntil(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<sequence/>"+
+		       "<condition>"+expr1+"</condition>"+
+		       "</repeatUntil>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		RepeatUntil component=new RepeatUntil(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not set");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity not a sequence");
+		}
+	}
+	
+	public void testSetActivityInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<targets/>"+
+				"<condition>"+expr1+"</condition>"+
+		       "</repeatUntil>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		RepeatUntil component=new RepeatUntil(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getActivity() != null) {
+			fail("Activity should be null");
+		}
+
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		If sub=new If(model);
+		
+		component.setActivity(sub);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(If.IF) == false) {
+			fail("Second element was not an 'if': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+	
+	public void testSetConditionNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</condition>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);
+		
+		RepeatUntil component=new RepeatUntil(model);
+		
+		component.setCondition(condition);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetConditionReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</condition>";
+	
+		String xml2="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</condition>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		RepeatUntil component=new RepeatUntil(model);
+		
+		component.setCondition(condition1);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setCondition(condition2);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetActivityNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "</repeatUntil>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		RepeatUntil component=new RepeatUntil(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Activity should be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("One child element expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		
+		component.setActivity(seq);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("First element was not a sequence: "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+	}	
+	
+	public void testSetActivityReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<sequence/>"+
+		        "<condition/>"+
+		        "</repeatUntil>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		RepeatUntil component=new RepeatUntil(model, ifelem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		If sub=new If(model);
+		
+		component.setActivity(sub);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(0).
+				getLocalName().equals(If.IF) == false) {
+			fail("First element was not an 'if': "+
+					component.getDOMElement().getChildNodes().item(0).
+									getLocalName());
+		}
+	}	
+
+	public void testGetURI() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+					"<repeatUntil xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       		"<sequence>"+
+	       			"<receive/>"+
+       			"</sequence>"+
+		       "</repeatUntil>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof RepeatUntil) == false) {
+			fail("Top level activity is not RepeatUntil");
+		}
+		
+		RepeatUntil top=(RepeatUntil)topact;
+		
+		if (top.getActivity() == null) {
+			fail("While activity is null");
+		}
+		
+		if ((top.getActivity() instanceof Sequence) == false) {
+			fail("While activity is not sequence");
+		}
+		
+		Sequence seq=(Sequence)top.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Should have 1 activity: "+seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("Activty should be Receive");
+		}
+				
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReplyTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReplyTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ReplyTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,119 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Reply;
+
+import junit.framework.TestCase;
+
+public class ReplyTest extends TestCase {
+
+	public void testIsActivity() {
+		Reply act=
+			new Reply(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String fault="testFault";
+		
+		String xml="<reply xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "variable=\""+var+"\" "+
+		       "faultName=\""+fault+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Reply component=new Reply(model, elem);		
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+		
+		if (component.getFaultName().equals(fault) == false) {
+			fail("Fault not correct, expecting '"+fault+"': "+
+							component.getFaultName());
+		}
+	}
+
+	public void testGetVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Reply component=new Reply(model);		
+		
+		if (component.getVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setVariable(var);
+		
+		if (component.getVariable().equals(var) == false) {
+			fail("Variable not correct, expecting '"+var+"': "+
+							component.getVariable());
+		}
+	}
+
+	public void testGetFaultName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String fault="testFault";
+		
+		Reply component=new Reply(model);		
+		
+		if (component.getFaultName() != null) {
+			fail("Should be null");
+		}
+		
+		component.setFaultName(fault);
+		
+		if (component.getFaultName().equals(fault) == false) {
+			fail("Fault name not correct, expecting '"+fault+"': "+
+							component.getFaultName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RethrowTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RethrowTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/RethrowTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,35 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Rethrow;
+
+import junit.framework.TestCase;
+
+public class RethrowTest extends TestCase {
+
+	public void testIsActivity() {
+		Rethrow act=
+			new Rethrow(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ScopeTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ScopeTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ScopeTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,494 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.CompensationHandler;
+import org.savara.bpel.model.component.EventHandlers;
+import org.savara.bpel.model.component.FaultHandlers;
+import org.savara.bpel.model.component.PartnerLink;
+import org.savara.bpel.model.component.Scope;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.TerminationHandler;
+import org.savara.bpel.model.component.Variable;
+
+import junit.framework.TestCase;
+
+public class ScopeTest extends TestCase {
+
+	public void testIsActivity() {
+		Scope act=new Scope(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testScopeFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+	       "</scope>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, elem);
+		
+		if (component.getPartnerLinks().size() != 1) {
+			fail("Expecting 1 partner link: "+component.getPartnerLinks().size());
+		}
+		
+		if (component.getVariables().size() != 1) {
+			fail("Expecting 1 variable: "+component.getVariables().size());
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not defined");
+		}
+		
+		if (component.getCompensationHandler() == null) {
+			fail("Compensation handler not defined");
+		}
+		
+		if (component.getEventHandlers() == null) {
+			fail("Event handlers not defined");
+		}
+		
+		if (component.getFaultHandlers() == null) {
+			fail("Fault handlers not defined");
+		}
+		
+		if (component.getTerminationHandler() == null) {
+			fail("Termination handler not defined");
+		}
+	}
+	
+	public void testAddVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getVariables().size() != 0) {
+			fail("Should be no variables");
+		}
+		
+		Variable var=new Variable(model);
+		component.addVariable(var, 0);
+		
+		if (component.getVariables().size() != 1) {
+			fail("Should be one variable: "+component.getVariables().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(0).getLocalName().equals("variables") == false) {
+			fail("Child 0 not as expected: "+component.getDOMElement().getChildNodes().
+					item(0).getLocalName());
+		}
+	}	
+	
+	public void testAddPartnerLink() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, elem);
+
+		if (component.getPartnerLinks().size() != 0) {
+			fail("Should be no partner links");
+		}
+		
+		PartnerLink pl=new PartnerLink(model);
+		component.addPartnerLink(pl, 0);
+		
+		if (component.getPartnerLinks().size() != 1) {
+			fail("Should be one partner link: "+component.getPartnerLinks().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(1).getLocalName().equals("partnerLinks") == false) {
+			fail("Child 1 not as expected: "+component.getDOMElement().getChildNodes().
+					item(1).getLocalName());
+		}
+	}	
+	
+	public void testSetEventHandlers() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getEventHandlers() != null) {
+			fail("Should be null");
+		}
+		
+		EventHandlers elem=new EventHandlers(model);
+		component.setEventHandlers(elem);
+		
+		if (component.getEventHandlers() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(4).getLocalName().equals("eventHandlers") == false) {
+			fail("Child 4 not as expected: "+component.getDOMElement().getChildNodes().
+					item(4).getLocalName());
+		}
+	}	
+	
+	public void testSetFaultHandlers() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getFaultHandlers() != null) {
+			fail("Should be null");
+		}
+		
+		FaultHandlers elem=new FaultHandlers(model);
+		component.setFaultHandlers(elem);
+		
+		if (component.getFaultHandlers() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(5).getLocalName().equals("faultHandlers") == false) {
+			fail("Child 5 not as expected: "+component.getDOMElement().getChildNodes().
+					item(5).getLocalName());
+		}
+	}	
+	
+	public void testSetCompensationHandler() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<terminationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getCompensationHandler() != null) {
+			fail("Should be null");
+		}
+		
+		CompensationHandler elem=new CompensationHandler(model);
+		component.setCompensationHandler(elem);
+		
+		if (component.getCompensationHandler() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(6).getLocalName().equals("compensationHandler") == false) {
+			fail("Child 6 not as expected: "+component.getDOMElement().getChildNodes().
+					item(6).getLocalName());
+		}
+	}	
+	
+	public void testSetTerminationHandler() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<sequence/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getTerminationHandler() != null) {
+			fail("Should be null");
+		}
+		
+		TerminationHandler elem=new TerminationHandler(model);
+		component.setTerminationHandler(elem);
+		
+		if (component.getTerminationHandler() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(7).getLocalName().equals("terminationHandler") == false) {
+			fail("Child 7 not as expected: "+component.getDOMElement().getChildNodes().
+					item(7).getLocalName());
+		}
+	}	
+	
+	public void testSetActivity() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<scope xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+				"<partnerLinks><partnerLink/></partnerLinks>"+
+				"<variables><variable/></variables>"+
+				"<messageExchanges/>"+
+				"<correlationSets/>"+
+				"<eventHandlers/>"+
+				"<faultHandlers/>"+
+				"<compensationHandler/>"+
+				"<terminationHandler/>"+
+		   "</scope>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Scope component=new Scope(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Should be null");
+		}
+		
+		Sequence elem=new Sequence(model);
+		component.setActivity(elem);
+		
+		if (component.getActivity() == null) {
+			fail("Should NOT be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().
+					item(8).getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("Child 8 not as expected: "+component.getDOMElement().getChildNodes().
+					item(8).getLocalName());
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/SequenceTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/SequenceTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/SequenceTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,337 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Invoke;
+import org.savara.bpel.model.component.Process;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.While;
+
+import junit.framework.TestCase;
+
+public class SequenceTest extends TestCase {
+
+	public void testIsActivity() {
+		Sequence act=new Sequence(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testSequenceFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<sequence xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<if/>"+
+		       "<if/>"+
+		       "</sequence>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Sequence component=new Sequence(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+	}
+
+	public void testAddFirstActToSequenceInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<sequence xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</sequence>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Sequence component=new Sequence(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, 0);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+
+	public void testAddSecondActToSequenceInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<sequence xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</sequence>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Sequence component=new Sequence(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, 1);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(2).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(2).
+									getLocalName());
+		}
+	}
+
+	public void testAddLastActToSequenceInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<sequence xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<targets/>"+
+	       		"<if/>"+
+	       		"<if/>"+
+	       		"</sequence>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Sequence component=new Sequence(model, elem);		
+		
+		if (component.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		While sub=new While(model);
+		
+		component.addActivity(sub, -1);
+		
+		if (component.getActivities().size() != 3) {
+			fail("Expecting 3 child activities: "+
+							component.getActivities().size());
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 4) {
+			fail("Four child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		if (component.getDOMElement().getChildNodes().item(3).
+				getLocalName().equals(While.WHILE) == false) {
+			fail("Second element was not a 'while': "+
+					component.getDOMElement().getChildNodes().item(3).
+									getLocalName());
+		}
+	}
+	
+	public void testGetURI() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		"<sequence>"+
+	       			"<receive/>"+
+	       			"<invoke/>"+
+	       		"</sequence>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		Process component=new Process(model, elem);		
+		
+		BPELActivity act=component.getActivity();
+		
+		if ((act instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+		
+		Sequence seq=(Sequence)act;
+		
+		if (seq.getActivities().size() != 2) {
+			fail("Expecting 2 child activities: "+
+							seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("First activity should be receive");
+		}
+		
+		if ((seq.getActivities().get(1) instanceof Invoke) == false) {
+			fail("Second activity should be invoke");
+		}
+		
+		Invoke invoke=(Invoke)seq.getActivities().get(1);
+		
+		String uri=invoke.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activities.1") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TerminationHandlerTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TerminationHandlerTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TerminationHandlerTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,75 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.TerminationHandler;
+
+import junit.framework.TestCase;
+
+public class TerminationHandlerTest extends TestCase {
+
+	public void testIsActivity() {
+		TerminationHandler act=
+				new TerminationHandler(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildTerminationHandler() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<terminationHandler xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
+				"<sequence/></terminationHandler>";
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+			
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		TerminationHandler construct=new TerminationHandler(model, elem);		
+		
+		if (construct.getActivity() == null) {
+			fail("No activity");
+		}
+		
+		if ((construct.getActivity() instanceof Sequence) == false) {
+			fail("Activity is not a sequence");
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestAbstractInteraction.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestAbstractInteraction.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestAbstractInteraction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,56 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.component.AbstractInteraction;
+import org.savara.bpel.model.component.ConversionContext;
+import org.scribble.protocol.model.Activity;
+import org.w3c.dom.Element;
+
+public class TestAbstractInteraction extends AbstractInteraction {
+
+	private static final long serialVersionUID = 8254837781661826397L;
+
+	public TestAbstractInteraction(BPELLanguageModel model, Element elem) {
+		super(model, elem);
+	}
+	
+	public TestAbstractInteraction(BPELLanguageModel model) {
+		super(model, "test");
+	}
+
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,56 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.ConversionContext;
+import org.scribble.protocol.model.Activity;
+import org.w3c.dom.Element;
+
+public class TestBPELActivity extends BPELActivity {
+
+	private static final long serialVersionUID = 6706918585744310399L;
+
+	public TestBPELActivity(BPELLanguageModel model, Element elem) {
+		super(model, elem);
+	}
+	
+	public TestBPELActivity(BPELLanguageModel model) {
+		super(model, "test");
+	}
+
+	/**
+	 * This method does the actual work of converting the specific
+	 * BPEL activity into an equivalent behavioural description for 
+	 * conformance checking. The 'convert' method provides
+	 * a wrapper around this method, to handle the standard elements
+	 * that can be associated with any BPEL activity.
+	 * 
+	 * @param activities The list of activities that will contain
+	 * 				the converted action(s)
+	 * @param context The conversion context
+	 */
+	protected void convertActivity(java.util.List<Activity> activities,
+			ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELElement.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELElement.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/TestBPELElement.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,46 @@
+/*
+ * 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.model.component;
+
+import java.util.List;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.component.BPELElement;
+import org.savara.bpel.model.component.ConversionContext;
+import org.scribble.protocol.model.Activity;
+import org.w3c.dom.Element;
+
+public class TestBPELElement extends BPELElement {
+
+	private static final long serialVersionUID = 6428569513605691840L;
+
+	public TestBPELElement(BPELLanguageModel model, Element elem) {
+		super(model, elem);
+	}
+	
+	public TestBPELElement(BPELLanguageModel model) {
+		super(model, "test");
+	}
+
+	@Override
+	public void convert(List<Activity> activities, ConversionContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ThrowTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ThrowTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/ThrowTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,119 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Throw;
+
+import junit.framework.TestCase;
+
+public class ThrowTest extends TestCase {
+
+	public void testIsActivity() {
+		Throw act=
+			new Throw(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String fault="testFault";
+		
+		String xml="<throw xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "faultVariable=\""+var+"\" "+
+		       "faultName=\""+fault+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Throw component=new Throw(model, elem);		
+		
+		if (component.getFaultVariable().equals(var) == false) {
+			fail("Fault Variable not correct, expecting '"+var+"': "+
+							component.getFaultVariable());
+		}
+		
+		if (component.getFaultName().equals(fault) == false) {
+			fail("Fault not correct, expecting '"+fault+"': "+
+							component.getFaultName());
+		}
+	}
+
+	public void testGetFaultVariable() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Throw component=new Throw(model);		
+		
+		if (component.getFaultVariable() != null) {
+			fail("Should be null");
+		}
+		
+		component.setFaultVariable(var);
+		
+		if (component.getFaultVariable().equals(var) == false) {
+			fail("Fault Variable not correct, expecting '"+var+"': "+
+							component.getFaultVariable());
+		}
+	}
+
+	public void testGetFaultName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String fault="testFault";
+		
+		Throw component=new Throw(model);		
+		
+		if (component.getFaultName() != null) {
+			fail("Should be null");
+		}
+		
+		component.setFaultName(fault);
+		
+		if (component.getFaultName().equals(fault) == false) {
+			fail("Fault name not correct, expecting '"+fault+"': "+
+							component.getFaultName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/VariableTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/VariableTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/VariableTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,119 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Variable;
+
+import junit.framework.TestCase;
+
+public class VariableTest extends TestCase {
+
+	public void testIsActivity() {
+		Variable act=
+			new Variable(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == true) {
+			fail("Should NOT be an activity");
+		}
+	}
+	
+	public void testBuildFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVar";
+		String type="testType";
+		
+		String xml="<variable xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\" "+
+		       "name=\""+var+"\" "+
+		       "type=\""+type+"\" "+
+		       "/>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Variable component=new Variable(model, elem);		
+		
+		if (component.getName().equals(var) == false) {
+			fail("Variable name not correct, expecting '"+var+"': "+
+							component.getName());
+		}
+		
+		if (component.getType().equals(type) == false) {
+			fail("Type not correct, expecting '"+type+"': "+
+							component.getType());
+		}
+	}
+
+	public void testGetVariableName() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String var="testVariable";
+		
+		Variable component=new Variable(model);		
+		
+		if (component.getName() != null) {
+			fail("Should be null");
+		}
+		
+		component.setName(var);
+		
+		if (component.getName().equals(var) == false) {
+			fail("Variable name not correct, expecting '"+var+"': "+
+							component.getName());
+		}
+	}
+
+	public void testGetType() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String type="testType";
+		
+		Variable component=new Variable(model);		
+		
+		if (component.getType() != null) {
+			fail("Should be null");
+		}
+		
+		component.setType(type);
+		
+		if (component.getType().equals(type) == false) {
+			fail("Type not correct, expecting '"+type+"': "+
+							component.getType());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WaitTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WaitTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WaitTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,621 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.Condition;
+import org.savara.bpel.model.component.Wait;
+
+import junit.framework.TestCase;
+
+public class WaitTest extends TestCase {
+
+	public void testIsActivity() {
+		Wait act=
+			new Wait(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+
+	public void testUntilFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<wait xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<until>"+expr1+"</until>"+
+		       "</wait>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Wait component=new Wait(model, elem);		
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should is set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}
+
+	public void testForFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<wait xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<for>"+expr1+"</for>"+
+		       "</wait>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Wait component=new Wait(model, elem);		
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("For condition should is set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}
+
+	public void testSetUntilNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</until>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);
+		
+		Wait component=new Wait(model);
+		
+		component.setUntil(condition);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetUntilReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</until>";
+	
+		String xml2="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</until>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		Wait component=new Wait(model);
+		
+		component.setUntil(condition1);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setUntil(condition2);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getFor() != null) {
+			fail("For condition should still not be set");
+		}
+		
+		result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetForNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</for>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);
+		
+		Wait component=new Wait(model);
+		
+		component.setFor(condition);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetForReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</for>";
+	
+		String xml2="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</for>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		Wait component=new Wait(model);
+		
+		component.setFor(condition1);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setFor(condition2);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getUntil() != null) {
+			fail("Until condition should still not be set");
+		}
+		
+		result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetForThenUntil() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</for>";
+	
+		String xml2="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</until>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		Wait component=new Wait(model);
+		
+		component.setFor(condition1);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getUntil() != null) {
+			fail("Until condition should not be set");
+		}
+		
+		String result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setUntil(condition2);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getFor() != null) {
+			fail("For condition should still not be set");
+		}
+		
+		result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+
+	public void testSetUntilThenFor() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<until xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</until>";
+	
+		String xml2="<for xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</for>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		Wait component=new Wait(model);
+		
+		component.setUntil(condition1);
+		
+		if (component.getUntil() == null) {
+			fail("Condition not set");
+		}
+		
+		if (component.getFor() != null) {
+			fail("For condition should not be set");
+		}
+		
+		String result=component.getUntil().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setFor(condition2);
+		
+		if (component.getFor() == null) {
+			fail("Condition not set");
+		}
+
+		if (component.getUntil() != null) {
+			fail("Until condition should still not be set");
+		}
+		
+		result=component.getFor().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}		
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WhileTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WhileTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/component/WhileTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,478 @@
+/*
+ * 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.model.component;
+
+import org.savara.bpel.model.BPELLanguageModel;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.bpel.model.component.BPELActivity;
+import org.savara.bpel.model.component.Condition;
+import org.savara.bpel.model.component.If;
+import org.savara.bpel.model.component.Receive;
+import org.savara.bpel.model.component.Sequence;
+import org.savara.bpel.model.component.While;
+
+import junit.framework.TestCase;
+
+public class WhileTest extends TestCase {
+
+	public void testIsActivity() {
+		While act=new While(new DefaultBPELLanguageModel(null));
+		
+		if (act.isActivity() == false) {
+			fail("Should be an activity");
+		}
+	}
+	
+	public void testFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition>"+expr1+"</condition>"+
+		       "<sequence/>"+
+		       "</while>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		While component=new While(model, elem);		
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+		
+		if (component.getActivity() == null) {
+			fail("Activity not set");
+		}
+		
+		if ((component.getActivity() instanceof Sequence) == false) {
+			fail("Activity not a sequence");
+		}
+	}
+	
+	public void testSetConditionInitFromDOM() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+			   "<targets/>"+
+		       "<sequence/>"+
+		       "</while>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		While component=new While(model, elem);		
+		
+		if (component.getActivity() == null) {
+			fail("Activity should be set");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+
+		Condition cond=new Condition(model);
+		
+		cond.setExpression(expr1);
+		
+		component.setCondition(cond);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 3) {
+			fail("Three child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Condition.CONDITION) == false) {
+			fail("Second element was not a 'condition': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}
+	
+	public void testSetConditionNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		
+		String xml="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       expr1+
+		       "</condition>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition=new Condition(model, elem);
+		
+		While component=new While(model);
+		
+		component.setCondition(condition);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetConditionReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String expr1="Test Expression 1";
+		String expr2="Test Expression 2";
+		
+		String xml1="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr1+
+	       		"</condition>";
+	
+		String xml2="<condition xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+	       		expr2+
+	       		"</condition>";
+	
+		org.w3c.dom.Element elem1=null;
+		org.w3c.dom.Element elem2=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml1.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem1 = doc.getDocumentElement();
+			
+			is.close();
+			
+			is=new java.io.ByteArrayInputStream(xml2.getBytes());
+			
+			doc=builder.parse(is);
+			elem2 = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		Condition condition1=new Condition(model, elem1);
+		
+		While component=new While(model);
+		
+		component.setCondition(condition1);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		String result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr1) == false) {
+			fail("Expression1 is not valid: expecting '"+
+					expr1+"' but got '"+result+"'");
+		}
+
+		Condition condition2=new Condition(model, elem2);
+		
+		component.setCondition(condition2);
+		
+		if (component.getCondition() == null) {
+			fail("Condition not set");
+		}
+		
+		result=component.getCondition().getExpression();
+		
+		if (result == null) {
+			fail("Expression is null");
+		}
+		
+		if (result.equals(expr2) == false) {
+			fail("Expression2 is not valid: expecting '"+
+					expr2+"' but got '"+result+"'");
+		}
+	}	
+	
+	public void testSetActivityNew() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "</while>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		While component=new While(model, ifelem);
+
+		if (component.getActivity() != null) {
+			fail("Activity should be null");
+		}
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 1) {
+			fail("One child element expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		Sequence seq=new Sequence(model);
+		
+		component.setActivity(seq);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(Sequence.SEQUENCE) == false) {
+			fail("Second element was not a sequence: "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}	
+	
+	public void testSetActivityReplace() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       "<condition/>"+
+		       "<sequence/>"+
+		       "</while>";
+		
+		org.w3c.dom.Element ifelem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			ifelem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			fail("Failed to convert to doc");
+		}
+		
+		While component=new While(model, ifelem);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		If sub=new If(model);
+		
+		component.setActivity(sub);
+		
+		if (component.getDOMElement().getChildNodes().getLength() != 2) {
+			fail("Two child elements expected: "+
+					component.getDOMElement().getChildNodes().getLength());
+		}
+		
+		if (component.getDOMElement().getChildNodes().item(1).
+				getLocalName().equals(If.IF) == false) {
+			fail("Second element was not an 'if': "+
+					component.getDOMElement().getChildNodes().item(1).
+									getLocalName());
+		}
+	}	
+
+	public void testGetURI() {
+		BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+		String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+					"<while xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+		       		"<sequence>"+
+	       			"<receive/>"+
+       			"</sequence>"+
+		       "</while>"+
+	       		"</process>";
+		
+		org.w3c.dom.Element elem=null;
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			javax.xml.parsers.DocumentBuilder builder=
+						factory.newDocumentBuilder();
+			
+			java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+			
+			org.w3c.dom.Document doc=builder.parse(is);
+			elem = doc.getDocumentElement();
+			
+			is.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			fail("Failed to convert to doc");
+		}
+		
+		org.savara.bpel.model.component.Process component=
+			new org.savara.bpel.model.component.Process(model, elem);		
+		
+		BPELActivity topact=component.getActivity();
+		
+		if ((topact instanceof While) == false) {
+			fail("Top level activity is not While");
+		}
+		
+		While top=(While)topact;
+		
+		if (top.getActivity() == null) {
+			fail("While activity is null");
+		}
+		
+		if ((top.getActivity() instanceof Sequence) == false) {
+			fail("While activity is not sequence");
+		}
+		
+		Sequence seq=(Sequence)top.getActivity();
+		
+		if (seq.getActivities().size() != 1) {
+			fail("Should have 1 activity: "+seq.getActivities().size());
+		}
+		
+		if ((seq.getActivities().get(0) instanceof Receive) == false) {
+			fail("Activty should be Receive");
+		}
+				
+		Receive recv=(Receive)seq.getActivities().get(0);
+		
+		String uri=recv.getURI();
+		
+		if (uri == null) {
+			fail("URI is null");
+		}
+		
+		if (uri.equals("//@activity/@activity/@activities.0") == false) {
+			fail("URI is invalid: "+uri);
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/util/InteractionUtilTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/util/InteractionUtilTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/model/util/InteractionUtilTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,91 @@
+/*
+ * 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.model.util;
+
+import junit.framework.TestCase;
+
+import org.scribble.conversation.model.*;
+import org.scribble.protocol.model.*;
+
+public class InteractionUtilTest extends TestCase {
+
+	public void testIsFirstInteractionSingleInteraction() {
+		ConversationModel cm=new ConversationModel();
+		Conversation c=new Conversation();
+		cm.setConversation(c);
+		
+		Interaction i1=new Interaction();
+		
+		c.getBlock().getContents().add(i1);
+		
+		if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
+			fail("Interaction should be first in conversation");
+		}
+	}
+
+	public void testIsFirstInteractionSecondInteraction() {
+		ConversationModel cm=new ConversationModel();
+		Conversation c=new Conversation();
+		cm.setConversation(c);
+		
+		Interaction i1=new Interaction();
+		Interaction i2=new Interaction();
+		
+		c.getBlock().getContents().add(i1);
+		c.getBlock().getContents().add(i2);
+		
+		if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2)) {
+			fail("Interaction should NOT be first in conversation");
+		}
+	}
+	
+	public void testIsFirstInteractionIfElse() {
+		ConversationModel cm=new ConversationModel();
+		Conversation c=new Conversation();
+		cm.setConversation(c);
+		
+		If choice=new If();
+		c.getBlock().getContents().add(choice);
+		
+		Block b=choice.createNewPath();
+		
+		Interaction i1=new Interaction();
+		
+		b.getContents().add(i1);
+		
+		Block b2=choice.createNewPath();
+		
+		Interaction i2=new Interaction();
+		Interaction i3=new Interaction();
+		
+		b2.getContents().add(i2);
+		b2.getContents().add(i3);
+		
+		if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
+			fail("Interaction should be first in conversation");
+		}
+		
+		if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2) == false) {
+			fail("Interaction should be first in conversation");
+		}
+		
+		if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i3)) {
+			fail("Interaction should NOT be first in conversation");
+		}
+	}	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/util/XMLUtilsTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/util/XMLUtilsTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/util/XMLUtilsTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,172 @@
+/*
+ * 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.util;
+
+import org.savara.util.XMLUtils;
+import org.scribble.model.ModelObject;
+
+import junit.framework.TestCase;
+
+public class XMLUtilsTest extends TestCase {
+
+	public void testNamespace() {
+		String namespace="http://namespace";
+		String elemName="testElement";
+
+		String expected="<"+elemName+" xmlns=\""+namespace+"\"/>\r\n";
+		
+		try {
+			javax.xml.parsers.DocumentBuilderFactory factory=
+				javax.xml.parsers.DocumentBuilderFactory.
+							newInstance();
+			factory.setNamespaceAware(true);
+			
+			org.w3c.dom.Document doc=
+					factory.newDocumentBuilder().newDocument();
+
+			org.w3c.dom.Element elem=
+					doc.createElementNS(namespace, elemName);
+			
+			String str=XMLUtils.toText(elem);
+			
+			if (str.equals(expected) == false) {
+				fail("Expected result '"+expected+"', got: '"+str+"'");
+			}
+			
+		} catch(Exception e) {
+			fail("Failed: "+e);
+		}
+	}
+	
+	public void testSetStartAndEndPosition() {
+		String xml="<root><myelem></myelem><myelem></myelem></root>";
+		
+		try {
+			org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+			
+			org.w3c.dom.NodeList nl=node.getElementsByTagName("myelem");
+			
+			if (nl.getLength() != 2) {
+				fail("Should be two elements: "+nl.getLength());
+			}
+			
+			ModelObject obj=new ModelObject(){};
+			
+			XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+			
+			if (obj.getSource().getStartPosition() != 23) {
+				fail("Start position should be 23: "+obj.getSource().getStartPosition());
+			}
+			
+			if (obj.getSource().getEndPosition() != 39) {
+				fail("End position should be 39: "+obj.getSource().getEndPosition());
+			}
+
+		} catch(Exception e) {
+			fail("Failed: "+e);
+		}
+	}
+	
+	public void testSetStartAndEndPositionWithNS() {
+		String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem></bpel:myelem><bpel:myelem></bpel:myelem></bpel:root>";
+		
+		try {
+			org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+			
+			org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+			
+			if (nl.getLength() != 2) {
+				fail("Should be two elements: "+nl.getLength());
+			}
+			
+			ModelObject obj=new ModelObject(){};
+			
+			XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+			
+			if (obj.getSource().getStartPosition() != 57) {
+				fail("Start position should be 57: "+obj.getSource().getStartPosition());
+			}
+			
+			if (obj.getSource().getEndPosition() != 83) {
+				fail("End position should be 83: "+obj.getSource().getEndPosition());
+			}
+
+		} catch(Exception e) {
+			fail("Failed: "+e);
+		}
+	}
+	
+	public void testSetStartAndEndPositionSingleNodeWithNS() {
+		String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem attr=\"1\" /><bpel:myelem attr=\"2\" /></bpel:root>";
+		
+		try {
+			org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+			
+			org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+			
+			if (nl.getLength() != 2) {
+				fail("Should be two elements: "+nl.getLength());
+			}
+			
+			ModelObject obj=new ModelObject(){};
+			
+			XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+			
+			if (obj.getSource().getStartPosition() != 54) {
+				fail("Start position should be 54: "+obj.getSource().getStartPosition());
+			}
+			
+			if (obj.getSource().getEndPosition() != 77) {
+				fail("End position should be 77: "+obj.getSource().getEndPosition());
+			}
+
+		} catch(Exception e) {
+			fail("Failed: "+e);
+		}
+	}
+	
+	public void testSetStartAndEndPositionWithChildAndNS() {
+		String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem></bpel:myelem>" +
+				"<bpel:myelem><bpel:myelem></bpel:myelem></bpel:myelem></bpel:root>";
+		
+		try {
+			org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+			
+			org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+			
+			if (nl.getLength() != 3) {
+				fail("Should be three elements: "+nl.getLength());
+			}
+			
+			ModelObject obj=new ModelObject(){};
+			
+			XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+			
+			if (obj.getSource().getStartPosition() != 57) {
+				fail("Start position should be 57: "+obj.getSource().getStartPosition());
+			}
+			
+			if (obj.getSource().getEndPosition() != 110) {
+				fail("End position should be 110: "+obj.getSource().getEndPosition());
+			}
+
+		} catch(Exception e) {
+			fail("Failed: "+e);
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/.project
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/.project	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+<projectDescription>
+  <name>org.savara.contract.model</name>
+  <comment>The SAVARA project. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.ManifestBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.SchemaBuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.pde.PluginNature</nature>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Contract Model
+Bundle-SymbolicName: org.savara.contract.model
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.contract.model.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework
+Require-Bundle: org.scribble.common
+Export-Package: org.savara.contract.model

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/build.properties
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.savara.contract.model</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::ContractModel</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+	    <dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+   </dependencies>
+</project>

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Contract.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Contract.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Contract.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,120 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the contract.
+ */
+public class Contract implements java.io.Serializable {
+	
+	private static final long serialVersionUID = -2069422236288472372L;
+
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.Set<Interface> m_interfaces=
+						new java.util.HashSet<Interface>();
+	private java.util.Set<Namespace> m_namespaces=
+			new java.util.HashSet<Namespace>();
+	
+	/**
+	 * The default constructor.
+	 */
+	public Contract() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * contract.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method sets the name of the contract.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the namespace associated with the
+	 * contract.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(m_namespace);
+	}
+	
+	/**
+	 * This method sets the namespace of the contract.
+	 * 
+	 * @param namespace The namespace
+	 */
+	public void setNamespace(String namespace) {
+		m_namespace = namespace;
+	}
+	
+	/**
+	 * This method returns the list of interfaces.
+	 * 
+	 * @return The list of interfaces
+	 */
+	public java.util.Set<Interface> getInterfaces() {
+		return(m_interfaces);
+	}
+	
+	/**
+	 * This method returns the interface associated
+	 * with the supplied name.
+	 * 
+	 * @param name The interface name
+	 * @return The interface, or null if not found.
+	 */
+	public Interface getInterface(String name) {
+		Interface ret=null;
+		
+		java.util.Iterator<Interface> iter=getInterfaces().iterator();
+		while (ret == null && iter.hasNext()) {
+			ret = iter.next();
+			
+			if (ret.getName().equals(name) == false) {
+				ret = null;
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of namespaces.
+	 * If a namespace is used in the contract that does
+	 * not exist in this list, then a dynamic prefix should
+	 * be created for the namespace.
+	 * 
+	 * @return The list of namespaces
+	 */
+	public java.util.Set<Namespace> getNamespaces() {
+		return(m_namespaces);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/FaultDetails.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/FaultDetails.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/FaultDetails.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,84 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the fault details.
+ */
+public class FaultDetails implements java.io.Serializable {
+	
+	private static final long serialVersionUID = -3998017364115322343L;
+
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.List<Type> m_types=
+						new java.util.Vector<Type>();	
+	
+	/**
+	 * The default constructor.
+	 */
+	public FaultDetails() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * fault.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method sets the name of the fault.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the namespace associated with the
+	 * fault.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(m_namespace);
+	}
+	
+	/**
+	 * This method sets the namespace of the fault.
+	 * 
+	 * @param namespace The namespace
+	 */
+	public void setNamespace(String namespace) {
+		m_namespace = namespace;
+	}
+	
+	/**
+	 * This method returns the list of types.
+	 * 
+	 * @return The list of types
+	 */
+	public java.util.List<Type> getTypes() {
+		return(m_types);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Interface.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Interface.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Interface.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,108 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents an interface, as part of a contract.
+ *
+ */
+public class Interface implements java.io.Serializable {
+	
+	private static final long serialVersionUID = -5028398472232579842L;
+
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.List<MessageExchangePattern> m_messageExchangePatterns=
+			new java.util.Vector<MessageExchangePattern>();
+
+	/**
+	 * The default constructor.
+	 */
+	public Interface() {
+	}
+
+	/**
+	 * This method returns the name associated with the
+	 * interface.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method sets the name of the interface.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the namespace associated with the
+	 * interface.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(m_namespace);
+	}
+	
+	/**
+	 * This method sets the namespace of the interface.
+	 * 
+	 * @param namespace The namespace
+	 */
+	public void setNamespace(String namespace) {
+		m_namespace = namespace;
+	}
+	
+	/**
+	 * This method returns the list of message exchange patterns.
+	 * 
+	 * @return The list of message exchange patterns
+	 */
+	public java.util.List<MessageExchangePattern> getMessageExchangePatterns() {
+		return(m_messageExchangePatterns);
+	}
+	
+	/**
+	 * This method retrieves an existing message exchange pattern,
+	 * associated with the supplied operation name, if one exists.
+	 * 
+	 * @param op The operation
+	 * @return The message exchange pattern, or null if not found
+	 */
+	public MessageExchangePattern getMessageExchangePatternForOperation(String op) {
+		MessageExchangePattern ret=null;
+		
+		java.util.Iterator<MessageExchangePattern> iter=getMessageExchangePatterns().iterator();
+		
+		while (ret == null && iter.hasNext()) {
+			ret = iter.next();
+			
+			if (op.equals(ret.getOperation()) == false) {
+				ret = null;
+			}
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/MessageExchangePattern.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/MessageExchangePattern.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/MessageExchangePattern.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,65 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the message exchange pattern.
+ */
+public abstract class MessageExchangePattern implements java.io.Serializable {
+	
+	private static final long serialVersionUID = -5570256623664777195L;
+
+	private String m_operation=null;
+	private java.util.List<Type> m_types=
+			new java.util.Vector<Type>();	
+	
+	/**
+	 * The default constructor.
+	 */
+	public MessageExchangePattern() {
+	}
+	
+	/**
+	 * This method returns the optional operation.
+	 * 
+	 * @return The optional operation
+	 */
+	public String getOperation() {
+		return(m_operation);
+	}
+	
+	/**
+	 * This method sets the operation.
+	 * 
+	 * @param operation The operation
+	 */
+	public void setOperation(String operation) {
+		m_operation = operation;
+	}
+	
+	/**
+	 * This method returns the list of types. If
+	 * no operation name is defined, then only one type
+	 * should be defined.
+	 * 
+	 * @return The list of types
+	 */
+	public java.util.List<Type> getTypes() {
+		return(m_types);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Namespace.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Namespace.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Namespace.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the namespace.
+ */
+public class Namespace implements java.io.Serializable {
+	
+	private static final long serialVersionUID = 705922078450920771L;
+
+	private String m_prefix=null;
+	private String m_uri=null;
+	private String m_schemaLocation=null;
+	
+	/**
+	 * The default constructor.
+	 */
+	public Namespace() {
+	}
+	
+	/**
+	 * This method returns the prefix associated with the
+	 * prefix.
+	 * 
+	 * @return The name
+	 */
+	public String getPrefix() {
+		return(m_prefix);
+	}
+	
+	/**
+	 * This method sets the prefix of the namespace.
+	 * 
+	 * @param prefix The prefix
+	 */
+	public void setPrefix(String prefix) {
+		m_prefix = prefix;
+	}
+	
+	/**
+	 * This method returns the URI associated with the
+	 * namespace.
+	 * 
+	 * @return The URI
+	 */
+	public String getURI() {
+		return(m_uri);
+	}
+	
+	/**
+	 * This method sets the URI of the namespace.
+	 * 
+	 * @param uri The URI
+	 */
+	public void setURI(String uri) {
+		m_uri = uri;
+	}
+	
+	/**
+	 * This method returns the schema location associated with the
+	 * namespace.
+	 * 
+	 * @return The URI
+	 */
+	public String getSchemaLocation() {
+		return(m_schemaLocation);
+	}
+	
+	/**
+	 * This method sets the schema location of the namespace.
+	 * 
+	 * @param schemaLocation The optional schema location
+	 */
+	public void setSchemaLocation(String schemaLocation) {
+		m_schemaLocation = schemaLocation;
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/OneWayRequestMEP.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/OneWayRequestMEP.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/OneWayRequestMEP.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the one-way message exchange pattern.
+ */
+public class OneWayRequestMEP extends MessageExchangePattern implements java.io.Serializable {
+	
+	private static final long serialVersionUID = 8118537376650464370L;
+
+	/**
+	 * The default constructor.
+	 */
+	public OneWayRequestMEP() {
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/RequestResponseMEP.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/RequestResponseMEP.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/RequestResponseMEP.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,55 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents the request response message exchange pattern.
+ */
+public class RequestResponseMEP extends MessageExchangePattern implements java.io.Serializable {
+	
+	private static final long serialVersionUID = 723851982846902543L;
+
+	private java.util.List<Type> m_responseTypes=
+			new java.util.Vector<Type>();	
+	private java.util.List<FaultDetails> m_faultDetails=
+			new java.util.Vector<FaultDetails>();	
+	
+	/**
+	 * The default constructor.
+	 */
+	public RequestResponseMEP() {
+	}
+	
+	/**
+	 * This method returns the list of response types.
+	 * 
+	 * @return The list of response types
+	 */
+	public java.util.List<Type> getResponseTypes() {
+		return(m_responseTypes);
+	}
+	
+	/**
+	 * This method returns the list of fault details.
+	 * 
+	 * @return The list of fault details
+	 */
+	public java.util.List<FaultDetails> getFaultDetails() {
+		return(m_faultDetails);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Type.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Type.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/Type.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,64 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents a type associated with information passed by the contract.
+ */
+public class Type implements java.io.Serializable {
+	
+	private static final long serialVersionUID = 3623232001916287234L;
+
+	private String m_name=null;
+	private java.util.Set<TypeDefinition> m_typeDefinitions=
+		new java.util.HashSet<TypeDefinition>();
+	
+	/**
+	 * The default constructor.
+	 */
+	public Type() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * type.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method sets the name of the type.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the list of type definitions.
+	 * 
+	 * @return The list of type definitions
+	 */
+	public java.util.Set<TypeDefinition> getTypeDefinitions() {
+		return(m_typeDefinitions);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/TypeDefinition.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/TypeDefinition.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/TypeDefinition.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,97 @@
+/*
+ * 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.contract.model;
+
+/**
+ * This class represents a type definition within
+ */
+public class TypeDefinition implements java.io.Serializable {
+	
+	private static final long serialVersionUID = -3673043079078102077L;
+
+	public static final String XSD_ELEMENT="##XSDElement";
+	public static final String XSD_TYPE="##XSDType";
+	
+	private String m_name=null;	
+	private String m_namespace=null;
+	private String m_typeSystem=null;
+	
+	/**
+	 * The default constructor.
+	 */
+	public TypeDefinition() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * type.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method returns the namespace associated with the
+	 * type definition.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(m_namespace);
+	}
+	
+	/**
+	 * This method sets the namespace of the type definition.
+	 * 
+	 * @param namespace The namespace
+	 */
+	public void setNamespace(String namespace) {
+		m_namespace = namespace;
+	}
+	
+	/**
+	 * This method sets the name of the type.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the type system associated with the
+	 * type definition.
+	 * 
+	 * @return The type system
+	 */
+	public String getTypeSystem() {
+		return(m_typeSystem);
+	}
+	
+	/**
+	 * This method sets the type system associated with the
+	 * type definition.
+	 * 
+	 * @param typeSystem The type system
+	 */
+	public void setTypeSystem(String typeSystem) {
+		m_typeSystem = typeSystem;
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/src/main/java/org/savara/contract/model/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+/*
+ * 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.contract.model.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.core/.project
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/.project	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+<projectDescription>
+  <name>org.savara.core</name>
+  <comment>The SAVARA project. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.ManifestBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.SchemaBuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.pde.PluginNature</nature>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Core
+Bundle-SymbolicName: org.savara.core
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.core.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0",
+ org.scribble.protocol.model
+Require-Bundle: org.scribble.common
+Export-Package: org.savara.protocol.change,
+ org.savara.util

Added: branches/experimental/2.0.x/bundles/org.savara.core/build.properties
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/bundles/org.savara.core/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.savara.core</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::Core</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+   
+	<dependencies>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+	    <dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+   </dependencies>
+</project>

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/core/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,30 @@
+package org.savara.core.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext context;
+
+	static BundleContext getContext() {
+		return context;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		Activator.context = bundleContext;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		Activator.context = null;
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/AbstractModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/AbstractModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/AbstractModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 28 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+public abstract class AbstractModelChangeRule implements ModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context) and inserted
+	 * model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object being inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isInsertSupported(ModelChangeContext context,
+					ProtocolModel model, ModelObject mobj, ModelObject ref) {
+		return(false);
+	}
+	
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	public boolean insert(ModelChangeContext context,
+				ProtocolModel model, ModelObject mobj, ModelObject ref) {
+		return(false);
+	}
+	
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and deleted model object.
+	 * 
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object to be removed
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isDeleteSupported(ModelChangeContext context,
+						ProtocolModel model, ModelObject mobj) {
+		return(false);
+	}
+	
+	/**
+	 * This method removes the supplied model object from the
+	 * supplied model. The model object representation must
+	 * contain the necessary model specific to remove the 
+	 * object from the underlying model representation.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object to be deleted
+	 * @return Whether the change has been applied
+	 */
+	public boolean delete(ModelChangeContext context,
+				ProtocolModel model, ModelObject mobj) {
+		return(false);
+	}
+	
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and modified model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isUpdateSupported(ModelChangeContext context,
+					ProtocolModel model, ModelObject fromObj, ModelObject toObj) {
+		return(false);
+	}
+	
+	/**
+	 * This method modifies an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the change has been applied
+	 */
+	public boolean update(ModelChangeContext context,
+				ProtocolModel model, ModelObject fromObj, ModelObject toObj) {
+		return(false);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelChangeContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelChangeContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelChangeContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 24 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This class provides a default implementation for the model
+ * change context interface.
+ */
+public class DefaultModelChangeContext implements ModelChangeContext {
+
+	/**
+	 * This is the constructor for the model change context.
+	 * 
+	 * @param ref The reference for the model being changed
+	 * @param role The role associated with the model
+	 */
+	public DefaultModelChangeContext(/*ModelReference ref,*/ Role role) {
+		
+		//m_reference = ref;
+		m_role = role;
+		
+		// TODO: Need to initialise the model change rules
+		// possibly make this class abstract with derived classes
+		// providing the list of rules
+		
+		/*
+		if (ref != null) {
+			// Obtain the relevant rules
+			java.util.List<Object> rules=
+				org.scribble.extensions.RegistryFactory.getRegistry().
+							getExtensions(ModelChangeRule.class,
+									m_reference.getNotation());
+			
+			// Transfer to typed list
+			for (int i=0; i < rules.size(); i++) {
+				if (rules.get(i) instanceof ModelChangeRule) {
+					m_rules.add((ModelChangeRule)rules.get(i));
+				}
+			}
+		}
+		*/
+	}
+	
+	/**
+	 * This method returns a list of model change rules appropriate
+	 * for the notation being changed.
+	 * 
+	 * @return The list of model change rules
+	 */
+	public java.util.List<ModelChangeRule> getRules() {
+		return(m_rules);
+	}
+	
+	/**
+	 * This method returns the role associated with the local
+	 * model.
+	 * 
+	 * @return The role
+	 */
+	public Role getRole() {
+		return(m_role);
+	}
+	
+	/**
+	 * This method returns the current parent component.
+	 * 
+	 * @return The parent
+	 */
+	public Object getParent() {
+		return(m_parent);
+	}
+	
+	/**
+	 * This method sets the new parent component.
+	 * 
+	 * @param parent The parent
+	 */
+	public void setParent(Object parent) {
+		m_parent = parent;
+	}
+	
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block. 
+	 * 
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	public boolean insert(ProtocolModel model, ModelObject mobj, ModelObject ref) {
+		boolean ret=false;
+		
+		for (int i=0; ret == false && i < m_rules.size(); i++) {
+			if (m_rules.get(i).isInsertSupported(this, model, mobj, ref)) {
+				ret = m_rules.get(i).insert(this, model,
+						mobj, ref);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method removes an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param model The model being changed
+	 * @param mobj The model object details to be deleted
+	 * @param position The position, where relevant
+	 * @return Whether the change has been applied
+	 */
+	public boolean delete(ProtocolModel model, ModelObject mobj) {
+		boolean ret=false;
+		
+		for (int i=0; ret == false && i < m_rules.size(); i++) {
+			if (m_rules.get(i).isDeleteSupported(this, model, mobj)) {
+				ret = m_rules.get(i).delete(this, model, mobj);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method modifies an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param model The model being changed
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the change has been applied
+	 */
+	public boolean update(ProtocolModel model, ModelObject fromObj, ModelObject toObj) {
+		boolean ret=false;
+		
+		for (int i=0; ret == false && i < m_rules.size(); i++) {
+			if (m_rules.get(i).isUpdateSupported(this, model, fromObj, toObj)) {
+				ret = m_rules.get(i).update(this, model,
+						fromObj, toObj);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns a set of properties used during model change
+	 * processing.
+	 * 
+	 * @return The properties
+	 */
+	public java.util.Map<String,Object> getProperties() {
+		return(m_properties);
+	}
+	
+	//private ModelReference m_reference=null;
+	private Role m_role=null;
+	private Object m_parent=null;
+	private java.util.List<ModelChangeRule> m_rules=new java.util.Vector<ModelChangeRule>();
+	private java.util.Map<String,Object> m_properties=new java.util.HashMap<String,Object>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelGenerator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/DefaultModelGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 24 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This class represents a default implementation of the model
+ * generator interface.
+ */
+public class DefaultModelGenerator implements ModelGenerator {
+
+	/**
+	 * This method generates the contents of the target
+	 * model using information in the source model. This
+	 * mechanism is used to create a new instance of the
+	 * model, but with a specific underlying representation.
+	 * 
+	 * @param targetRef The target model's reference
+	 * @param role The role associated with the model
+	 * @param target The model being generated
+	 * @param source The reference model
+	 */
+	public void generate(ModelReference targetRef, Role role,
+					ProtocolModel target, ProtocolModel source) {
+		
+		DefaultModelChangeContext context=
+			new DefaultModelChangeContext(targetRef, role);
+		context.setParent(target);
+		
+		context.insert(target, source, null);
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 24 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This interface represents the capabilities made available
+ * to the model change rules.
+ */
+public interface ModelChangeContext {
+
+	/**
+	 * This method returns the role associated with the local
+	 * model.
+	 * 
+	 * @return The role
+	 */
+	public Role getRole();
+	
+	/**
+	 * This method returns the current parent component.
+	 * 
+	 * @return The parent
+	 */
+	public Object getParent();
+	
+	/**
+	 * This method sets the new parent component.
+	 * 
+	 * @param parent The parent
+	 */
+	public void setParent(Object parent);
+	
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block. 
+	 * 
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	public boolean insert(ProtocolModel model, ModelObject mobj, ModelObject ref);
+	
+	/**
+	 * This method removes the supplied model object from the
+	 * supplied model. The model object representation must
+	 * contain the necessary model specific to remove the 
+	 * object from the underlying model representation.
+	 * 
+	 * @param model The model being changed
+	 * @param mobj The model object to be deleted
+	 * @return Whether the change has been applied
+	 */
+	public boolean delete(ProtocolModel model, ModelObject mobj);
+	
+	/**
+	 * This method modifies an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param model The model being changed
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the change has been applied
+	 */
+	public boolean update(ProtocolModel model, ModelObject fromObj, ModelObject toObj);
+	
+	/**
+	 * This method returns a set of properties used during model change
+	 * processing.
+	 * 
+	 * @return The properties
+	 */
+	public java.util.Map<String,Object> getProperties();
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelChangeRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 23 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This interface represents a rule that can be used
+ * to insert a new model object into the current model.
+ */
+public interface ModelChangeRule {
+
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and inserted model object.
+	 * 
+	 * @param context The model change context
+	 * @param model The model
+	 * @param mobj The model object being inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isInsertSupported(ModelChangeContext context,
+					ProtocolModel model, ModelObject mobj,
+					ModelObject ref);
+	
+	/**
+	 * This method adds a new model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object. The supplied model object
+	 * will usually be from a different model representation
+	 * (e.g. due to a merge), so the details will be
+	 * copied and placed in the representation associated
+	 * with the supplied model and parent model object.<p>
+	 * <p>
+	 * If a reference model object is supplied, then the
+	 * insertion will occur relative to it. If the reference
+	 * object is a block, then it means that the insertion
+	 * should occur at the end of the block. Otherwise the
+	 * new model object should be inserted before the
+	 * reference object, within the containing block.<p>
+	 * <p>
+	 * If the reference object is not supplied, then the
+	 * new model object should be inserted at the end of
+	 * the behaviour associated with the parent in the model
+	 * change context.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object details to be inserted
+	 * @param ref The optional reference model object
+	 * @return Whether the change has been applied
+	 */
+	public boolean insert(ModelChangeContext context,
+				ProtocolModel model, ModelObject mobj, ModelObject ref);
+	
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and deleted model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param mobj The model object to be removed
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isDeleteSupported(ModelChangeContext context,
+					ProtocolModel model, ModelObject mobj);
+	
+	/**
+	 * This method removes the supplied model object from the
+	 * supplied model. The model object representation must
+	 * contain the necessary model specific to remove the 
+	 * object from the underlying model representation.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param mobj The model object to be deleted
+	 * @return Whether the change has been applied
+	 */
+	public boolean delete(ModelChangeContext context,
+			ProtocolModel model, ModelObject mobj);
+	
+	/**
+	 * This method determines whether the rule is appropriate
+	 * for the supplied type of model, parent (in the context)
+	 * and modified model object.
+	 *
+	 * @param context The context
+	 * @param model The model
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the rule supports the supplied information
+	 */
+	public boolean isUpdateSupported(ModelChangeContext context,
+			ProtocolModel model, ModelObject fromObj, ModelObject toObj);
+	
+	/**
+	 * This method modifies an existing model object, within a
+	 * parent model object, with the details supplied in
+	 * another model object.
+	 * 
+	 * @param context The context
+	 * @param model The model being changed
+	 * @param fromObj The source model object
+	 * @param toObj The model object to be updated
+	 * @return Whether the change has been applied
+	 */
+	public boolean update(ModelChangeContext context,
+			ProtocolModel model, ModelObject fromObj, ModelObject toObj);
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelGenerator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/protocol/change/ModelGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 24 Jul 2008 : Initial version created by gary
+ */
+package org.savara.protocol.change;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This interface represents a model generator.
+ */
+public interface ModelGenerator {
+
+	/**
+	 * This method generates the contents of the target
+	 * model using information in the source model. This
+	 * mechanism is used to create a new instance of the
+	 * model, but with a specific underlying representation.
+	 * 
+	 * @param targetRef The target model's reference
+	 * @param role The role associated with the model
+	 * @param target The model being generated
+	 * @param source The reference model
+	 */
+	public void generate(ModelReference targetRef, Role role,
+					ProtocolModel target, ProtocolModel source);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/XMLUtils.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/XMLUtils.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/XMLUtils.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,304 @@
+/*
+ * 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.util;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.scribble.protocol.model.ModelObject;
+import org.scribble.protocol.model.ModelProperties;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * This class defines a set of XML related utility functions.
+ */
+public final class XMLUtils {
+	
+	private static final String NS_LABEL = "ns";
+
+	/**
+	 * This class converts a DOM representation node to text.
+	 * @param node
+	 * @return
+	 * @throws Exception
+	 */
+	public static final String toText(Node node) throws Exception {
+		String ret = null;
+		try {
+			// Transform the DOM represent to text
+			ByteArrayOutputStream xmlstr= new ByteArrayOutputStream();
+			DOMSource source=new DOMSource(node);
+			//source.setNode(node);
+			
+			StreamResult result=new StreamResult(xmlstr);			
+			Transformer trans= TransformerFactory.newInstance().newTransformer();
+			trans.transform(source, result);
+			
+			xmlstr.close();
+			
+			ret = new String(xmlstr.toByteArray());
+			
+			if ((node instanceof Document) == false) {				
+				// Strip off any <?xml> header
+				int index=ret.indexOf("<?xml");
+				if (index != -1) {
+					index = ret.indexOf("<", 1);
+					if (index != -1) {
+						ret = ret.substring(index);
+					} else {
+						index = ret.indexOf("?>");
+						if (index != -1) {
+							index += 2;
+							
+							// Remove any trailing whitespaces after XML header
+							while (index < ret.length() &&
+									Character.isWhitespace(ret.charAt(index))) {
+								index++;
+							}
+							
+							ret = ret.substring(index);
+						}
+					}
+				}
+			}
+
+		} catch(Exception e) {
+			throw new Exception("Failed to transform DOM representation into text", e);
+		}
+		if (ret != null) {
+			 return format(ret);
+		}
+		return ret;
+	}
+	
+	
+	/**
+	 * Format the xml to well print.
+	 * 
+	 * @param xmltext
+	 * @return
+	 */
+	public static final String format(String xmltext) {
+		String ret=xmltext;
+		int pos=0;
+		int prevpos=0;
+		StringBuffer buf=new StringBuffer();
+		int level=0;
+		
+		while ((pos=ret.indexOf('<', prevpos)) != -1) {
+			
+			if (prevpos < pos &&
+					ret.substring(prevpos, pos).trim().length() > 0 &&
+					ret.charAt(prevpos-1) != '?') {
+				
+				if (ret.charAt(prevpos) == '\r' &&
+						ret.charAt(prevpos+1) == '\n') {
+					prevpos += 2;
+				}
+				for (int i=0; i < level; i++) {
+					buf.append("    ");
+				}
+				
+				buf.append(ret.substring(prevpos, pos).trim());
+				buf.append("\r\n");
+			}
+			
+			int endpos=ret.indexOf('>', pos);
+		
+			if (endpos > 0) {
+				boolean noreturn=false;
+				
+				if (pos > 0 && ret.charAt(pos+1) == '/') {
+					level--;
+				}
+				
+				for (int i=0; i < level; i++) {
+					buf.append("    ");
+				}
+				buf.append(ret.substring(pos, endpos+1));
+				
+				if (ret.charAt(endpos-1)== '?') {
+					//noreturn = true;
+					
+				} else if (ret.charAt(endpos-1) == '/') {
+					// Ignore
+				} else if (pos > 0 && ret.charAt(pos+1) == '/') {
+					// Ignore
+					
+				} else if (pos > 0 && ret.charAt(pos+1) == '!') {
+					// Ignore
+					
+				} else {
+					level++;
+				}
+							
+				if (noreturn == false) {
+					buf.append("\r\n");
+				}
+				
+				pos = endpos+1;
+			}
+			
+			prevpos = pos;
+		}
+		
+		if (prevpos != -1 &&
+				ret.substring(prevpos).trim().length() > 0) {
+			buf.append(ret.substring(prevpos));
+		}
+		
+		ret = buf.toString();
+		
+		return(ret);
+	}
+	
+	public static Node getNode(String text) throws Exception {
+		Node ret=null;
+		
+		// Transform the text representation to DOM
+		DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+		fact.setNamespaceAware(true);
+		
+		java.io.InputStream xmlstr=
+			new java.io.ByteArrayInputStream(text.getBytes());
+
+		DocumentBuilder builder=fact.newDocumentBuilder();
+		org.w3c.dom.Document doc=builder.parse(xmlstr);
+		
+		ret = doc.getDocumentElement();
+
+		return(ret);
+	}
+
+	/**
+	 * This method returns the localname part of the supplied
+	 * qualified name.
+	 * 
+	 * @param qname The qualified name
+	 * @return The localname part
+	 */
+	public static String getLocalname(String qname) {
+		String ret=qname;
+		int pos=0;
+		
+		if (qname != null && ((pos=qname.indexOf(':')) != -1)) {
+			ret = qname.substring(pos+1);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the prefix associated with the supplied namespace.
+	 * 
+	 * @param namespace The namespace
+	 * @param nsMap The existing namespace prefix mappings
+	 * @return The prefix
+	 */
+	public static String getPrefix(String namespace, java.util.Map<String,String> nsMap) {
+		String prefix=null;
+		
+		prefix = nsMap.get(namespace);
+		
+		if (prefix == null) {
+			prefix = NS_LABEL+(nsMap.size()+1);
+			nsMap.put(namespace, prefix);
+		}
+
+		return(prefix);
+	}
+	
+	/**
+	 * This method calculates the start and end position of a supplied DOM element, within
+	 * the supplied text contents, and sets the values on the supplied ModelObject.
+	 * 
+	 * @param obj The ModelObject to be initialized
+	 * @param contents The text contents
+	 * @param elem The DOM element to be located in the text
+	 */
+	public static void setStartAndEndPosition(ModelObject obj, String contents, org.w3c.dom.Element elem) {
+
+		if (contents != null) {
+			org.w3c.dom.NodeList nl=elem.getOwnerDocument().getElementsByTagName(elem.getNodeName());
+			int elempos=-1;
+			
+			for (int i=0; elempos == -1 && i < nl.getLength(); i++) {
+				if (nl.item(i) == elem) {
+					elempos = i;
+				}
+			}
+			
+			if (elempos != -1) {
+				int startpos=-1;
+					
+				for (int i=0; i <= elempos; i++) {
+					int val1=contents.indexOf("<"+elem.getNodeName()+">", startpos+1);
+					int val2=contents.indexOf("<"+elem.getNodeName()+" ", startpos+1);
+					
+					if (val1 == -1 && val2 != -1) {
+						startpos = val2;
+					} else if (val1 != -1 && val2 == -1) {
+						startpos = val1;
+					} else if (val1 == -1 && val2 == -1) {
+						// TODO: Error condition
+						break;
+					} else if (val1 > val2) {
+						startpos = val2;
+					} else {
+						startpos = val1;
+					}
+				}
+				
+				if (startpos != -1) {
+					//obj.getSource().setStartPosition(startpos);
+					obj.getProperties().put(ModelProperties.START_LOCATION, startpos);
+					
+					// Check if single node
+					int p1=contents.indexOf('>', startpos);
+					
+					if (p1 != -1 && contents.charAt(p1-1) == '/') {
+						//obj.getSource().setEndPosition(p1);
+						obj.getProperties().put(ModelProperties.END_LOCATION, p1);
+					} else {
+					
+						org.w3c.dom.NodeList enl=elem.getElementsByTagName(elem.getNodeName());
+						
+						int endpos=startpos;
+						String nodetxt="</"+elem.getNodeName()+">";
+						
+						for (int i=0; endpos != -1 && i <= enl.getLength(); i++) {
+							endpos = contents.indexOf(nodetxt, endpos+1);
+						}
+						
+						if (endpos != -1) {
+							//obj.getSource().setEndPosition(endpos+nodetxt.length()-1);
+							obj.getProperties().put(ModelProperties.END_LOCATION, endpos+nodetxt.length()-1);
+						}
+					}
+				}
+			}
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry kind="src" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.project
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.project	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.pi4soa.cdm</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA pi4soa CDM
+Bundle-SymbolicName: org.savara.pi4soa.cdm
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.pi4soa.cdm.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.pi4soa.cdl,
+ org.pi4soa.common,
+ org.eclipse.ui;resolution:=optional,
+ org.eclipse.core.resources;resolution:=optional,
+ org.eclipse.core.runtime;resolution:=optional,
+ org.pi4soa.designer;resolution:=optional,
+ org.eclipse.ui.views.properties.tabbed;resolution:=optional,
+ org.savara.contract.model,
+ org.scribble.common,
+ org.scribble.protocol,
+ org.junit
+Export-Package: org.savara.pi4soa.cdm.parser

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/build.properties
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.pi4soa.cdm</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::Pi4SOACDM</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.parser</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.core</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+	</dependencies>
+ 
+<!--
+	<dependencies>
+		<dependency>
+			<groupId></groupId>
+			<artifactId></artifactId>
+			<version></version>
+		</dependency>
+	</dependencies>
+-->
+
+</project>

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/CDMDefinitions.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/CDMDefinitions.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/CDMDefinitions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm;
+
+/**
+ * This class provides common definitions used in the Scribble
+ * transformation of the CDM file.
+ */
+public class CDMDefinitions {
+
+	public static final String CDM_NOTATION="cdm";
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,22 @@
+package org.savara.pi4soa.cdm.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2007-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 May 2009 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser;
+
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.savara.pi4soa.cdm.parser.rules.ConverterContext;
+import org.savara.pi4soa.cdm.parser.rules.ConverterRule;
+import org.savara.pi4soa.cdm.parser.rules.ConverterRuleFactory;
+import org.savara.pi4soa.cdm.parser.rules.DefaultConverterContext;
+import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.ProtocolModel;
+import org.scribble.protocol.parser.ProtocolParser;
+
+/**
+ * This class provides the model parser for the CDM notation.
+ * 
+ */
+public class CDMProtocolParser implements ProtocolParser {
+
+	/**
+	 * The default constructor.
+	 */
+	public CDMProtocolParser() {
+	}
+	
+	public ProtocolModel parse(InputStream is, Journal journal) {
+		ProtocolModel ret=null;
+		
+		if (is != null) {
+			try {						
+				org.pi4soa.cdl.Package cdlpack=
+						org.pi4soa.cdl.CDLManager.load(is);
+		
+				ConverterRule rule=ConverterRuleFactory.getConverter(ProtocolModel.class,
+									cdlpack);
+			
+				if (rule != null) {
+					ConverterContext cctxt=
+						new DefaultConverterContext();
+					
+					ret = (ProtocolModel)rule.convert(cctxt,
+							ProtocolModel.class, cdlpack);
+				}
+			
+			} catch(Exception e) {
+				logger.log(Level.SEVERE,
+						"Failed to load model", e);
+			}
+		
+			if (logger.isLoggable(java.util.logging.Level.FINEST)) {
+				
+				org.scribble.protocol.export.text.TextProtocolExporter exporter=
+							new org.scribble.protocol.export.text.TextProtocolExporter();
+				
+				try {
+					java.io.ByteArrayOutputStream os=
+						new java.io.ByteArrayOutputStream();
+					
+					exporter.export(ret, journal, os);
+					
+					String str=new String(os.toByteArray());
+					
+					System.out.println("EXPORTED CDM TEXT:");
+					System.out.println(str);
+					
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+
+		return(ret);
+	}
+
+	private static Logger logger = Logger.getLogger("org.pi4soa.scribble.cdm.parser");
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/AssignConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/AssignConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/AssignConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 3 Jun 2009 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.scribble.protocol.model.*;
+
+public class AssignConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Assign);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		// No conversion
+		return(null);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,406 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.Interaction;
+import org.pi4soa.cdl.Package;
+import org.pi4soa.cdl.Parallel;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+import org.scribble.protocol.model.Choice;
+import org.scribble.protocol.model.When;
+
+public class ChoiceConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Choice);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Activity ret=null;
+		org.pi4soa.cdl.Choice cdl=(org.pi4soa.cdl.Choice)cdlType;
+		java.util.List<When> blocks=new java.util.Vector<When>();
+		Role fromRole=null;
+		java.util.List<Role> toRoles=new java.util.Vector<Role>();
+		boolean f_when=false;
+		
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				
+				context.pushState();
+				
+				// Find exchange details for this path
+				InteractionLocator locator=new InteractionLocator(act);
+				
+				act.visit(locator);
+				
+				// If interaction found, then make sure it is ignored when
+				// processing the when path contents
+				if (locator.getInteraction() != null &&
+						locator.getInteraction().getExchangeDetails().size() > 0) {
+					context.ignore(locator.getInteraction().getExchangeDetails().get(0));
+				}
+				
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					/* TODO: Consider whether collapsing choices is appropriate?
+					 * possibly if same from/to roles.
+					 */
+					if (activity instanceof Choice) {
+						blocks.addAll(((Choice)activity).getWhens());
+					} else {
+
+						When block=new When();
+						
+						if (locator.getInteraction() != null &&
+								locator.getInteraction().getExchangeDetails().size() > 0) {
+							
+							// Get the first exchange details
+							ExchangeDetails ed=locator.getInteraction().getExchangeDetails().get(0);
+							
+							if (ed != null) {
+							
+								MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed);
+							
+								// TODO: Need to update/verify from/to roles on containing choice
+							
+								block.setMessageSignature(ms);
+								
+								fromRole = InteractionConverterRuleImpl.getFromRole(context,
+														ed);
+								
+								Role toRole = InteractionConverterRuleImpl.getToRole(context,
+														ed);
+								if (toRoles.contains(toRole) == false) {
+									toRoles.add(toRole);
+								}
+							}
+						}
+						
+						if (activity instanceof Block) {
+							block.getBlock().getContents().addAll(((Block)activity).getContents());
+						} else {
+							block.getBlock().add(activity);							
+						}
+						
+						blocks.add(block);
+					}
+				}
+				
+				context.popState();
+			}
+		}
+		
+		// Build up initiator role list
+		java.util.List<Role> roles=null;
+		
+		for (int i=0; i < blocks.size(); i++) {
+			When b=blocks.get(i);
+			
+			java.util.List<Role> blockRoles=
+					b.getBlock().initiatorRoles();
+				
+			if (blockRoles != null) {
+				if (roles == null) {
+					roles = blockRoles;
+				} else {
+					for (int j=0; j < blockRoles.size(); j++) {
+						if (roles.contains(blockRoles.get(j)) == false) {
+							roles.add(blockRoles.get(j));
+						}
+					}
+				}
+			}
+		}
+		
+		/*
+		if (f_when) {
+			ret = new org.scribble.conversation.model.When();
+			((org.scribble.conversation.model.When)ret).
+					getConditionalBlocks().addAll(blocks);
+			
+			if (roles != null) {
+				((org.scribble.conversation.model.When)ret).
+						getRoles().addAll(roles);
+			}
+		} else {
+		*/
+			ret = new org.scribble.protocol.model.Choice();
+			((org.scribble.protocol.model.Choice)ret).
+					getWhens().addAll(blocks);
+			
+			((org.scribble.protocol.model.Choice)ret).
+						setFromRole(fromRole);
+			
+			if (toRoles.size() == 1) {
+				((org.scribble.protocol.model.Choice)ret).setToRole(toRoles.get(0));
+			} else if (toRoles.size() == 0) {
+				// TODO: Report no to roles
+			} else {
+				// TODO: Report too many roles
+			}
+			
+			/*
+			if (roles != null) {
+				
+				if (roles.size() > 0) {
+					((org.scribble.protocol.model.Choice)ret).
+							setFromRole(roles.get(0));
+					
+					if (roles.size() > 1) {
+						// TODO: Need to decide what to do with multiple roles
+						// TODO: What about 'to' roles on the choice?
+					}
+				}
+			}
+			*/
+		//}
+		
+		if (ret != null) {
+			ret.getProperties().put("CDLType",
+					CDLTypeUtil.getURIFragment(cdl));
+		}
+		
+		return(ret);
+	}
+	
+	public static class InteractionLocator implements CDLVisitor {
+
+		private Interaction m_interaction=null;
+		private boolean f_clearInteraction=false;
+		private org.pi4soa.cdl.Activity m_parent=null;
+		
+		public InteractionLocator(org.pi4soa.cdl.Activity parent) {
+			m_parent = parent;
+		}
+		
+		public Interaction getInteraction() {
+			return(f_clearInteraction ? null : m_interaction);
+		}
+		
+		@Override
+		public void assign(Assign assign) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void choiceStart(org.pi4soa.cdl.Choice choice) {
+			if (m_interaction == null && choice != m_parent) {
+				f_clearInteraction = true;
+			}
+		}
+
+		@Override
+		public void choiceEnd(org.pi4soa.cdl.Choice choice) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void choreographyStart(Choreography choreography) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void choreographyEnd(Choreography choreography) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void conditionalStart(Conditional conditional) {
+			if (m_interaction == null && conditional != m_parent) {
+				f_clearInteraction = true;
+			}
+		}
+
+		@Override
+		public void conditionalEnd(Conditional conditional) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void exceptionHandlerStart(ExceptionHandler handler) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void exceptionHandlerEnd(ExceptionHandler handler) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void exceptionWorkUnitStart(ExceptionWorkUnit workunit) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void exceptionWorkUnitEnd(ExceptionWorkUnit workunit) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void finalizerStart(FinalizerHandler finalizer) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void finalizerEnd(FinalizerHandler finalizer) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void finalize(Finalize finalize) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void interaction(Interaction interaction) {
+			if (m_interaction == null) {
+				m_interaction = interaction;
+			}
+		}
+
+		@Override
+		public void noAction(NoAction noAction) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void packageStart(Package pack) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void packageEnd(Package pack) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void parallelStart(Parallel parallel) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void parallelEnd(Parallel parallel) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void perform(Perform perform) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void sequenceStart(Sequence sequence) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void sequenceEnd(Sequence sequence) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void silentAction(SilentAction silentAction) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void whenStart(org.pi4soa.cdl.When when) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void whenEnd(org.pi4soa.cdl.When when) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void whileStart(While whileElem) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public void whileEnd(While whileElem) {
+			// TODO Auto-generated method stub
+			
+		}
+		
+		
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.savara.pi4soa.cdm.parser.rules.ChoiceConverterRuleImpl.InteractionLocator;
+import org.scribble.protocol.model.*;
+import org.scribble.protocol.model.When;
+
+public class ConditionalConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Conditional);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Choice ret=
+				new org.scribble.protocol.model.Choice();
+		org.pi4soa.cdl.Conditional cdl=(org.pi4soa.cdl.Conditional)cdlType;
+		
+		// Find exchange details for this path
+		InteractionLocator locator=new InteractionLocator(cdl);
+		
+		cdl.visit(locator);
+		
+		// If interaction found, then make sure it is ignored when
+		// processing the when path contents
+		if (locator.getInteraction() != null &&
+				locator.getInteraction().getExchangeDetails().size() > 0) {
+			context.ignore(locator.getInteraction().getExchangeDetails().get(0));
+		}
+
+		//ret.getSource().setComponentURI(
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+	
+		When block=new When();
+		ret.getWhens().add(block);
+		
+		if (locator.getInteraction() != null &&
+				locator.getInteraction().getExchangeDetails().size() > 0) {
+			
+			// Get the first exchange details
+			ExchangeDetails ed=locator.getInteraction().getExchangeDetails().get(0);
+			
+			if (ed != null) {
+			
+				MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed);
+			
+				// TODO: Need to update/verify from/to roles on containing choice
+			
+				block.setMessageSignature(ms);
+				
+				ret.setFromRole(InteractionConverterRuleImpl.getFromRole(context,
+											ed));
+				
+				ret.setFromRole(InteractionConverterRuleImpl.getToRole(context,
+											ed));
+			}
+		}
+
+		context.pushState();
+		
+		// Set the expression if defined in the 'conditional'
+		if (cdl.getExpression() != null) {
+			//XPathExpression exp=new XPathExpression();
+		
+			//exp.setQuery(cdl.getExpression());
+		
+			//block.setExpression(exp);
+			block.getProperties().put("Expression", cdl.getExpression());
+		}
+		
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					if (activity instanceof Block) {
+						block.getBlock().getContents().addAll(((Block)activity).getContents());
+					} else {
+						block.getBlock().add(activity);
+					}
+				}
+			}
+		}
+		
+		// Get initiator role(s) for first activity in body and
+		// associated with If
+		//ret.getRoles().addAll(block.getInitiatorRoles());
+		
+		// TODO: Need to (1) setup from/to roles and the interaction message that
+		// triggers the conditional path, and (2) add a second path with just a label
+		// to represent an optional bypass path.
+		
+		context.popState();
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.ExchangeDetails;
+import org.scribble.protocol.model.*;
+
+public interface ConverterContext {
+
+	/**
+	 * This method returns the source model reference.
+	 * 
+	 * @return The source model reference
+	 */
+	//public ModelReference getSource();
+	
+	/**
+	 * This method returns the declaration associated
+	 * with the supplied name.
+	 * 
+	 * @param name The name
+	 * @return The declaration, or null if not found
+	 */
+	public Object getState(String name);
+	
+	/**
+	 * This method sets the declaration associated with
+	 * the supplied name.
+	 * 
+	 * @param name The name
+	 * @param decl The declaration
+	 */
+	public void setState(String name, Object decl);
+	
+	/**
+	 * This method pushes the scope, to clear the current
+	 * state associated with a parent scope.
+	 */
+	public void pushScope();
+	
+	/**
+	 * This method pops the scope associated with a parent
+	 * conversation.
+	 * 
+	 */
+	public void popScope();
+	
+	/**
+	 * This method pushes the current state onto a stack,
+	 * to create a local scope where further roles or
+	 * variables may be declared.
+	 */
+	public void pushState();
+	
+	/**
+	 * This method pops a previous state from the stack
+	 * to clear any local declarations made within a
+	 * local scope as part of a conversation definition.
+	 */
+	public void popState();
+	
+	/**
+	 * This method adds a conversation to the context,
+	 * for use when processing activities within its
+	 * scope.
+	 * 
+	 * @param conv The conversation
+	 */
+	public void addProtocol(Protocol conv);
+	
+	/**
+	 * This method removes the conversation from the
+	 * context.
+	 * 
+	 * @param conv The conversation
+	 */
+	public void removeProtocol(Protocol conv);
+	
+	/**
+	 * This method retrieves the conversation associated
+	 * with the supplied model reference.
+	 * 
+	 * @param ref The model reference
+	 * @return The conversation
+	 */
+	//public Protocol getProtocol(ModelReference ref);
+
+	/**
+	 * This method returns the list of Compose activities
+	 * within the model.
+	 * 
+	 * @return The list of compose activities
+	 */
+	public java.util.List<Run> getComposeActivities();
+	
+	/**
+	 * This method indicates that the supplied exchange
+	 * details should be ignored. This can happen if the
+	 * exchange details are used in a choice, and therefore
+	 * should not also be converted as a normal activity.
+	 * 
+	 * @param ed The exchange details
+	 */
+	public void ignore(ExchangeDetails ed);
+	
+	/**
+	 * This method determines whether the supplied exchange
+	 * details should be ignored.
+	 * 
+	 * @param ed The exchange details
+	 * @return Whether the exchange details should be ignored
+	 */
+	public boolean shouldIgnore(ExchangeDetails ed);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRule.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRule.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+/**
+ * This interface represents a CDM to Scribble conversation
+ * rule.
+ */
+public interface ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						org.pi4soa.cdl.CDLType cdlType);
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public org.scribble.protocol.model.ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, org.pi4soa.cdl.CDLType cdlType);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRuleFactory.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRuleFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterRuleFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+/**
+ * This class represents a factory for converter rules.
+ */
+public class ConverterRuleFactory {
+
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converter rule, or null if not found
+	 */
+	public static ConverterRule getConverter(Class<?> scribbleType,
+						org.pi4soa.cdl.CDLType cdlType) {
+		ConverterRule ret=null;
+		
+		for (int i=0; ret == null && i < m_rules.length; i++) {
+			if (m_rules[i].isSupported(scribbleType, cdlType)) {
+				ret = m_rules[i];
+			}
+		}
+		
+		return(ret);
+	}
+	
+	private static ConverterRule[] m_rules={
+		new ProtocolModelConverterRuleImpl(),
+		new ProtocolConverterRuleImpl(),
+		new ParallelConverterRuleImpl(),
+		new ChoiceConverterRuleImpl(),
+		new ConditionalConverterRuleImpl(),
+		new WhenConverterRuleImpl(),
+		new WhileConverterRuleImpl(),
+		new InteractionConverterRuleImpl(),
+		new FinalizeConverterRuleImpl(),
+		new FinalizerHandlerConverterRuleImpl(),
+		new AssignConverterRuleImpl(),
+		new SequenceConverterRuleImpl(),
+		new PerformConverterRuleImpl()
+	};
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 31 Jul 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import javax.xml.namespace.QName;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This class defines some converter utility functions.
+ */
+public class ConverterUtil {
+
+	private static final String QNAME = "QName";
+
+	/**
+	 * This method converts the supplied information type into a
+	 * type reference.
+	 * 
+	 * @param infoType The information type
+	 * @return The type reference
+	 */
+	public static TypeReference getTypeReference(org.pi4soa.cdl.InformationType infoType) {
+		TypeReference ret=new TypeReference();
+		
+		// TODO: Establish 'implements' dependency between
+		// XML type and an abstract type derived from the
+		// XML namespace and localpart.
+		
+		org.pi4soa.common.xml.XMLPrefixResolver resolver=
+			org.pi4soa.cdl.util.CDLTypeUtil.getPrefixResolver(infoType.getPackage());
+		String typeName=null;
+		
+		// TODO: Need to have general way to convert
+		// namespace scoped type into a type reference
+		
+		if (org.pi4soa.common.util.NamesUtil.isSet(infoType.getTypeName())) {
+			typeName = infoType.getTypeName();
+		} else if (org.pi4soa.common.util.NamesUtil.isSet(infoType.getElementName())) {
+			typeName = infoType.getElementName();
+		}
+		
+		if (typeName != null) {
+			ret.setName(org.pi4soa.common.xml.XMLUtils.getLocalname(typeName));
+			
+			ret.getProperties().put(QNAME,
+					(new QName(org.pi4soa.common.xml.XMLUtils.getNamespace(typeName, resolver, null),
+							org.pi4soa.common.xml.XMLUtils.getLocalname(typeName))).toString());
+			
+			//ret.setNamespace(org.pi4soa.common.xml.XMLUtils.getNamespace(typeName, resolver, null));
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/DefaultConverterContext.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/DefaultConverterContext.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/DefaultConverterContext.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.ExchangeDetails;
+import org.scribble.protocol.model.*;
+
+/**
+ * The default implementation of the converter context.
+ */
+public class DefaultConverterContext implements ConverterContext {
+
+	/**
+	 * Default constructor.
+	 */
+	public DefaultConverterContext() {
+	}
+	
+	/**
+	 * This is the constructor for the converter context, initialized
+	 * with the source reference.
+	 * 
+	 * @param ref The source model reference
+	 */
+	/*
+	public DefaultConverterContext(ModelReference ref) {
+		m_source = ref;
+	}
+	*/
+	
+	/**
+	 * This method returns the source model reference.
+	 * 
+	 * @return The source model reference
+	 */
+	/*
+	public ModelReference getSource() {
+		return(m_source);
+	}
+	*/
+	
+	/**
+	 * This method returns the declaration associated
+	 * with the supplied name.
+	 * 
+	 * @param name The name
+	 * @return The declaration, or null if not found
+	 */
+	public Object getState(String name) {
+		return(m_scope.getState(name));
+	}
+	
+	/**
+	 * This method sets the declaration associated with
+	 * the supplied name.
+	 * 
+	 * @param name The name
+	 * @param decl The declaration
+	 */
+	public void setState(String name, Object decl) {
+		m_scope.setState(name, decl);
+	}
+	
+	/**
+	 * This method pushes the current state onto a stack.
+	 */
+	public void pushState() {
+		m_scope.pushState();
+	}
+	
+	/**
+	 * This method pops the current state from the stack.
+	 */
+	public void popState() {
+		m_scope.popState();
+	}
+		
+	/**
+	 * This method pushes the current scope onto a stack.
+	 */
+	public void pushScope() {
+		m_scopeStack.add(0, m_scope);
+		m_scope = new Scope();
+	}
+	
+	/**
+	 * This method pops the current scope from the stack.
+	 */
+	public void popScope() {
+		if (m_scopeStack.size() > 0) {
+			m_scope = m_scopeStack.remove(0);
+		} else {
+			logger.severe("No state entry to pop from stack");
+		}
+	}
+	
+	/**
+	 * This method adds a conversation to the context,
+	 * for use when processing activities within its
+	 * scope.
+	 * 
+	 * @param conv The conversation
+	 */
+	public void addProtocol(Protocol conv) {
+		m_protocols.add(conv);
+	}
+	
+	/**
+	 * This method removes the conversation from the
+	 * context.
+	 * 
+	 * @param conv The conversation
+	 */
+	public void removeProtocol(Protocol conv) {
+		m_protocols.remove(conv);
+	}
+	
+	/**
+	 * This method retrieves the conversation associated
+	 * with the supplied model reference.
+	 * 
+	 * @param ref The model reference
+	 * @return The conversation
+	 */
+	/*
+	public Conversation getProtocol(ModelReference ref) {
+		Conversation ret=null;
+		
+		for (int i=0; ret == null && i < m_protocols.size(); i++) {
+			Conversation subconv=(Conversation)
+							m_protocols.get(i);
+
+			if (subconv.getLocatedName() != null &&
+					subconv.getLocatedName().getName() != null &&
+						ref.getAlias().equals(
+					subconv.getLocatedName().getName()) &&
+						((ref.getLocatedRole() == null &&
+					subconv.getLocatedName().getRole() == null) ||
+						((ref.getLocatedRole() != null &&
+					subconv.getLocatedName().getRole() != null &&
+						ref.getLocatedRole().equals(
+					subconv.getLocatedName().getRole().getName()))))) {
+			
+				ret = subconv;
+			}
+		}
+
+		return(ret);
+	}
+	*/
+
+	/**
+	 * This method returns the list of Compose activities
+	 * within the model.
+	 * 
+	 * @return The list of compose activities
+	 */
+	public java.util.List<Run> getComposeActivities() {
+		return(m_composeActivities);
+	}
+	
+	/**
+	 * This method indicates that the supplied exchange
+	 * details should be ignored. This can happen if the
+	 * exchange details are used in a choice, and therefore
+	 * should not also be converted as a normal activity.
+	 * 
+	 * @param ed The exchange details
+	 */
+	public void ignore(ExchangeDetails ed) {
+		m_ignore.add(ed);
+	}
+	
+	/**
+	 * This method determines whether the supplied exchange
+	 * details should be ignored.
+	 * 
+	 * @param ed The exchange details
+	 * @return Whether the exchange details should be ignored
+	 */
+	public boolean shouldIgnore(ExchangeDetails ed) {
+		return(m_ignore.contains(ed));
+	}
+	
+	private static Logger logger = Logger.getLogger(DefaultConverterContext.class.getName());
+
+	//private ModelReference m_source=null;
+	private Scope m_scope=new Scope();
+	private java.util.List<Scope> m_scopeStack=new java.util.Vector<Scope>();
+	private java.util.List<Run> m_composeActivities=new java.util.Vector<Run>();
+	private java.util.List<Protocol> m_protocols=new java.util.Vector<Protocol>();
+	private java.util.List<ExchangeDetails> m_ignore=new java.util.Vector<ExchangeDetails>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizeConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizeConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizeConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 1 Jun 2009 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class FinalizeConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Finalize);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Run ret=
+					new org.scribble.protocol.model.Run();
+		org.pi4soa.cdl.Finalize cdl=(org.pi4soa.cdl.Finalize)cdlType;
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+
+		ProtocolReference ref=new ProtocolReference();
+		ref.setName(cdl.getChoreography().getName()+"_"+cdl.getFinalizer().getName());
+		ref.setInner(true);
+		
+		ret.setProtocolReference(ref);
+		
+		// Find conversation related to reference, and use
+		// as inner definition initially - to help with
+		// subsequent processing (e.g. locating initiator
+		// roles). The inner definition will be cleared when
+		// the model is fully converted.
+
+		/* TODO: Is this required for Scribble v2
+		Protocol prot=context.getProtocol(ref);
+		
+		if (prot != null) {
+			ret.setInlineDefinition(prot);
+			context.getComposeActivities().add(ret);
+		
+			// Bind roles
+			java.util.List<Role> roles=prot.getRoles();
+			
+			for (int i=0; i < roles.size(); i++) {
+				Role role=roles.get(i);
+				
+				Object decl=context.getState(role.getName());
+				
+				if (decl instanceof Role) {
+					ret.getBindings().add(new DeclarationBinding(((Role)decl).getName(), role.getName()));
+				}
+			}
+		}
+		*/
+				
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizerHandlerConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizerHandlerConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/FinalizerHandlerConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,306 @@
+/*
+ * Copyright 2005-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 1 Jun 2009 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.Interaction;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.XMLUtils;
+import org.scribble.protocol.model.*;
+
+public class FinalizerHandlerConverterRuleImpl implements ConverterRule {
+
+	private static final String CONVERSATION_TYPE = "conversationType";
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == Protocol.class &&
+				cdlType instanceof FinalizerHandler);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		Protocol ret=new Protocol();
+		FinalizerHandler choreo=(FinalizerHandler)cdlType;
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(choreo));
+			
+		context.pushScope();
+		
+		ret.setName(choreo.getEnclosingChoreography().getName()+"_"+choreo.getName());
+		
+		// Define roles
+		defineRoles(context, choreo, ret);
+		
+		// Convert variables
+		//convertVariables(context, choreo, ret.getBlock());
+		
+		// Define identities
+		//convertIdentities(context, choreo, ret);
+		
+		// Process all of the activities within the
+		// choreography
+		convertActivities(context, choreo.getActivities(), ret.getBlock());
+
+		context.popScope();
+		
+		return(ret);
+	}
+
+	
+	protected void defineRoles(ConverterContext context,
+			final FinalizerHandler choreo, Protocol conv) {
+	
+		final java.util.List<ParticipantType> partTypes=new java.util.Vector<ParticipantType>();
+		final java.util.List<Participant> partInstances=new java.util.Vector<Participant>();
+		
+		choreo.visit(new DefaultCDLVisitor() {
+			
+			public void interaction(Interaction interaction) {
+				
+				if (interaction.getEnclosingChoreography() != choreo.getEnclosingChoreography()) {
+					return;
+				}
+				
+				if (interaction.getFromParticipant() != null) {
+					if (partInstances.contains(interaction.getFromParticipant()) == false) {
+						partInstances.add(interaction.getFromParticipant());
+					}
+				} else {
+					ParticipantType ptype=
+						org.pi4soa.cdl.util.PackageUtil.getParticipantForRoleType(
+								interaction.getFromRoleType());
+					
+					if (ptype != null &&
+							partTypes.contains(ptype) == false) {
+						partTypes.add(ptype);
+					}
+				}
+				
+				if (interaction.getToParticipant() != null) {
+					if (partInstances.contains(interaction.getToParticipant()) == false) {
+						partInstances.add(interaction.getToParticipant());
+					}
+				} else {
+					ParticipantType ptype=
+						org.pi4soa.cdl.util.PackageUtil.getParticipantForRoleType(
+								interaction.getToRoleType());
+					
+					if (ptype != null &&
+							partTypes.contains(ptype) == false) {
+						partTypes.add(ptype);
+					}
+				}
+			}
+		});
+		
+		// Define roles
+		java.util.Iterator<Participant> piter=partInstances.iterator();
+		
+		RoleList roleList=null;
+		
+		while (piter.hasNext()) {
+			Role role=new Role();
+			Participant pinst=piter.next();
+			role.setName(pinst.getName());
+			
+			if (roleList == null) {
+				roleList = new RoleList();
+				conv.getBlock().getContents().add(roleList);
+			}
+			
+			roleList.getRoles().add(role);
+			
+			context.setState(role.getName(), role);
+		}
+
+		java.util.Iterator<ParticipantType> ptiter=partTypes.iterator();
+
+		/*
+		if (choreo.getRoot() != Boolean.TRUE) {
+			roleList = null;
+		} else {
+			ptiter = choreo.getPackage().getTypeDefinitions().getParticipantTypes().iterator();
+		}
+		*/
+	
+		while (ptiter.hasNext()) {
+			Role role=new Role();
+			ParticipantType ptype=ptiter.next();
+			role.setName(ptype.getName());
+			
+			if (roleList == null) {
+				roleList = new RoleList();
+				
+				//roleList.setOpen(choreo.getEnclosingChoreography().getRoot() != Boolean.TRUE);
+				
+				conv.getBlock().getContents().add(roleList);
+			}
+			
+			roleList.getRoles().add(role);
+			
+			context.setState(role.getName(), role);
+		}
+	}
+	
+	/*
+	protected void convertVariables(ConverterContext context,
+			FinalizerHandler choreo, Block block) {
+		
+		java.util.List<org.pi4soa.cdl.Variable> vars=
+					choreo.getEnclosingChoreography().getVariableDefinitions();
+		
+		for (int i=0; i < vars.size(); i++) {
+			org.pi4soa.cdl.Variable var=(org.pi4soa.cdl.Variable)vars.get(i);
+			
+			if (var.getType() instanceof InformationType) {				
+				java.util.List<RoleType> roleTypes=var.getRoleTypes();
+				
+				if (roleTypes.size() == 0) {
+					roleTypes = choreo.getPackage().getTypeDefinitions().getRoleTypes();
+				}
+				
+				VariableList vlist=new VariableList();
+				TypeReference ref=new TypeReference();
+				
+				String qname=((InformationType)var.getType()).getElementName();
+				
+				if (NamesUtil.isSet(qname)==false) {
+					qname=((InformationType)var.getType()).getTypeName();
+				}
+				
+				ref.setNamespace(CDLTypeUtil.getNamespace(qname, var));
+				ref.setLocalpart(XMLUtils.getLocalname(qname));
+				
+				vlist.setType(ref);
+								
+				org.scribble.conversation.model.Variable newVar=
+					new org.scribble.conversation.model.Variable();
+				
+				newVar.setName(var.getName());
+				
+				vlist.getVariables().add(newVar);
+				
+				block.getContents().add(vlist);
+			}
+		}
+	}
+	*/
+	
+	protected void convertActivities(ConverterContext context,
+				java.util.List<org.pi4soa.cdl.Activity> acts, Block block) {
+		
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+						acts.iterator();
+		
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+			
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					
+					if (activity instanceof Block) {
+						block.getContents().addAll(((Block)activity).getContents());
+					} else {
+						block.getContents().add(activity);
+					}
+				}
+			}
+		}
+	}
+	
+	/*
+	protected void convertIdentities(ConverterContext context,
+			FinalizerHandler choreo, Conversation conv) {
+		
+		// Define identities
+		java.util.List<org.pi4soa.cdl.Variable> vars=
+					choreo.getEnclosingChoreography().getVariableDefinitions();
+		java.util.List<org.scribble.conversation.model.Identity> ids=
+			new java.util.Vector<org.scribble.conversation.model.Identity>();
+
+		for (int i=0; i < vars.size(); i++) {
+			if (vars.get(i).getType() instanceof org.pi4soa.cdl.ChannelType) {
+				org.pi4soa.cdl.ChannelType ctype=
+						(org.pi4soa.cdl.ChannelType)vars.get(i).getType();
+				
+				java.util.Iterator<org.pi4soa.cdl.Identity> cids=
+						ctype.getIdentities().iterator();
+				
+				while (cids.hasNext()) {
+					org.pi4soa.cdl.Identity cid=cids.next();
+					org.scribble.conversation.model.Identity id=
+						new org.scribble.conversation.model.Identity();
+					
+					if (cid.getType() == KeyType.ASSOCIATION) {
+						id.setIdentityType(IdentityType.Association);
+					} else if (cid.getType() == KeyType.DERIVED) {
+						id.setIdentityType(IdentityType.Derived);
+					} else {
+						id.setIdentityType(IdentityType.Primary);
+					}
+					
+					for (int j=0; j < cid.getTokens().size(); j++) {
+						id.getNames().add(cid.getTokens().get(j).getName());
+					}
+					
+					if (ids.contains(id) == false) {
+						ids.add(id);
+					}
+				}
+			}
+		}
+		
+		conv.getIdentities().addAll(ids);		
+	}
+	*/
+
+	private static Logger logger = Logger.getLogger("org.pi4soa.scribble.cdm.parser.rules");
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,856 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.Interaction;
+import org.scribble.protocol.model.*;
+import org.scribble.protocol.model.Choice;
+import org.scribble.protocol.model.When;
+import org.pi4soa.cdl.util.*;
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.NameSpaceUtil;
+import org.pi4soa.common.xml.XMLUtils;
+
+public class InteractionConverterRuleImpl implements ConverterRule {
+
+	private static final String INTERFACE_NAME = "interfaceName";
+	private static final String FAULT_NAME = "faultName";
+	private static final String MESSAGE_TYPE_LOCALPART = "messageTypeLocalPart";
+	private static final String MESSAGE_TYPE_NAMESPACE = "messageTypeNameSpace";
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Interaction);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Block ret=new org.scribble.protocol.model.Block();
+		org.pi4soa.cdl.Interaction cdl=
+				(org.pi4soa.cdl.Interaction)cdlType;
+		//Role fromRole=getFromRole(context, cdl);
+		//Role toRole=getToRole(context, cdl);
+		
+		// Determine if interaction may result in
+		// a timeout
+		Block block=ret;
+		
+		/*
+			TODO: Consider how to deal with 'time to complete'
+			
+		if (NamesUtil.isSet(cdl.getTimeToComplete())) {
+			Try te=new Try();
+			
+			ret.getContents().add(te);
+			
+			block = te.getBlock();
+			
+			InterruptBlock interrupt=new InterruptBlock();
+			
+			te.getEscapeBlocks().add(interrupt);
+			
+			// Set expression from 'time to complete'
+			// using xpath
+			XPathExpression exp=new XPathExpression();
+			
+			exp.setQuery("cdl:hasDurationPassed('"+
+					cdl.getTimeToComplete()+"')");
+			
+			interrupt.setExpression(exp);
+			
+			// Perform assignments associated with timeout
+			for (int i=0; i < cdl.getRecordDetails().size(); i++) {
+				org.pi4soa.cdl.RecordDetails rd=
+							cdl.getRecordDetails().get(i);
+				
+				if (rd.getWhen() == WhenType.TIMEOUT) {
+					
+					// TODO: Record variable - but which role??? May need to
+					// be part of the following conditions, so depends on
+					// whether the record details are in the from/to timeout record details
+				
+					if (cdl.getTimeoutFromRoleTypeRecordDetails().contains(rd)) {
+						
+						if (rd.getCauseException() != null &&
+								rd.getCauseException().trim().length() > 0) {
+							Raise raise=new Raise();
+							raise.getRoles().add(new Role(fromRole.getName()));
+							
+							TypeReference tref=new TypeReference();
+							tref.setLocalpart(XMLUtils.getLocalname(rd.getCauseException()));
+							raise.setType(tref);
+							
+							interrupt.getContents().add(raise);
+						}
+					}
+					
+					if (cdl.getTimeoutToRoleTypeRecordDetails().contains(rd)) {
+						
+						if (rd.getCauseException() != null &&
+								rd.getCauseException().trim().length() > 0) {
+							Raise raise=new Raise();
+							raise.getRoles().add(new Role(toRole.getName()));
+							
+							TypeReference tref=new TypeReference();
+							tref.setLocalpart(XMLUtils.getLocalname(rd.getCauseException()));
+							raise.setType(tref);
+							
+							interrupt.getContents().add(raise);
+						}
+					}
+				}
+			}
+		}
+		*/
+		
+		java.util.Iterator<ExchangeDetails> iter=
+					cdl.getExchangeDetails().iterator();
+		java.util.List<When> cbs=
+					new java.util.Vector<When>();
+				
+		while (iter.hasNext()) {
+			ExchangeDetails details=iter.next();
+			
+			if (context.shouldIgnore(details)) {
+				continue;
+			}
+			
+			When cb=new When();
+			
+			// Convert 'before' send and receive record details
+			/*
+			for (int i=0; i < details.getSendRecordDetails().size(); i++) {
+				RecordDetails rd=details.getSendRecordDetails().get(i);
+				
+				if (rd.getWhen() == WhenType.BEFORE) {
+					String fromRoleName=(details.getAction() == ExchangeActionType.REQUEST?
+							fromRole.getName():toRole.getName());
+					*/
+					// Define record expression
+					/*
+					Assignment assign=new Assignment();
+					
+					assign.getSource().setComponentURI(
+							CDLTypeUtil.getURIFragment(rd));
+					
+					// Set role
+					Role role=new Role(fromRoleName);
+					
+					assign.getRoles().add(role);
+					
+					// Set variable
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(rd.getTargetVariable().getName());
+					
+					assign.setVariable(var);
+					
+					org.scribble.expression.xpath.model.XPathExpression expr=
+						new org.scribble.expression.xpath.model.XPathExpression();
+					
+					if (rd.getSourceExpression() != null) {
+						expr.setQuery(rd.getSourceExpression());
+					} else if (rd.getSourceVariable() != null) {
+						expr.setQuery("cdl:getVariable('"+rd.getSourceVariable().getName()+"','','')");
+					}
+					
+					assign.setExpression(expr);
+					
+					cb.getContents().add(assign);
+					*/
+					
+			/*
+					// Check for cause exception
+					if (rd.getCauseException() != null &&
+							rd.getCauseException().trim().length() > 0) {
+						
+						Raise raise=new Raise();
+						raise.getRoles().add(new Role(fromRoleName));
+						
+						TypeReference tref=new TypeReference();
+						tref.setName(XMLUtils.getLocalname(rd.getCauseException()));
+						raise.setType(tref);
+						
+						cb.getBlock().add(raise);
+					}
+				}
+			}
+			
+			for (int i=0; i < details.getReceiveRecordDetails().size(); i++) {
+				RecordDetails rd=details.getReceiveRecordDetails().get(i);
+				
+				if (rd.getWhen() == WhenType.BEFORE) {
+					String toRoleName=(details.getAction() == ExchangeActionType.REQUEST?
+							toRole.getName():fromRole.getName());
+			*/		
+					// Define record expression
+					/*
+					Assignment assign=new Assignment();
+					
+					assign.getSource().setComponentURI(
+							CDLTypeUtil.getURIFragment(rd));
+					
+					// Set role
+					Role role=new Role(toRoleName);
+					
+					assign.getRoles().add(role);
+					
+					// Set variable
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(rd.getTargetVariable().getName());
+					
+					assign.setVariable(var);
+					
+					org.scribble.expression.xpath.model.XPathExpression expr=
+						new org.scribble.expression.xpath.model.XPathExpression();
+					
+					if (rd.getSourceExpression() != null) {
+						expr.setQuery(rd.getSourceExpression());
+					} else if (rd.getSourceVariable() != null) {
+						expr.setQuery("cdl:getVariable('"+rd.getSourceVariable().getName()+"','','')");
+					}
+					
+					assign.setExpression(expr);
+					
+					cb.getContents().add(assign);
+					*/
+			/*		
+					// Check for cause exception
+					if (rd.getCauseException() != null &&
+							rd.getCauseException().trim().length() > 0) {
+						
+						Raise raise=new Raise();
+						raise.getRoles().add(new Role(toRoleName));
+						
+						TypeReference tref=new TypeReference();
+						tref.setName(XMLUtils.getLocalname(rd.getCauseException()));
+						raise.setType(tref);
+						
+						cb.getBlock().add(raise);
+					}
+				}
+			}
+			*/
+
+			// Convert the interaction
+			org.scribble.protocol.model.Interaction interaction=
+					new org.scribble.protocol.model.Interaction();
+			
+			//interaction.getSource().setComponentURI(
+			
+			interaction.getProperties().put("CDLType",
+						CDLTypeUtil.getURIFragment(details));
+			
+			// Check if interaction's channel has been explicitly defined
+			/*
+			Object ch=context.getState(cdl.getChannelVariable().getName());
+			
+			if (ch instanceof Channel) {
+				interaction.setChannel((Channel)ch);
+			}
+			*/
+			
+			// Define message signature
+			MessageSignature ms=createMessageSignature(details);
+			
+			/*
+			MessageSignature ms=new MessageSignature();
+			ms.setOperation(cdl.getOperation());
+			
+			if (NamesUtil.isSet(details.getFaultName())) {
+				ms.getProperties().put(FAULT_NAME,
+						details.getFaultName());
+			}
+			
+			// Define interaction message type
+			if (details.getType() instanceof InformationType) {
+				InformationType itype=(InformationType)details.getType();
+				
+				TypeReference ref=ConverterUtil.getTypeReference(itype);
+				
+				ms.getTypeReferences().add(ref);
+				
+				if (NamesUtil.isSet(itype.getTypeName())) {
+					String ns=CDLTypeUtil.getNamespace(itype.getTypeName(),
+									cdl);
+					String lp=XMLUtils.getLocalname(itype.getTypeName());
+					
+					if (lp != null) {
+						ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
+										lp);
+					}
+					if (ns != null) {
+						ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
+										ns);
+					}
+				} else if (NamesUtil.isSet(itype.getElementName())) {
+					String ns=CDLTypeUtil.getNamespace(itype.getElementName(),
+							cdl);
+					String lp=XMLUtils.getLocalname(itype.getElementName());
+			
+					if (lp != null) {
+						ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
+										lp);
+					}
+					if (ns != null) {
+						ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
+										ns);
+					}
+				}
+			}
+			*/
+			
+			interaction.setMessageSignature(ms);
+			
+			cb.getBlock().add(interaction);
+
+			// Set interface name
+			if (cdl.getToRoleType() != null) {
+				// TODO: Deal with interfaces that have multiple behaviours
+				interaction.getProperties().put(INTERFACE_NAME,
+						getInterfaceName(cdl));
+			}
+			
+			interaction.setFromRole(getFromRole(context, details));
+			interaction.getToRoles().add(getToRole(context, details));
+
+			if (details.getAction() == ExchangeActionType.REQUEST) {
+				
+				if (details.getSendVariable() != null) {
+					//org.scribble.conversation.model.Variable var=
+					//		new org.scribble.conversation.model.Variable();
+					//var.setName(details.getSendVariable().getName());
+					interaction.getProperties().put("SendVariable",
+									details.getSendVariable().getName());
+				}
+				
+				if (details.getReceiveVariable() != null) {
+					/*
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(details.getReceiveVariable().getName());
+					interaction.setToVariable(var);
+					*/
+					interaction.getProperties().put("ReceiveVariable",
+							details.getReceiveVariable().getName());
+				}
+				
+				// Check if request has response/fault exchanges
+				java.util.List<ExchangeDetails> resps=
+						InteractionUtil.getResponseExchangeDetails(details);
+				
+				if (resps != null && resps.size() > 0) {
+					interaction.getProperties().put("RequestLabel", getLabel(details));
+				}
+				
+				// Check if fault thrown
+				/* TODO: Determine what to do about cause exceptions on interactions
+				 * These could be used to define catch blocks?
+				 *
+				if (details.getSendCauseException() != null &&
+						details.getSendCauseException().trim().length() > 0) {
+					Raise raise=new Raise();
+					raise.getRoles().add(new Role(fromRole.getName()));
+					
+					TypeReference tref=new TypeReference();
+					tref.setName(XMLUtils.getLocalname(details.getSendCauseException()));
+					raise.setType(tref);
+					
+					cb.getBlock().add(raise);
+				}
+				
+				if (details.getReceiveCauseException() != null &&
+						details.getReceiveCauseException().trim().length() > 0) {
+					Raise raise=new Raise();
+					raise.getRoles().add(new Role(toRole.getName()));
+					
+					TypeReference tref=new TypeReference();
+					tref.setName(XMLUtils.getLocalname(details.getReceiveCauseException()));
+					raise.setType(tref);
+					
+					cb.getBlock().add(raise);
+				}
+				*/
+			} else {
+				//interaction.setFromRole(toRole);
+				//interaction.getToRoles().add(fromRole);
+				
+				if (details.getReceiveVariable() != null) {
+					/*
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(details.getReceiveVariable().getName());
+					interaction.setFromVariable(var);
+					*/
+					interaction.getProperties().put("SendVariable", details.getReceiveVariable().getName());
+				}
+				
+				if (details.getSendVariable() != null) {
+					/*
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(details.getSendVariable().getName());
+					interaction.setToVariable(var);
+					*/
+					interaction.getProperties().put("ReceiveVariable", details.getReceiveVariable().getName());
+				}
+				
+				if (details.getAction() == ExchangeActionType.RESPOND) {
+					interaction.getProperties().put("ReplyToLabel", getLabel(details));
+				}
+
+				// Check if fault thrown
+				/* TODO: Determine what to do about cause exceptions on interactions
+				 * These could be used to define catch blocks?
+				 *
+				if (details.getSendCauseException() != null &&
+						details.getSendCauseException().trim().length() > 0) {
+					Raise raise=new Raise();
+					raise.getRoles().add(new Role(toRole.getName()));
+					
+					TypeReference tref=new TypeReference();
+					tref.setName(XMLUtils.getLocalname(details.getSendCauseException()));
+					raise.setType(tref);
+					
+					cb.getBlock().add(raise);
+				}
+				
+				if (details.getReceiveCauseException() != null &&
+						details.getReceiveCauseException().trim().length() > 0) {
+					Raise raise=new Raise();
+					raise.getRoles().add(new Role(fromRole.getName()));
+					
+					TypeReference tref=new TypeReference();
+					tref.setName(XMLUtils.getLocalname(details.getReceiveCauseException()));
+					raise.setType(tref);
+					
+					cb.getBlock().add(raise);
+				}
+				*/
+			}
+			
+			// Convert 'after' send and receive record details
+			/*
+			for (int i=0; i < details.getSendRecordDetails().size(); i++) {
+				RecordDetails rd=details.getSendRecordDetails().get(i);
+				
+				if (rd.getWhen() == WhenType.AFTER) {
+					String fromRoleName=(details.getAction() == ExchangeActionType.REQUEST?
+							fromRole.getName():toRole.getName());
+			*/		
+					/*
+					// Define record expression
+					Assignment assign=new Assignment();
+					
+					assign.getSource().setComponentURI(
+							CDLTypeUtil.getURIFragment(rd));
+					
+					// Set role
+					Role role=new Role(fromRoleName);
+					
+					assign.getRoles().add(role);
+					
+					// Set variable
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(rd.getTargetVariable().getName());
+					
+					assign.setVariable(var);
+					
+					org.scribble.expression.xpath.model.XPathExpression expr=
+						new org.scribble.expression.xpath.model.XPathExpression();
+					
+					if (rd.getSourceExpression() != null) {
+						expr.setQuery(rd.getSourceExpression());
+					} else if (rd.getSourceVariable() != null) {
+						expr.setQuery("cdl:getVariable('"+rd.getSourceVariable().getName()+"','','')");
+					}
+					
+					assign.setExpression(expr);
+					
+					cb.getContents().add(assign);
+					*/
+			/*		
+					// Check for cause exception
+					if (rd.getCauseException() != null &&
+							rd.getCauseException().trim().length() > 0) {
+						
+						Raise raise=new Raise();
+						raise.getRoles().add(new Role(fromRoleName));
+						
+						TypeReference tref=new TypeReference();
+						tref.setName(XMLUtils.getLocalname(rd.getCauseException()));
+						raise.setType(tref);
+						
+						cb.getBlock().add(raise);
+					}
+				}
+			}
+			
+			for (int i=0; i < details.getReceiveRecordDetails().size(); i++) {
+				RecordDetails rd=details.getReceiveRecordDetails().get(i);
+				
+				if (rd.getWhen() == WhenType.AFTER) {
+					String toRoleName=(details.getAction() == ExchangeActionType.REQUEST?
+							toRole.getName():fromRole.getName());
+					
+					/*
+					// Define record expression
+					Assignment assign=new Assignment();
+					
+					assign.getSource().setComponentURI(
+							CDLTypeUtil.getURIFragment(rd));
+					
+					// Set role
+					Role role=new Role(toRoleName);
+					
+					assign.getRoles().add(role);
+					
+					// Set variable
+					org.scribble.conversation.model.Variable var=
+							new org.scribble.conversation.model.Variable();
+					var.setName(rd.getTargetVariable().getName());
+					
+					assign.setVariable(var);
+					
+					// If target variable is a channel, then make explicit
+					if (rd.getTargetVariable().getType() instanceof ChannelType) {
+						Object state=context.getState(rd.getTargetVariable().getName());
+						
+						if (state == null) {
+							Channel newch=new Channel();
+							newch.setName(rd.getTargetVariable().getName());
+							
+							context.setState(newch.getName(), newch);
+							
+							//
+						}
+					}
+					
+					// Convert source expression
+					org.scribble.expression.xpath.model.XPathExpression expr=
+						new org.scribble.expression.xpath.model.XPathExpression();
+					
+					if (rd.getSourceExpression() != null) {
+						expr.setQuery(rd.getSourceExpression());
+					} else if (rd.getSourceVariable() != null) {
+						expr.setQuery("cdl:getVariable('"+rd.getSourceVariable().getName()+"','','')");
+					}
+					
+					assign.setExpression(expr);
+					
+					cb.getContents().add(assign);
+					*/
+		/*			
+					// Check for cause exception
+					if (rd.getCauseException() != null &&
+							rd.getCauseException().trim().length() > 0) {
+						
+						Raise raise=new Raise();
+						raise.getRoles().add(new Role(toRoleName));
+						
+						TypeReference tref=new TypeReference();
+						tref.setName(XMLUtils.getLocalname(rd.getCauseException()));
+						raise.setType(tref);
+						
+						cb.getBlock().add(raise);
+					}
+				}
+			}
+			*/
+
+			cbs.add(cb);
+		}
+		
+		if (cbs.size() > 2) {
+			block.getContents().addAll(cbs.remove(0).getBlock().getContents());
+			
+			Choice choice=new Choice();
+			
+			//choice.getRoles().add(new Role(toRole.getName()));
+			
+			for (int i=0; i < cbs.size(); i++) {
+				When cb=cbs.get(i);
+				
+				choice.getWhens().add(cb);
+			}
+			
+			block.getContents().add(choice);			
+		} else {
+			for (int i=0; i < cbs.size(); i++) {
+				When cb=cbs.get(i);
+				block.getContents().addAll(cb.getBlock().getContents());
+			}
+		}
+
+		return(ret);
+	}
+	
+	public static Role getFromRole(ConverterContext context, org.pi4soa.cdl.ExchangeDetails ed) {
+		Role fromRole=null;
+		org.pi4soa.cdl.Interaction cdl=ed.getInteraction();
+		
+		if (ed.getAction() == ExchangeActionType.REQUEST) {
+			if (cdl.getFromParticipant() != null) {
+				fromRole = (Role)
+					context.getState(XMLUtils.getLocalname(cdl.getFromParticipant().getName()));
+				
+				if (fromRole == null) {
+					logger.severe("Failed to get 'from' role '"+XMLUtils.getLocalname(cdl.getFromParticipant().getName())+"'");
+				}
+			} else if (cdl.getFromRoleType() != null) {			
+				ParticipantType ptype=
+					PackageUtil.getParticipantForRoleType(cdl.getFromRoleType());
+				
+				fromRole = (Role)
+					context.getState(XMLUtils.getLocalname(ptype.getName()));
+				
+				if (fromRole == null) {
+					logger.severe("Failed to get 'from' role '"+XMLUtils.getLocalname(ptype.getName())+"'");
+				}
+			}
+		} else {
+			if (cdl.getToParticipant() != null) {
+				fromRole = (Role)
+					context.getState(XMLUtils.getLocalname(cdl.getToParticipant().getName()));
+	
+				if (fromRole == null) {
+					logger.severe("Failed to get 'to' role '"+XMLUtils.getLocalname(cdl.getFromParticipant().getName())+"'");
+				}
+			} else if (cdl.getToRoleType() != null) {
+				ParticipantType ptype=
+					PackageUtil.getParticipantForRoleType(cdl.getToRoleType());
+				
+				fromRole = (Role)
+					context.getState(XMLUtils.getLocalname(ptype.getName()));
+				
+				if (fromRole == null) {
+					logger.severe("Failed to get 'to' role '"+XMLUtils.getLocalname(ptype.getName())+"'");
+				}
+			}
+		}
+
+		return(fromRole);
+	}
+	
+	public static Role getToRole(ConverterContext context, org.pi4soa.cdl.ExchangeDetails ed) {
+		Role toRole=null;
+		org.pi4soa.cdl.Interaction cdl=ed.getInteraction();
+		
+		if (ed.getAction() == ExchangeActionType.REQUEST) {
+			if (cdl.getToParticipant() != null) {
+				toRole = (Role)
+					context.getState(XMLUtils.getLocalname(cdl.getToParticipant().getName()));
+	
+				if (toRole == null) {
+					logger.severe("Failed to get 'to' role '"+XMLUtils.getLocalname(cdl.getFromParticipant().getName())+"'");
+				}
+			} else if (cdl.getToRoleType() != null) {
+				ParticipantType ptype=
+					PackageUtil.getParticipantForRoleType(cdl.getToRoleType());
+				
+				toRole = (Role)
+					context.getState(XMLUtils.getLocalname(ptype.getName()));
+				
+				if (toRole == null) {
+					logger.severe("Failed to get 'to' role '"+XMLUtils.getLocalname(ptype.getName())+"'");
+				}
+			}
+		} else {
+			if (cdl.getFromParticipant() != null) {
+				toRole = (Role)
+					context.getState(XMLUtils.getLocalname(cdl.getFromParticipant().getName()));
+				
+				if (toRole == null) {
+					logger.severe("Failed to get 'from' role '"+XMLUtils.getLocalname(cdl.getFromParticipant().getName())+"'");
+				}
+			} else if (cdl.getFromRoleType() != null) {			
+				ParticipantType ptype=
+					PackageUtil.getParticipantForRoleType(cdl.getFromRoleType());
+				
+				toRole = (Role)
+					context.getState(XMLUtils.getLocalname(ptype.getName()));
+				
+				if (toRole == null) {
+					logger.severe("Failed to get 'from' role '"+XMLUtils.getLocalname(ptype.getName())+"'");
+				}
+			}
+		}
+
+		return(toRole);
+	}
+	
+	public static MessageSignature createMessageSignature(ExchangeDetails details) {
+		org.pi4soa.cdl.Interaction cdl=details.getInteraction();
+		
+		// Define message signature
+		MessageSignature ms=new MessageSignature();
+		ms.setOperation(cdl.getOperation());
+		
+		if (NamesUtil.isSet(details.getFaultName())) {
+			ms.getProperties().put(FAULT_NAME,
+					details.getFaultName());
+		}
+
+		// Define interaction message type
+		if (details.getType() instanceof InformationType) {
+			InformationType itype=(InformationType)details.getType();
+			
+			TypeReference ref=ConverterUtil.getTypeReference(itype);
+			
+			ms.getTypeReferences().add(ref);
+			
+			if (NamesUtil.isSet(itype.getTypeName())) {
+				String ns=CDLTypeUtil.getNamespace(itype.getTypeName(),
+								cdl);
+				String lp=XMLUtils.getLocalname(itype.getTypeName());
+				
+				if (lp != null) {
+					ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
+									lp);
+				}
+				if (ns != null) {
+					ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
+									ns);
+				}
+			} else if (NamesUtil.isSet(itype.getElementName())) {
+				String ns=CDLTypeUtil.getNamespace(itype.getElementName(),
+						cdl);
+				String lp=XMLUtils.getLocalname(itype.getElementName());
+		
+				if (lp != null) {
+					ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
+									lp);
+				}
+				if (ns != null) {
+					ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
+									ns);
+				}
+			}
+		}
+		
+		return(ms);
+	}
+	
+	/**
+	 * This method creates a label appropriate for the request
+	 * response correlation associated with the supplied exchange.
+	 * 
+	 * @param details The exchange
+	 * @return The label
+	 */
+	protected String getLabel(ExchangeDetails details) {
+		String ret=null;
+		
+		if (details.getInteraction() != null) {
+			ret = details.getInteraction().getOperation();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the interface name associated with the
+	 * supplied role type.
+	 * 
+	 * @param interaction The interaction
+	 * @return The interface name
+	 */
+	protected String getInterfaceName(org.pi4soa.cdl.Interaction interaction) {
+		String ret=null;
+		
+		if (interaction != null) {
+			String intfName=getInterface(interaction);
+			
+			String ns=CDLTypeUtil.getNamespace(intfName, interaction, true);
+			String lp=XMLUtils.getLocalname(intfName);
+			
+			ret = NameSpaceUtil.getFullyQualifiedName(ns, lp);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the interaction's interface.
+	 * 
+	 * @param interaction The interaction
+	 * @return The interface
+	 */
+	public static String getInterface(Interaction interaction) {
+		String ret=null;
+			
+		if (interaction != null &&
+				interaction.getChannelVariable() != null &&
+				interaction.getChannelVariable().getType() instanceof
+						ChannelType) {
+			ChannelType ctype=(ChannelType)
+					interaction.getChannelVariable().getType();
+			
+			if (ctype.getBehavior() != null) {
+				ret = ctype.getBehavior().getInterface();
+				
+				if (NamesUtil.isSet(ret)==false) {
+					ret = ctype.getBehavior().getName();
+				}
+			} else if (ctype.getRoleType() != null) {
+				
+				// Attempt to find default behavior
+				org.pi4soa.cdl.Behavior behavior=
+					ctype.getRoleType().getBehavior(null);
+				
+				if (behavior != null) {
+					ret = behavior.getInterface();
+					
+					if (NamesUtil.isSet(ret)==false) {
+						ret = behavior.getName();
+					}
+				}
+			}
+		}
+		
+		return(ret);
+	}
+
+	private static Logger logger = Logger.getLogger("org.pi4soa.scribble.cdm.parser.rules");
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ParallelConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ParallelConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ParallelConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class ParallelConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Parallel);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Parallel ret=
+				new org.scribble.protocol.model.Parallel();
+		org.pi4soa.cdl.Parallel cdl=(org.pi4soa.cdl.Parallel)cdlType;
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				
+				context.pushState();
+				
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					if (activity instanceof Block) {
+						ret.getBlocks().add((Block)activity);
+					} else {
+						Block block=new Block();
+						block.getContents().add(activity);
+						ret.getBlocks().add(block);
+					}
+				}
+				
+				context.popState();
+			}
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/PerformConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/PerformConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/PerformConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 27 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class PerformConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Perform);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Run ret=new org.scribble.protocol.model.Run();
+		org.pi4soa.cdl.Perform cdl=(org.pi4soa.cdl.Perform)cdlType;
+		
+		if (cdl.getWaitForCompletion() != Boolean.TRUE) {
+			// TODO: Need to consider how to deal with async perform
+			// possibly when split is supported
+		}
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+
+		ProtocolReference ref=new ProtocolReference();
+		ref.setName(cdl.getChoreography().getName());
+		ref.setInner(true);
+		
+		ret.setProtocolReference(ref);
+		
+		// Find conversation related to reference, and use
+		// as inner definition initially - to help with
+		// subsequent processing (e.g. locating initiator
+		// roles). The inner definition will be cleared when
+		// the model is fully converted.
+		
+		/* TODO: Is this required for Scribble v2
+		Protocol conv=context.getProtocol(ref);
+		
+		if (conv != null) {
+			ret.setInlineDefinition(conv);
+			context.getComposeActivities().add(ret);
+		
+			// Bind roles
+			java.util.List<Role> roles=conv.getRoles();
+			
+			for (int i=0; i < roles.size(); i++) {
+				Role role=roles.get(i);
+				
+				Object decl=context.getState(role.getName());
+				
+				if (decl instanceof Role) {
+					ret.getBindings().add(new DeclarationBinding(((Role)decl).getName(), role.getName()));
+				}
+			}
+		}
+		*/
+		
+		// Convert binding parameters
+		java.util.List<BindDetails> bds=cdl.getBindDetails();
+		
+		for (int i=0; i < bds.size(); i++) {
+			
+			// Only convert if a variable, not a channel
+			// TODO: Need to also convert explicit channels
+			if (bds.get(i).getThisVariable() instanceof org.pi4soa.cdl.Variable) {
+				Parameter db=new Parameter();
+				
+				Object state=context.getState(bds.get(i).getThisVariable().getName());
+				
+				if (state instanceof Role) {
+					db.setName(((Role)state).getName());
+					db.setBoundName(bds.get(i).getFreeVariable().getName());
+				
+					ret.getParameters().add(db);
+				} else {
+					logger.finer("State not found for '"+bds.get(i).getThisVariable().getName()+"'");
+				}
+			}
+		}
+				
+		return(ret);
+	}
+	
+	private static Logger logger = Logger.getLogger("org.pi4soa.scribble.cdm.parser.rules");
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,802 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.Interaction;
+import org.pi4soa.cdl.interfaces.InterfaceDefinition;
+import org.pi4soa.cdl.interfaces.InterfaceVisitor;
+import org.pi4soa.cdl.interfaces.MessageDefinition;
+import org.pi4soa.cdl.interfaces.OperationDefinition;
+import org.pi4soa.cdl.interfaces.RoleTypeDefinition;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.pi4soa.cdl.util.PackageUtil;
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.XMLUtils;
+import org.savara.contract.model.*;
+import org.scribble.protocol.model.*;
+
+public class ProtocolConverterRuleImpl implements ConverterRule {
+
+	private static final String CONVERSATION_TYPE = "conversationType";
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == Protocol.class &&
+				cdlType instanceof Choreography);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		Protocol ret=new Protocol();
+		Choreography choreo=(Choreography)cdlType;
+		
+		//ret.getSource().setComponentURI(
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(choreo));
+			
+		context.pushScope();
+		
+		//LocatedName modelName=new LocatedName();
+		//modelName.setName(choreo.getName());
+		
+		ret.setName(choreo.getName());
+		
+		// Define roles
+		defineRoles(context, choreo, ret);
+		
+		// Check if root, then need to project other sibling choreos
+		if (choreo.getRoot() == Boolean.TRUE) {
+			
+			java.util.Iterator<Choreography> citer=
+				choreo.getPackage().getChoreographies().iterator();
+	
+			while (citer.hasNext()) {
+				Choreography subchoreo=citer.next();
+				
+				if (subchoreo != choreo) {
+					Protocol subconv=(Protocol)
+							convert(context, Protocol.class, subchoreo);
+					
+					ret.getBlock().getContents().add(subconv);
+					
+					context.addProtocol(subconv);
+				}
+				
+				for (int i=0; i < subchoreo.getFinalizers().size(); i++) {
+					FinalizerHandler finalizer=subchoreo.getFinalizers().get(i);
+					
+					ConverterRule rule=ConverterRuleFactory.getConverter(
+							Protocol.class, finalizer);
+					
+					if (rule != null) {
+						
+						Protocol subconv=(Protocol)
+							rule.convert(context, Protocol.class, finalizer);
+					
+						ret.getBlock().getContents().add(subconv);
+					
+						context.addProtocol(subconv);
+					}
+				}
+			}
+		}
+		
+		// Process any sub-choreographies	
+		java.util.Iterator<Choreography> citer=
+					choreo.getEnclosedChoreographies().iterator();
+		
+		while (citer.hasNext()) {
+			Choreography subchoreo=citer.next();
+
+			Protocol subconv=(Protocol)
+					convert(context, Protocol.class, subchoreo);
+			
+			ret.getBlock().getContents().add(subconv);
+			
+			context.addProtocol(subconv);
+			
+			for (int i=0; i < subchoreo.getFinalizers().size(); i++) {
+				FinalizerHandler finalizer=subchoreo.getFinalizers().get(i);
+				
+				ConverterRule rule=ConverterRuleFactory.getConverter(
+						Protocol.class, finalizer);
+				
+				if (rule != null) {
+					
+					subconv = (Protocol)
+						rule.convert(context, Protocol.class, finalizer);
+				
+					ret.getBlock().getContents().add(subconv);
+				
+					context.addProtocol(subconv);
+				}
+			}
+		}
+		
+		// Convert variables
+		//convertVariables(context, choreo, ret.getBlock());
+		
+		// Define identities
+		//convertIdentities(context, choreo, ret);
+		
+		// Check if exception handlers have been defined
+		// and/or completion condition
+		if (NamesUtil.isSet(choreo.getCompletionCondition()) ||
+			(choreo.getExceptionHandler() != null &&
+					choreo.getExceptionHandler().getExceptionWorkUnits().size() > 0)) {
+			
+			Try te=new Try();
+			ret.getBlock().getContents().add(te);
+			
+			// Process all of the activities within the
+			// choreography
+			convertActivities(context, choreo.getActivities(),
+						te.getBlock());
+			
+			for (int i=0; choreo.getExceptionHandler() != null &&
+						i < choreo.getExceptionHandler().
+						getExceptionWorkUnits().size(); i++) {
+				ExceptionWorkUnit ewu=choreo.getExceptionHandler().
+					getExceptionWorkUnits().get(i);
+				
+				Catch catchPath=new Catch();
+
+				/*
+				 * TODO: Consider how to deal with catch types
+				 *
+				if (NamesUtil.isSet(ewu.getExceptionType())) {
+					TypeReference ref=new TypeReference();
+					ref.setLocalpart(XMLUtils.getLocalname(ewu.getExceptionType()));
+					ref.setNamespace(CDLTypeUtil.getNamespace(
+							ewu.getExceptionType(), choreo));
+					
+					catchPath.setType(ref);					
+				}
+				*/
+				
+				te.getCatches().add(catchPath);
+				
+				convertActivities(context, ewu.getActivities(),
+								catchPath.getBlock());
+			}
+			
+			/*
+			 * TODO: Deal with completion condition
+			 *
+			if (NamesUtil.isSet(choreo.getCompletionCondition())) {
+				InterruptBlock interrupt=new InterruptBlock();
+				
+				te.getEscapeBlocks().add(interrupt);
+				
+				// Set expression from completion condition
+				// using xpath
+				XPathExpression exp=new XPathExpression();
+				
+				exp.setQuery(choreo.getCompletionCondition());
+				
+				interrupt.setExpression(exp);
+
+				// No activities
+			}
+			*/
+		} else {
+		
+			// Process all of the activities within the
+			// choreography
+			convertActivities(context, choreo.getActivities(), ret.getBlock());
+		}
+		
+		// Transfer sub-conversations to end of block
+		if (ret.getBlock().getContents().size() > 0) {
+			org.scribble.protocol.model.Activity lastAct=
+				ret.getBlock().getContents().get(ret.getBlock().getContents().size()-1);
+			int pos=0;
+			while (ret.getBlock().get(pos) != lastAct) {
+				if (ret.getBlock().get(pos) instanceof Protocol) {
+					Protocol c=(Protocol)ret.getBlock().get(pos);
+	
+					ret.getBlock().getContents().remove(pos);
+					ret.getBlock().getContents().add(c);
+					
+					context.removeProtocol(c);
+				} else {
+					pos++;
+				}
+			}
+		}
+		
+		context.popScope();
+		
+		return(ret);
+	}
+
+	
+	protected void defineRoles(ConverterContext context,
+			final Choreography choreo, Protocol conv) {
+	
+		org.pi4soa.cdl.interfaces.InterfaceDeriver intfDeriver=
+					org.pi4soa.cdl.interfaces.InterfaceFactory.getInterfaceDeriver();
+		
+		final java.util.List<ParticipantType> partTypes=new java.util.Vector<ParticipantType>();
+		final java.util.List<Participant> partInstances=new java.util.Vector<Participant>();
+		
+		choreo.visit(new DefaultCDLVisitor() {
+			
+			public void interaction(Interaction interaction) {
+				
+				if (interaction.getEnclosingChoreography() != choreo) {
+					return;
+				}
+				
+				if (interaction.getFromParticipant() != null) {
+					if (partInstances.contains(interaction.getFromParticipant()) == false) {
+						partInstances.add(interaction.getFromParticipant());
+					}
+				} else {
+					ParticipantType ptype=
+						org.pi4soa.cdl.util.PackageUtil.getParticipantForRoleType(
+								interaction.getFromRoleType());
+					
+					if (ptype != null &&
+							partTypes.contains(ptype) == false) {
+						partTypes.add(ptype);
+					}
+				}
+				
+				if (interaction.getToParticipant() != null) {
+					if (partInstances.contains(interaction.getToParticipant()) == false) {
+						partInstances.add(interaction.getToParticipant());
+					}
+				} else {
+					ParticipantType ptype=
+						org.pi4soa.cdl.util.PackageUtil.getParticipantForRoleType(
+								interaction.getToRoleType());
+					
+					if (ptype != null &&
+							partTypes.contains(ptype) == false) {
+						partTypes.add(ptype);
+					}
+				}
+			}
+		});
+		
+		// Define roles
+		java.util.Iterator<Participant> piter=partInstances.iterator();
+		
+		RoleList roleList=null;
+		
+		while (piter.hasNext()) {
+			Role role=new Role();
+			Participant pinst=piter.next();
+			role.setName(pinst.getName());
+			
+			if (roleList == null) {
+				roleList = new RoleList();
+				conv.getBlock().getContents().add(roleList);
+			}
+			
+			roleList.getRoles().add(role);
+			
+			context.setState(role.getName(), role);
+
+			// TODO: registerRole seems to only deal with ConversationType
+			// which is not required when using TAP
+			//registerRole(context, choreo, conv, roleList, role, pinst);
+			
+			// Setup interfaces
+			for (int i=0; i < pinst.getRoleTypes().size(); i++) {
+				Contract contract=null;
+				
+				if (role.getProperties().containsKey(Contract.class.getName())) {
+					contract = (Contract)role.getProperties().get(
+								Contract.class.getName());
+				} else {
+					contract = new Contract();
+					
+					java.util.List<?> ptypes=
+							PackageUtil.getParticipantsForRoleTypes(choreo.getPackage(),
+									pinst.getRoleTypes());
+					
+					if (ptypes.size() == 1) {
+						ParticipantType pt=(ParticipantType)ptypes.get(0);
+						
+						contract.setName(XMLUtils.getLocalname(pt.getName()));
+						contract.setNamespace(CDLTypeUtil.getNamespace(pt.getName(), pt));
+					} else {
+						
+						logger.warning("Could not find single participant type for participant instance '"+
+								pinst.getName()+"'");
+						contract.setName(XMLUtils.getLocalname(pinst.getName()));
+						contract.setNamespace(CDLTypeUtil.getNamespace(pinst.getName(), pinst));
+					}
+					
+					// Setup namespace to prefix mappings
+					java.util.List<NameSpace> nspaces=pinst.getPackage().getTypeDefinitions().getNameSpaces();
+					
+					for (int j=0; j < nspaces.size(); j++) {
+						org.savara.contract.model.Namespace ns=
+									new org.savara.contract.model.Namespace();
+						
+						ns.setPrefix(nspaces.get(j).getPrefix());
+						ns.setURI(nspaces.get(j).getURI());
+						ns.setSchemaLocation(nspaces.get(j).getSchemaLocation());
+						
+						contract.getNamespaces().add(ns);
+					}
+					
+					role.getProperties().put(Contract.class.getName(),
+												contract);
+				}
+				
+				setupInterfaces((org.pi4soa.cdl.RoleType)pinst.getRoleTypes().get(i),
+								contract, intfDeriver);
+			}
+		}
+
+		java.util.Iterator<ParticipantType> ptiter=partTypes.iterator();
+
+		if (choreo.getRoot() != Boolean.TRUE) {
+			roleList = null;
+		} else {
+			ptiter = choreo.getPackage().getTypeDefinitions().getParticipantTypes().iterator();
+		}
+	
+		while (ptiter.hasNext()) {
+			Role role=new Role();
+			ParticipantType ptype=ptiter.next();
+			role.setName(XMLUtils.getLocalname(ptype.getName()));
+			
+			if (roleList == null) {
+				roleList = new RoleList();
+				
+				//roleList.setOpen(choreo.getRoot() != Boolean.TRUE);
+				
+				conv.getBlock().getContents().add(roleList);
+			}
+			
+			roleList.getRoles().add(role);
+			
+			context.setState(role.getName(), role);
+
+			if (choreo.getRoot() == Boolean.TRUE) {
+				// TODO: registerRole seems to only deal with ConversationType
+				// which is not required when using TAP
+				//registerRole(context, choreo, conv, roleList, role, ptype);
+				
+				// Setup interfaces
+				for (int i=0; i < ptype.getRoleTypes().size(); i++) {
+					Contract contract=null;
+					
+					if (role.getProperties().containsKey(Contract.class.getName())) {
+						contract = (Contract)role.getProperties().get(
+									Contract.class.getName());
+					} else {
+						contract = new Contract();
+						
+						contract.setName(XMLUtils.getLocalname(ptype.getName()));
+						contract.setNamespace(CDLTypeUtil.getNamespace(ptype.getName(), ptype, true));
+						
+						// Setup namespace to prefix mappings
+						java.util.List<NameSpace> nspaces=ptype.getPackage().getTypeDefinitions().getNameSpaces();
+						
+						for (int j=0; j < nspaces.size(); j++) {
+							org.savara.contract.model.Namespace ns=
+										new org.savara.contract.model.Namespace();
+							
+							ns.setPrefix(nspaces.get(j).getPrefix());
+							ns.setURI(nspaces.get(j).getURI());
+							ns.setSchemaLocation(nspaces.get(j).getSchemaLocation());
+							
+							contract.getNamespaces().add(ns);
+						}
+						
+						role.getProperties().put(Contract.class.getName(),
+													contract);
+					}
+
+					setupInterfaces((org.pi4soa.cdl.RoleType)ptype.getRoleTypes().get(i),
+									contract, intfDeriver);
+				}
+			}
+		}
+	}
+	
+	protected void setupInterfaces(org.pi4soa.cdl.RoleType roleType, Contract contract,
+					org.pi4soa.cdl.interfaces.InterfaceDeriver intfDeriver) {
+		
+		org.pi4soa.cdl.interfaces.RoleTypeDefinition rtd=
+						intfDeriver.getRoleTypeDefinition(roleType);
+				
+		InterfaceVisitorImpl iv=new InterfaceVisitorImpl(contract);
+		
+		rtd.visit(iv);
+	}
+	
+	/*
+	protected void convertVariables(ConverterContext context,
+			Choreography choreo, Block block) {
+		
+		java.util.List<org.pi4soa.cdl.Variable> vars=
+					choreo.getVariableDefinitions();
+		
+		for (int i=0; i < vars.size(); i++) {
+			org.pi4soa.cdl.Variable var=(org.pi4soa.cdl.Variable)vars.get(i);
+			
+			if (var.getType() instanceof InformationType) {				
+				java.util.List<RoleType> roleTypes=var.getRoleTypes();
+				
+				if (roleTypes.size() == 0) {
+					roleTypes = choreo.getPackage().getTypeDefinitions().getRoleTypes();
+				}
+				
+				VariableList vlist=new VariableList();
+				TypeReference ref=new TypeReference();
+				
+				String qname=((InformationType)var.getType()).getElementName();
+				
+				if (NamesUtil.isSet(qname)==false) {
+					qname=((InformationType)var.getType()).getTypeName();
+				}
+				
+				ref.setNamespace(CDLTypeUtil.getNamespace(qname, var));
+				ref.setLocalpart(XMLUtils.getLocalname(qname));
+				
+				vlist.setType(ref);
+				
+				/* TODO: See if variables should be located?
+				for (int j=0; j < roleTypes.size(); j++) {
+					org.scribble.conversation.model.Variable newVar=
+						new org.scribble.conversation.model.Variable();
+					
+					newVar.setName(var.getName());
+				}
+				*/
+				
+	/*
+				org.scribble.conversation.model.Variable newVar=
+					new org.scribble.conversation.model.Variable();
+				
+				newVar.setName(var.getName());
+				
+				vlist.getVariables().add(newVar);
+				
+				block.getContents().add(vlist);
+				
+			} else if (var.getType() instanceof ChannelType) {	
+				
+				// TODO: Only convert if channel is explicitly defined
+				
+
+			}
+		}
+	}
+	*/
+	
+	protected void convertActivities(ConverterContext context,
+				java.util.List<org.pi4soa.cdl.Activity> acts, Block block) {
+		
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+						acts.iterator();
+		
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+			
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					
+					if (activity instanceof Block) {
+						block.getContents().addAll(((Block)activity).getContents());
+					} else {
+						block.getContents().add(activity);
+					}
+				}
+			}
+		}
+	}
+	
+	/*
+	protected void convertIdentities(ConverterContext context,
+					Choreography choreo, Conversation conv) {
+		
+		// Define identities
+		java.util.List<org.pi4soa.cdl.Variable> vars=
+					choreo.getVariableDefinitions();
+		java.util.List<org.scribble.conversation.model.Identity> ids=
+			new java.util.Vector<org.scribble.conversation.model.Identity>();
+
+		for (int i=0; i < vars.size(); i++) {
+			if (vars.get(i).getType() instanceof org.pi4soa.cdl.ChannelType) {
+				org.pi4soa.cdl.ChannelType ctype=
+						(org.pi4soa.cdl.ChannelType)vars.get(i).getType();
+				
+				java.util.Iterator<org.pi4soa.cdl.Identity> cids=
+						ctype.getIdentities().iterator();
+				
+				while (cids.hasNext()) {
+					org.pi4soa.cdl.Identity cid=cids.next();
+					org.scribble.conversation.model.Identity id=
+						new org.scribble.conversation.model.Identity();
+					
+					if (cid.getType() == KeyType.ASSOCIATION) {
+						id.setIdentityType(IdentityType.Association);
+					} else if (cid.getType() == KeyType.DERIVED) {
+						id.setIdentityType(IdentityType.Derived);
+					} else {
+						id.setIdentityType(IdentityType.Primary);
+					}
+					
+					for (int j=0; j < cid.getTokens().size(); j++) {
+						id.getNames().add(cid.getTokens().get(j).getName());
+					}
+					
+					if (ids.contains(id) == false) {
+						ids.add(id);
+					}
+				}
+			}
+		}
+		
+		conv.getIdentities().addAll(ids);		
+	}
+	*/
+	
+	/*
+	 * Not sure if required when using TAP to relate resources, rather than
+	 * info in each artifact.
+	 *
+	private void registerRole(ConverterContext context,
+			Choreography choreo,
+			Protocol conv, RoleList roleList,
+				Role role, CDLType cdlType) {
+		
+		if (cdlType.getSemanticAnnotations().size() > 0) {
+			java.util.Iterator<SemanticAnnotation> iter=
+					cdlType.getSemanticAnnotations().iterator();
+			
+			while (iter.hasNext()) {
+				SemanticAnnotation annotation=iter.next();
+				
+				if (annotation.getName() != null &&
+						annotation.getName().equals(CONVERSATION_TYPE)) {
+					String convType=annotation.getAnnotation();
+					
+					if (convType != null) {
+						int index=convType.indexOf('@');
+					
+						if (index != -1) {
+							ConformanceReference ref=
+								new ConformanceReference(ConversationNotation.NOTATION_CODE);
+						
+							ref.setLocatedRole(convType.substring(index+1));
+							
+							String mainpart=convType.substring(0, index);
+							
+							index = mainpart.lastIndexOf(".");
+							
+							String namespace="";
+							String localpart=mainpart;
+							
+							if (index != -1) {
+								namespace=mainpart.substring(0, index);								
+								localpart=mainpart.substring(index+1);
+							}
+							
+							String[] elems=localpart.split("\\$");
+							if (elems.length > 1) {
+								localpart = elems[0];
+								
+								for (int i=1; i < elems.length; i++) {
+									ref.getSubDefinitionPath().addPathElement(elems[i]);
+								}
+							}
+							
+							ref.setNamespace(namespace);
+							ref.setLocalpart(localpart);
+							
+							ref.setFullyQualified(true);
+							
+							conv.getConformsTo().add(ref);
+							
+							ModelReference sref=context.getSource();
+							
+							// If not the root choreography, then
+							// identify the sub definition path
+							// in the source reference
+							if (choreo.getRoot() != Boolean.TRUE) {
+								sref = new ModelReference(sref);
+								Choreography sub=choreo;
+								
+								while (sub != null && sub.getRoot() != Boolean.TRUE) {
+									sref.getSubDefinitionPath().addPathElement(0, sub.getName());
+									
+									sub = sub.getParent().getEnclosingChoreography();
+								}
+							}
+							
+							// Establish 'conforms to' dependency
+							// between source (which could be a
+							// sub definition) and the identified
+							// conversation type
+							
+							// GPB: TO REMOVE dm.recordDependency(sref, ref,
+							//		DependencyType.ConformsTo);
+
+						} else {
+							logger.warning("Conversation type '"+
+									convType+"' does not " +
+									"contain '@' located role separator");
+						}
+					}
+					
+				}
+			}
+		}
+	}
+		*/
+
+	private static Logger logger = Logger.getLogger(ProtocolConverterRuleImpl.class.getPackage().getName());
+	
+	public static class InterfaceVisitorImpl implements InterfaceVisitor,
+							java.io.Serializable {
+		
+		private static final long serialVersionUID = 4068744630125720449L;
+		
+		private org.savara.contract.model.Contract m_contract=null;
+		private org.savara.contract.model.Interface m_currentInterface=null;
+		private org.savara.contract.model.MessageExchangePattern m_currentMEP=null;
+
+		public InterfaceVisitorImpl(Contract contract) {
+			m_contract = contract;
+		}
+		
+		public Contract getContract() {
+			return(m_contract);
+		}
+		
+		public void interfaceEnd(InterfaceDefinition defn) {
+			m_currentInterface = null;
+		}
+
+		public void interfaceStart(InterfaceDefinition defn) {
+			m_currentInterface = new org.savara.contract.model.Interface();
+			
+			m_currentInterface.setNamespace(defn.getNamespace());
+
+			if (defn.getInterfaceName() != null &&
+					defn.getInterfaceName().trim().length() > 0) {
+				m_currentInterface.setName(defn.getInterfaceName());
+			} else {
+				m_currentInterface.setName(defn.getBehaviorName());
+			}
+			
+			m_contract.getInterfaces().add(m_currentInterface);
+		}
+
+		public void message(MessageDefinition defn) {
+			
+			if (defn.getClassification() == MessageDefinition.INPUT) {
+				m_currentMEP.getTypes().add(createType(defn));
+				
+			} else if (m_currentMEP instanceof RequestResponseMEP) {
+				RequestResponseMEP mep=(RequestResponseMEP)m_currentMEP;
+				
+				if (defn.getClassification() == MessageDefinition.OUTPUT) {
+					mep.getResponseTypes().add(createType(defn));
+					
+				} else if (defn.getClassification() == MessageDefinition.OUTFAULT) {
+					FaultDetails fault=new FaultDetails();
+					
+					fault.setName(defn.getFaultName());
+					fault.setNamespace(defn.getFaultNamespace());
+					
+					fault.getTypes().add(createType(defn));
+					
+					mep.getFaultDetails().add(fault);
+				}
+			}
+		}
+		
+		protected Type createType(MessageDefinition defn) {
+			Type ret=new Type();
+			TypeDefinition td=new TypeDefinition();
+			ret.getTypeDefinitions().add(td);
+			
+			if (defn.getElement() != null && defn.getElement().trim().length() > 0) {
+				td.setName(defn.getElement());
+				
+				if (defn.getElementNamespace() != null) {
+					td.setNamespace(defn.getElementNamespace());
+				}
+				
+				td.setTypeSystem(TypeDefinition.XSD_ELEMENT);
+
+			} else if (defn.getType() != null && defn.getType().trim().length() > 0) {
+				td.setName(defn.getType());
+				
+				if (defn.getTypeNamespace() != null) {
+					td.setNamespace(defn.getTypeNamespace());
+				}
+				
+				td.setTypeSystem(TypeDefinition.XSD_TYPE);
+			}
+			
+			ret.setName(td.getName());
+			
+			return(ret);
+		}
+
+		public void operationEnd(OperationDefinition defn) {
+			m_currentMEP = null;
+		}
+
+		public void operationStart(OperationDefinition defn) {
+			if (defn.getMessages().size() == 1 &&
+					((MessageDefinition)defn.getMessages().get(0)).getClassification()
+							== MessageDefinition.INPUT) {
+				m_currentMEP = new OneWayRequestMEP();
+			} else {
+				m_currentMEP = new RequestResponseMEP();
+			}
+			
+			m_currentMEP.setOperation(defn.getOperationName());
+			
+			m_currentInterface.getMessageExchangePatterns().add(m_currentMEP);
+		}
+
+		public void roleTypeEnd(RoleTypeDefinition defn) {
+			// TODO Auto-generated method stub
+			
+		}
+
+		public void roleTypeStart(RoleTypeDefinition defn) {
+			// TODO Auto-generated method stub
+			
+		}	
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 31 Jul 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class ProtocolModelConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == ProtocolModel.class &&
+				cdlType instanceof org.pi4soa.cdl.Package);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		ProtocolModel ret=new ProtocolModel();
+		org.pi4soa.cdl.Package cdlpack=(org.pi4soa.cdl.Package)cdlType;
+		
+		//ret.getSource().setComponentURI(
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdlpack));
+			
+		// TODO: Consider how to use the namespace information
+		//ret.setNamespace(getNamespace(cdlpack));
+		
+		// Convert token locators
+		/* TODO: How to deal with identity and locators
+		java.util.Iterator<TokenLocator> locators=
+				cdlpack.getTypeDefinitions().getTokenLocators().iterator();
+		
+		while (locators.hasNext()) {
+			TokenLocator locator=locators.next();
+			
+			IdentityLocator idLocator=new IdentityLocator();
+			idLocator.setLocator(locator.getToken().getName(),
+						locator.getQuery());
+			
+			TypeReference typeRef=ConverterUtil.getTypeReference(locator.getInformationType());
+			idLocator.setType(typeRef);
+			
+			ret.getIdentityLocators().add(idLocator);
+		}
+		*/
+		
+		// Convert root choreography
+		java.util.Iterator<org.pi4soa.cdl.Choreography> iter=
+					cdlpack.getChoreographies().iterator();
+		org.pi4soa.cdl.Choreography choreo=null;
+	
+		while (choreo == null && iter.hasNext()) {
+			choreo = iter.next();
+			
+			if (choreo.getRoot() != Boolean.TRUE) {
+				choreo = null;
+			}
+		}
+			
+		ConverterRule rule=ConverterRuleFactory.getConverter(Protocol.class,
+					choreo);
+		
+		if (rule != null) {
+			ret.setProtocol((Protocol)rule.convert(context,
+					Protocol.class, choreo));
+		} else {
+			logger.severe("Failed to find conversation conversion rule");
+		}
+		
+		// Clear the inner definition for any Compose activities
+		// The inner definitions are temporarily established to
+		// help internal analysis, e.g. to determine initiator
+		// roles
+		
+		/*
+		 * TODO: Not sure if necessary to clear out definitions???
+		 *
+		for (int i=0; i < context.getComposeActivities().size(); i++) {
+			// Save parent
+			Protocol defn=context.getComposeActivities().get(i).getProtocol();
+			ModelObject parent=defn.getParent();
+			
+			context.getComposeActivities().get(i).setInlineDefinition(null);
+			
+			// Re-establish parent
+			defn.setParent(parent);
+		}
+		*/
+		
+		return(ret);
+	}
+
+
+	/**
+	 * This method generates a namespace associated with
+	 * the supplied CDL package.
+	 * 
+	 * @param cdlpack The choreography package
+	 * @return The namespace
+	 */
+	/*
+	protected static org.scribble.protocol.model.Namespace getNamespace(
+							org.pi4soa.cdl.Package cdlpack) {
+		org.scribble.protocol.model.Namespace ret=new org.scribble.protocol.model.Namespace();
+		
+		String ns=cdlpack.getTargetNamespace()+"/"+cdlpack.getName();
+		
+		if (ns.startsWith("http://")) {
+			ns = ns.substring(7);
+		}
+		
+		if (ns.startsWith("www.")) {
+			ns = ns.substring(4);
+		}
+		
+		java.util.StringTokenizer st=new java.util.StringTokenizer(ns, "/");
+		boolean f_first=true;
+		String namespace=null;
+		
+		while (st.hasMoreTokens()) {
+			String token=st.nextToken();
+			
+			if (f_first) {
+				java.util.StringTokenizer innerst=
+						new java.util.StringTokenizer(token, ".");
+				while (innerst.hasMoreTokens()) {
+					if (namespace == null) {
+						namespace = innerst.nextToken();
+					} else {
+						namespace = innerst.nextToken()+"."+namespace;
+					}
+				}
+				
+				f_first = false;
+			} else {
+				namespace += "."+token;
+			}
+		}
+		
+		if (namespace != null) {
+			ret.setName(namespace.toLowerCase());
+		}
+		
+		return(ret);
+	}
+	*/
+
+	private static Logger logger = Logger.getLogger(ProtocolModelConverterRuleImpl.class.getName());
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/Scope.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/Scope.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/Scope.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2007 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 1 Nov 2007 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import java.util.logging.Logger;
+
+/**
+ * This class represents information associated with a scope.
+ */
+public class Scope {
+
+	/**
+	 * The default constructor for the scope.
+	 */
+	public Scope() {
+		// Initialize the state
+		pushState();
+	}
+	
+	/**
+	 * This is the copy constructor for the scope.
+	 * 
+	 * @param copy The copy
+	 */
+	public Scope(Scope copy) {
+		m_locatedRole = copy.m_locatedRole;
+		
+		for (int i=0; i < copy.m_stateStack.size(); i++) {
+			java.util.Map<String,Object> current=copy.m_stateStack.get(i);
+			
+			java.util.Map<String,Object> copyStackEntry=
+						new java.util.HashMap<String,Object>();
+		
+			java.util.Iterator<String> iter=current.keySet().iterator();
+			
+			while (iter.hasNext()) {
+				String key=iter.next();
+				Object value=current.get(key);
+				
+				copyStackEntry.put(key, value);
+			}
+			
+			m_stateStack.add(copyStackEntry);
+		}
+	}
+	
+	/**
+	 * This method returns the named state from the current
+	 * scope.
+	 * 
+	 * @param name The state name
+	 * @return The state value, or null if not found
+	 */
+	public Object getState(String name) {
+		Object ret=null;
+		
+		if (m_stateStack.size() > 0) {
+			for (int i=0; ret == null && i < m_stateStack.size(); i++) {
+				java.util.Map<String,Object> current=m_stateStack.get(i);
+				ret = current.get(name);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method sets the value associated with the supplied
+	 * name in the current state scope.
+	 * 
+	 * @param name The state name
+	 * @param value The state value
+	 */
+	public void setState(String name, Object value) {
+		if (m_stateStack.size() > 0) {
+			java.util.Map<String,Object> current=m_stateStack.get(0);
+			current.put(name, value);
+		}
+	}
+
+	/**
+	 * This method returns the located role associated with the
+	 * current scope.
+	 * 
+	 * @return The located role
+	 */
+	public String getLocatedRole() {
+		return(m_locatedRole);
+	}
+	
+	/**
+	 * This method sets the located role associated with the
+	 * current scope.
+	 * 
+	 * @param located The located role
+	 */
+	public void setLocatedRole(String located) {
+		m_locatedRole = located;
+	}
+
+	/**
+	 * This method pushes the current state onto a stack.
+	 */
+	public void pushState() {
+		m_stateStack.add(0, new java.util.Hashtable<String,Object>());
+	}
+	
+	/**
+	 * This method pops the current state from the stack.
+	 */
+	public void popState() {
+		if (m_stateStack.size() > 0) {
+			m_stateStack.remove(0);
+		} else {
+			logger.severe("No state entry to pop from stack");
+		}
+	}
+	
+	/**
+	 * This method returns the properties associated with
+	 * the scope.
+	 * 
+	 * @return The properties
+	 */
+	public java.util.Map<String,Object> getProperties() {
+		return(m_properties);
+	}
+		
+	private static Logger logger = Logger.getLogger("org.scribble.parser");
+
+	private String m_locatedRole=null;
+	private java.util.List<java.util.Map<String,Object>> m_stateStack=
+		new java.util.Vector<java.util.Map<String,Object>>();
+	private java.util.Map<String,Object> m_properties=new java.util.HashMap<String, Object>();
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/SequenceConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/SequenceConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/SequenceConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class SequenceConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.Sequence);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Block ret=
+				new org.scribble.protocol.model.Block();
+		org.pi4soa.cdl.Sequence cdl=(org.pi4soa.cdl.Sequence)cdlType;
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+
+		context.pushState();
+		
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					if (activity instanceof Block) {
+						ret.getContents().addAll(
+								((Block)activity).getContents());
+					} else {
+						ret.getContents().add(activity);
+					}
+				}
+			}
+		}
+		
+		context.popState();
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhenConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhenConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhenConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class WhenConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.When);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		//org.scribble.conversation.model.When ret=
+		//		new org.scribble.conversation.model.When();
+		org.pi4soa.cdl.When cdl=(org.pi4soa.cdl.When)cdlType;
+		
+		//ret.getProperties().put("CDLType",
+		//		CDLTypeUtil.getURIFragment(cdl));
+
+		Block block=new Block();
+		
+		context.pushState();
+		
+		// Set the expression if defined in the 'when'
+		/*
+		if (cdl.getExpression() != null) {
+			XPathExpression exp=new XPathExpression();
+		
+			exp.setQuery(cdl.getExpression());
+		
+			block.setExpression(exp);
+		}
+		*/
+				
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					if (activity instanceof Block) {
+						block.getContents().addAll(((Block)activity).getContents());
+					} else {
+						block.getContents().add(activity);
+					}
+				}
+			}
+		}
+		
+		// Get initiator role(s) for first activity in body and
+		// associated with When
+		//ret.getRoles().addAll(block.getInitiatorRoles());
+		
+		context.popState();
+				
+		//return(ret);
+		return(block);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhileConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhileConverterRuleImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/WhileConverterRuleImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 6 Jun 2008 : Initial version created by gary
+ */
+package org.savara.pi4soa.cdm.parser.rules;
+
+import org.pi4soa.cdl.*;
+import org.pi4soa.cdl.util.CDLTypeUtil;
+import org.scribble.protocol.model.*;
+
+public class WhileConverterRuleImpl implements ConverterRule {
+
+	/**
+	 * This method determines whether the rule can be applied
+	 * to the supplied CDL type.
+	 * 
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type
+	 * @return Whether the rule is appropriate to convert
+	 * 					the CDL type
+	 */
+	public boolean isSupported(Class<?> scribbleType,
+						CDLType cdlType) {
+		return(scribbleType == org.scribble.protocol.model.Activity.class &&
+				cdlType instanceof org.pi4soa.cdl.While);
+	}
+	
+	/**
+	 * This method converts the supplied CDL type into a
+	 * Scribble model object.
+	 * 
+	 * @param context The converters context
+	 * @param scribbleType The Scribble target type
+	 * @param cdlType The CDL type to be converted
+	 * @return The converted Scribble model object
+	 */
+	public ModelObject convert(ConverterContext context,
+			Class<?> scribbleType, CDLType cdlType) {
+		org.scribble.protocol.model.Repeat ret=
+				new org.scribble.protocol.model.Repeat();
+		org.pi4soa.cdl.While cdl=(org.pi4soa.cdl.While)cdlType;
+		
+		ret.getProperties().put("CDLType",
+				CDLTypeUtil.getURIFragment(cdl));
+
+		context.pushState();
+		
+		// Set the expression if defined in the 'while'
+		/*
+		if (cdl.getExpression() != null &&
+				cdl.getExpression().trim().length() > 0) {
+			XPathExpression exp=new XPathExpression();
+		
+			exp.setQuery(cdl.getExpression());
+		
+			ret.getBlock().setExpression(exp);
+		}
+		*/
+				
+		// Process all of the activities within the
+		// choreography
+		java.util.Iterator<org.pi4soa.cdl.Activity> actiter=
+					cdl.getActivities().iterator();
+		while (actiter.hasNext()) {
+			org.pi4soa.cdl.Activity act=actiter.next();
+			
+			ConverterRule rule=ConverterRuleFactory.getConverter(
+					org.scribble.protocol.model.Activity.class, act);
+		
+			if (rule != null) {
+				org.scribble.protocol.model.Activity activity=
+					(org.scribble.protocol.model.Activity)
+					rule.convert(context,
+							org.scribble.protocol.model.Activity.class, act);
+				
+				if (activity != null) {
+					if (activity instanceof Block) {
+						ret.getBlock().getContents().addAll(((Block)activity).getContents());
+					} else {
+						ret.getBlock().getContents().add(activity);
+					}
+				}
+			}
+		}
+		
+		// Get initiator role(s) for first activity in body and
+		// associated with While
+		//ret.getRoles().addAll(ret.getBlock().getInitiatorRoles());
+		
+		context.popState();
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,80 @@
+package org.savara.pi4soa.cdm.parser;
+
+import static org.junit.Assert.*;
+
+import org.scribble.common.logging.Journal;
+import org.scribble.common.logging.TestJournal;
+import org.scribble.protocol.model.ProtocolModel;
+
+public class CDMProtocolParserTest {
+
+	public ProtocolModel getModel(String filename, Journal logger) {
+		ProtocolModel ret=null;
+		
+		java.io.InputStream is=
+				ClassLoader.getSystemResourceAsStream(filename);
+		
+		if (is == null) {
+			fail("Failed to load protocol '"+filename+"'");
+		}
+		
+		org.scribble.protocol.parser.ProtocolParser parser=
+					new org.savara.pi4soa.cdm.parser.CDMProtocolParser();
+		
+		ret = parser.parse(is, logger);
+		
+		return(ret);
+	}
+	
+	public void verify(ProtocolModel model, String sprFile) {
+		TestJournal journal=new TestJournal();
+		
+		org.scribble.protocol.export.text.TextProtocolExporter exporter=
+			new org.scribble.protocol.export.text.TextProtocolExporter();
+
+		try {
+			java.io.ByteArrayOutputStream os=
+				new java.io.ByteArrayOutputStream();
+			
+			exporter.export(model, journal, os);
+			
+			String spr=new String(os.toByteArray());
+			
+			spr = spr.replaceAll("\r\n", "\n");
+			
+			java.io.InputStream is=
+				ClassLoader.getSystemResourceAsStream(sprFile);
+		
+			if (is == null) {
+				fail("Failed to load scribble protocol '"+sprFile+"'");
+			}
+			
+			byte[] b=new byte[is.available()];
+			
+			is.read(b);
+			
+			String sprText=new String(b);
+			
+			if (spr.equals(sprText) == false) {
+				System.out.println("Derived choreo=\r\n"+spr);
+				fail("Protocol derived from choreography: (len="+spr.length()+")\r\n::"+spr+
+						"::\r\n\r\ndoes not match expected: (len="+sprText.length()+")\r\n::"+sprText+"::");
+			}
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	@org.junit.Test
+	public void testParse() {
+		TestJournal logger=new TestJournal();
+		
+		ProtocolModel model=getModel("cdm/PurchaseGoods.cdm", logger);
+		
+		assertNotNull(model);
+		
+		assertTrue(logger.getErrorCount() == 0);
+		
+		verify(model, "spr/PurchaseGoods.spr");
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/cdm/PurchaseGoods.cdm
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/cdm/PurchaseGoods.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/cdm/PurchaseGoods.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PurchaseGoods" name="PurchaseGoods" author="gary" version="0.1" targetNamespace="http://www.jboss.org/savara/examples">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+    <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+    <informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="" elementName="sto:BuyConfirmed"/>
+    <informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="" elementName="sto:BuyFailed"/>
+    <informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="" elementName="sto:BuyRequest"/>
+    <informationTypes description="This is the information type CreditCheckInvalid" name="CreditCheckInvalid" typeName="" elementName="ca:CreditCheckInvalid"/>
+    <informationTypes description="This is the information type CreditCheckOk" name="CreditCheckOk" typeName="" elementName="ca:CreditCheckOk"/>
+    <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" typeName="" elementName="ca:CreditCheckRequest"/>
+    <informationTypes description="This is the information type IDType" name="IDType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URITokenType" name="URITokenType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token ID" name="ID" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator BuyFailedIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.1" query="//@id" name="BuyFailedIDLocator"/>
+    <tokenLocators description="This is the token locator BuyRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//@id" name="BuyRequestIDLocator"/>
+    <tokenLocators description="This is the token locator BuyResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.0" query="//@id" name="BuyResponseIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckInvalidIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//@id" name="CreditCheckInvalidIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@id" name="CreditCheckRequestIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.4" query="//@id" name="CreditCheckResponseIDLocator"/>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="ca:CreditAgencyInterface"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Store" name="Store">
+      <behaviors description="This is the behavior StoreBehavior" name="StoreBehavior" interface="sto:StoreInterface"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Buyer and Store" name="BuyerToStoreRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between Store and CreditAgency" name="StoreToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type Buyer" name="Buyer" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type ca:CreditAgency" name="ca:CreditAgency" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="savara.samples.Common at CreditAgency" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type sto:Store" name="sto:Store" roleTypes="//@typeDefinitions/@roleTypes.2">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Store" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type StoreChannelType" name="StoreChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.2">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the PurchaseGoods process" name="PurchaseGoodsProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.0"/>
+    <variableDefinitions name="CreditCheckVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.1"/>
+    <variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/@informationTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/@informationTypes.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.5" receiveVariable="//@choreographies.0/@variableDefinitions.1">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" name="CreditValid" expression="cdl:getVariable('CreditCheckVar','','//@amount','CreditAgency') &lt; 250">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/@informationTypes.4" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond" faultName="CreditCheckFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" faultName="BuyFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/spr/PurchaseGoods.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/spr/PurchaseGoods.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/spr/PurchaseGoods.spr	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,13 @@
+protocol PurchaseGoodsProcess {
+	role Buyer, CreditAgency, Store;
+	buy(BuyRequest) from Buyer to Store;
+	checkCredit(CreditCheckRequest) from Store to CreditAgency;
+	choice from CreditAgency to Store {
+		checkCredit(CreditCheckOk):
+			buy(BuyConfirmed) from Store to Buyer;
+
+		checkCredit(CreditCheckInvalid):
+			buy(BuyFailed) from Store to Buyer;
+
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+  <classpathentry kind="src" path="/org.savara.contract.model"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0.20101208-M2/org.scribble.common-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0.20101208-M2/org.scribble.protocol-2.0.0.20101208-M2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/.project
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/.project	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,22 @@
+<projectDescription>
+  <name>org.savara.wsdl</name>
+  <comment>The SAVARA project. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects>
+    <project>org.savara.contract.model</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.ManifestBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.pde.SchemaBuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.pde.PluginNature</nature>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA WSDL
+Bundle-SymbolicName: org.savara.wsdl
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.wsdl.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: javax.wsdl;visibility:=reexport,
+ org.savara.contract.model,
+ org.apache.commons.logging,
+ org.scribble.common,
+ org.scribble.protocol,
+ org.junit
+Export-Package: org.savara.wsdl.generator,
+ org.savara.wsdl.generator.impl,
+ org.savara.wsdl.generator.soap,
+ org.savara.wsdl.util

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/build.properties
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.savara.wsdl</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::WSDL</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId>
+			<version>${scribble.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId>
+			<version>${savara.version}</version>
+		</dependency>
+		<dependency>
+		    <groupId>commons-logging</groupId>
+		    <artifactId>commons-logging</artifactId>
+		    <version>1.1.1</version>
+		</dependency>
+		<dependency>
+		    <groupId>wsdl4j</groupId>
+		    <artifactId>wsdl4j</artifactId>
+		    <version>1.6.2</version>
+		</dependency>
+		<dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+           	<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+   </dependencies>
+</project>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLBinding.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLBinding.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLBinding.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,92 @@
+/*
+ * 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.wsdl.generator;
+
+/**
+ * This interface is used to establish binding information on a
+ * WSDL definition.
+ *
+ */
+public interface WSDLBinding {
+
+	/**
+	 * This method returns the name of the WSDL binding implementation.
+	 * 
+	 * @return The WSDL binding
+	 */
+	public String getName();
+	
+	/**
+	 * This method initializes the WSDL definition for the binding.
+	 * 
+	 * @param defn The definition
+	 */
+	public void initDefinition(javax.wsdl.Definition defn);
+	
+	/**
+	 * This method adds WSDL binding information to the port binding.
+	 * 
+	 * @param defn The definition
+	 * @param binding The port type
+	 */
+	public void updateBinding(javax.wsdl.Definition defn, javax.wsdl.Binding binding);
+	
+	/**
+	 * This method adds WSDL binding information to the operation.
+	 * 
+	 * @param defn The definition
+	 * @param mep The message exchange pattern
+	 * @param operation The operation
+	 */
+	public void updateOperation(javax.wsdl.Definition defn,
+			org.savara.contract.model.MessageExchangePattern mep,
+			javax.wsdl.BindingOperation operation);
+	
+	/**
+	 * This method adds WSDL binding information to the input.
+	 * 
+	 * @param defn The definition
+	 * @param input The input
+	 */
+	public void updateInput(javax.wsdl.Definition defn, javax.wsdl.BindingInput input);
+	
+	/**
+	 * This method adds WSDL binding information to the output.
+	 * 
+	 * @param defn The definition
+	 * @param output The output
+	 */
+	public void updateOutput(javax.wsdl.Definition defn, javax.wsdl.BindingOutput output);
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param fault The fault
+	 */
+	public void updateFault(javax.wsdl.Definition defn, javax.wsdl.BindingFault fault);
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param port The port
+	 */
+	public void updatePort(javax.wsdl.Definition defn, javax.wsdl.Port port);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGenerator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,36 @@
+/*
+ * 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.wsdl.generator;
+
+/**
+ * This interface generates a WSDL definition from a Contract model.
+ *
+ */
+public interface WSDLGenerator {
+
+	/**
+	 * This method generates a WSDL definition from a Scribble contract model.
+	 * 
+	 * @param contract The contract model
+	 * @param wsdlBinding The WSDL binding to use, or null if no binding
+	 * @return The WSDL definition
+	 */
+	public java.util.List<javax.wsdl.Definition> generate(org.savara.contract.model.Contract contract,
+								WSDLBinding wsdlBinding);
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGeneratorFactory.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGeneratorFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/WSDLGeneratorFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,37 @@
+/*
+ * 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.wsdl.generator;
+
+import org.savara.wsdl.generator.impl.WSDLGeneratorImpl;
+
+/**
+ * This class provides a factory for WSDL Generators.
+ *
+ */
+public class WSDLGeneratorFactory {
+
+	/**
+	 * This method returns a WSDL generator.
+	 * 
+	 * @return The WSDL generator
+	 */
+	public static WSDLGenerator getWSDLGenerator() {
+		return(new WSDLGeneratorImpl());
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,537 @@
+/*
+ * 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.wsdl.generator.impl;
+
+import javax.wsdl.Part;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.contract.model.FaultDetails;
+import org.savara.contract.model.Interface;
+import org.savara.contract.model.Namespace;
+import org.savara.contract.model.RequestResponseMEP;
+import org.savara.contract.model.Type;
+import org.savara.contract.model.TypeDefinition;
+import org.savara.wsdl.generator.WSDLBinding;
+import org.savara.wsdl.generator.WSDLGenerator;
+import org.savara.wsdl.util.WSDLGeneratorUtil;
+
+/**
+ * This class generates a WSDL definition from a Contract model.
+ *
+ */
+public class WSDLGeneratorImpl implements WSDLGenerator {
+
+	public static final String BINDING_SUFFIX = "Binding";
+	
+	private static Log logger = LogFactory.getLog(WSDLGeneratorImpl.class);
+	
+	public WSDLGeneratorImpl() {
+	}
+	
+	/**
+	 * This method generates a WSDL definition from a Scribble contract model.
+	 * 
+	 * @param contract The contract model
+	 * @param wsdlBinding The WSDL binding to use, or null if no binding
+	 * @return The WSDL definition
+	 */
+	public java.util.List<javax.wsdl.Definition> generate(org.savara.contract.model.Contract contract,
+								WSDLBinding wsdlBinding) {
+		java.util.List<javax.wsdl.Definition> ret=new java.util.Vector<javax.wsdl.Definition>();
+		
+		try {
+			// Create definition for contract's target namespace
+			javax.wsdl.Definition main=getDefinition(ret, contract, contract.getNamespace(), wsdlBinding);
+			
+			// If no definition, then return
+			if (main == null) {
+				return(ret);
+			}
+			
+			// Create service
+			javax.wsdl.Service service=main.createService();
+			service.setQName(new javax.xml.namespace.QName(contract.getNamespace(),
+								contract.getName()+"Service"));
+
+			main.addService(service);
+			
+			// Define a port type per interface
+			java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
+			
+			while (iter.hasNext()) {
+				Interface intf=iter.next();
+				
+				javax.wsdl.PortType portType=
+							createPortType(ret, contract, intf, wsdlBinding);
+				
+				javax.wsdl.Binding binding=
+							createBinding(ret, contract, intf, portType, wsdlBinding);
+				
+				// Create service port for interface
+				javax.wsdl.Port port=main.createPort();
+				
+				port.setName(intf.getName()+"Port");
+				port.setBinding(binding);
+				
+				service.addPort(port);
+				
+				if (wsdlBinding != null) {
+					wsdlBinding.updatePort(main, port);
+				}
+			}
+			
+		} catch(Exception e) {
+			logger.error("Failed to generate WSDL", e);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the definition associated with the supplied target namespace.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param targetNamespace The target namespace
+	 * @param wsdlBinding The WSDL binding to use, or null if no binding
+	 * @return The WSDL definition for the target namespace, or null if unable to find or create
+	 */
+	protected javax.wsdl.Definition getDefinition(java.util.List<javax.wsdl.Definition> wsdls,
+				org.savara.contract.model.Contract contract, String targetNamespace,
+				WSDLBinding wsdlBinding) {
+		javax.wsdl.Definition ret=null;
+		
+		if (targetNamespace != null) {
+			for (int i=0; ret == null && i < wsdls.size(); i++) {
+				ret = wsdls.get(i);
+				
+				if (ret.getTargetNamespace() == null || 
+						ret.getTargetNamespace().equals(targetNamespace) == false) {
+					ret = null;
+				}
+			}
+			
+			if (ret == null) {
+				ret = createDefinition(contract, targetNamespace);
+				
+				if (ret != null) {
+					
+					// Initialize definition using the WSDL binding
+					if (wsdlBinding != null) {
+						wsdlBinding.initDefinition(ret);
+					}
+					
+					wsdls.add(ret);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method creates a new WSDL definition associated with the supplied
+	 * target namespace.
+	 * 
+	 * @param contract The contract
+	 * @param targetNamespace The target namespace
+	 * @return The WSDL definition
+	 */
+	protected javax.wsdl.Definition createDefinition(org.savara.contract.model.Contract contract,
+									String targetNamespace) {
+		javax.wsdl.Definition ret=null;
+		
+		try {
+			javax.wsdl.factory.WSDLFactory fact=
+				javax.wsdl.factory.WSDLFactory.newInstance();
+	
+			ret = fact.newDefinition();
+			
+			// Set details on the definition
+			if (contract.getName() != null) {
+				ret.setQName(new javax.xml.namespace.QName(contract.getName()));
+			}
+			ret.setTargetNamespace(targetNamespace);
+			
+			// Set up namespace mappings
+			java.util.Iterator<Namespace> iter=contract.getNamespaces().iterator();
+			
+			while (iter.hasNext()) {
+				Namespace ns=iter.next();
+				
+				ret.addNamespace(ns.getPrefix(), ns.getURI());
+			}
+
+		} catch(Exception e) {
+			logger.error("Failed to create WSDL definition for target namespace '"+targetNamespace+"'", e);
+		}
+
+		return(ret);
+	}
+
+	/**
+	 * This method generates a port type, using the supplied WSDL definition,
+	 * based on the information in the supplied interface definition.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param intf The interface model
+	 * @return The WSDL port type
+	 */
+	public javax.wsdl.PortType createPortType(java.util.List<javax.wsdl.Definition> wsdls,
+						org.savara.contract.model.Contract contract,
+								org.savara.contract.model.Interface intf,
+								WSDLBinding wsdlBinding) {
+		javax.wsdl.PortType ret=null;
+		
+		if (intf != null) {
+			javax.wsdl.Definition defn=getDefinition(wsdls, contract, intf.getNamespace(), wsdlBinding);
+
+			if (defn != null) {
+				ret = defn.createPortType();
+				ret.setUndefined(false);
+				
+				if (intf.getName() != null) {
+					ret.setQName(new javax.xml.namespace.QName(intf.getNamespace(), intf.getName()));
+				}
+				
+				for (int i=0; i < intf.getMessageExchangePatterns().size(); i++) {
+					createOperation(wsdls, contract, ret,
+								intf.getMessageExchangePatterns().get(i), wsdlBinding);
+				}
+
+				// Only add portType to definition if they have atleast one operation
+				if (ret != null && ret.getOperations().size() > 0) {
+					defn.addPortType(ret);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method generates a port type binding, using the supplied WSDL definition,
+	 * based on the information in the supplied interface definition.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param intf The interface model
+	 * @param portType The port type
+	 * @return The WSDL port type binding
+	 */
+	public javax.wsdl.Binding createBinding(java.util.List<javax.wsdl.Definition> wsdls,
+						org.savara.contract.model.Contract contract,
+								org.savara.contract.model.Interface intf,
+								javax.wsdl.PortType portType,
+								WSDLBinding wsdlBinding) {
+		javax.wsdl.Binding ret=null;
+		
+		if (intf != null) {
+			javax.wsdl.Definition defn=getDefinition(wsdls, contract, intf.getNamespace(), wsdlBinding);
+
+			if (defn != null) {
+				ret = defn.createBinding();
+				ret.setUndefined(false);
+				
+				// Check if WSDL binding details
+				if (wsdlBinding != null) {
+					wsdlBinding.updateBinding(defn, ret);
+				}
+				
+				if (intf.getName() != null) {
+					ret.setQName(new javax.xml.namespace.QName(intf.getNamespace(), 
+							intf.getName()+BINDING_SUFFIX));
+				}
+				
+				ret.setPortType(portType);
+				
+				for (int i=0; i < intf.getMessageExchangePatterns().size(); i++) {
+					createBindingOperation(wsdls, contract, ret,
+								intf.getMessageExchangePatterns().get(i), wsdlBinding);
+				}
+
+				// Only add portType to definition if they have atleast one operation
+				if (ret != null && ret.getBindingOperations().size() > 0) {
+					defn.addBinding(ret);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method generates an operation, using the supplied WSDL definition,
+	 * based on the information in the supplied message exchange pattern.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param portType The port type
+	 * @param mep The message exchange pattern
+	 * @return The WSDL operation
+	 */
+	public javax.wsdl.Operation createOperation(java.util.List<javax.wsdl.Definition> wsdls,
+			org.savara.contract.model.Contract contract, javax.wsdl.PortType portType,
+								org.savara.contract.model.MessageExchangePattern mep,
+								WSDLBinding wsdlBinding) {
+		javax.wsdl.Operation ret=null;
+		
+		javax.wsdl.Definition defn=null;
+		
+		if (portType != null) {
+			defn = getDefinition(wsdls, contract, portType.getQName().getNamespaceURI(), wsdlBinding);
+		}
+
+		if (defn != null && mep != null) {
+			ret = defn.createOperation();
+			ret.setUndefined(false);
+			
+			ret.setName(mep.getOperation());
+			
+			QName msgname=WSDLGeneratorUtil.getRequestMessageType(portType.getQName().getNamespaceURI(),
+								mep.getOperation());
+			
+			javax.wsdl.Message mesg=getMessage(wsdls, contract, msgname,
+								mep.getTypes(), wsdlBinding);
+			
+			if (mesg != null) {
+				javax.wsdl.Input input=defn.createInput();
+				input.setMessage(mesg);
+				ret.setInput(input);
+			}
+			
+			// Check if a request/response MEP
+			if (mep instanceof RequestResponseMEP) {
+				RequestResponseMEP rr=(RequestResponseMEP)mep;
+				
+				msgname=WSDLGeneratorUtil.getResponseMessageType(portType.getQName().getNamespaceURI(),
+								mep.getOperation());
+			
+				javax.wsdl.Message om=getMessage(wsdls, contract, msgname,
+									rr.getResponseTypes(), wsdlBinding);
+				if (om != null) {
+					javax.wsdl.Output output=defn.createOutput();
+					output.setMessage(om);
+					ret.setOutput(output);
+				}
+				
+				// Generate fault details
+				if (rr.getFaultDetails() != null) {
+					for (int i=0; i < rr.getFaultDetails().size(); i++) {
+						FaultDetails fd=rr.getFaultDetails().get(i);
+						
+						msgname = WSDLGeneratorUtil.getFaultMessageType(portType.getQName().getNamespaceURI(),
+												fd.getName());
+					
+						javax.wsdl.Message fm=getMessage(wsdls, contract, msgname,
+											fd.getTypes(), wsdlBinding);
+						if (fm != null) {
+							javax.wsdl.Fault fault=defn.createFault();
+							fault.setName(fd.getName());
+							fault.setMessage(fm);
+							
+							ret.addFault(fault);
+						}
+					}
+				}
+			}
+			
+			portType.addOperation(ret);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method generates a binding operation, using the supplied WSDL definition,
+	 * based on the information in the supplied message exchange pattern.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param binding The port type binding
+	 * @param mep The message exchange pattern
+	 * @return The WSDL binding operation
+	 */
+	public javax.wsdl.BindingOperation createBindingOperation(java.util.List<javax.wsdl.Definition> wsdls,
+			org.savara.contract.model.Contract contract, javax.wsdl.Binding binding,
+								org.savara.contract.model.MessageExchangePattern mep,
+								WSDLBinding wsdlBinding) {
+		javax.wsdl.BindingOperation ret=null;
+		
+		javax.wsdl.Definition defn=null;
+		
+		if (binding != null) {
+			defn = getDefinition(wsdls, contract, binding.getQName().getNamespaceURI(), wsdlBinding);
+		}
+
+		if (defn != null && mep != null) {
+			ret = defn.createBindingOperation();
+			//ret.setUndefined(false);
+			
+			// Check if WSDL operation details
+			if (wsdlBinding != null) {
+				wsdlBinding.updateOperation(defn, mep, ret);
+			}
+			
+			ret.setName(mep.getOperation());
+			
+			QName msgname=WSDLGeneratorUtil.getRequestMessageType(binding.getQName().getNamespaceURI(),
+											mep.getOperation());
+		
+			javax.wsdl.Message mesg=getMessage(wsdls, contract,msgname,
+								mep.getTypes(), wsdlBinding);
+			
+			if (mesg != null) {
+				javax.wsdl.BindingInput input=defn.createBindingInput();
+				
+				// Check if WSDL operation details
+				if (wsdlBinding != null) {
+					wsdlBinding.updateInput(defn, input);
+				}
+
+				ret.setBindingInput(input);
+			}
+			
+			// Check if a request/response MEP
+			if (mep instanceof RequestResponseMEP) {
+				RequestResponseMEP rr=(RequestResponseMEP)mep;
+				
+				msgname=WSDLGeneratorUtil.getResponseMessageType(binding.getQName().getNamespaceURI(),
+										mep.getOperation());
+	
+				javax.wsdl.Message om=getMessage(wsdls, contract, msgname,
+									rr.getResponseTypes(), wsdlBinding);
+				if (om != null) {
+					javax.wsdl.BindingOutput output=defn.createBindingOutput();
+					
+					// Check if WSDL operation details
+					if (wsdlBinding != null) {
+						wsdlBinding.updateOutput(defn, output);
+					}
+
+					ret.setBindingOutput(output);
+				}
+				
+				// Generate fault details
+				if (rr.getFaultDetails() != null) {
+					for (int i=0; i < rr.getFaultDetails().size(); i++) {
+						FaultDetails fd=rr.getFaultDetails().get(i);
+						
+						msgname = WSDLGeneratorUtil.getFaultMessageType(binding.getQName().getNamespaceURI(),
+												fd.getName());
+			
+						javax.wsdl.Message fm=getMessage(wsdls, contract, msgname,
+									fd.getTypes(), wsdlBinding);
+						if (fm != null) {
+							javax.wsdl.BindingFault fault=defn.createBindingFault();
+							fault.setName(fd.getName());
+							
+							// Check if WSDL operation details
+							if (wsdlBinding != null) {
+								wsdlBinding.updateFault(defn, fault);
+							}
+
+							ret.addBindingFault(fault);
+						}
+					}
+				}
+			}
+			
+			binding.addBindingOperation(ret);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns a message, using the supplied WSDL definition,
+	 * based on the information supplied in the list of type references. If
+	 * a single type reference is supplied, this will be the message type,
+	 * if multiple type references are supplied, then these will be considered
+	 * the message parts.<p>
+	 * <p>
+	 * The returned message will be part of the supplied definition. If it
+	 * does not exist prior to the call to this method, then it will be
+	 * created and added to the definition upon returning the message.
+	 * 
+	 * @param wsdls The list of current WSDL definitions
+	 * @param contract The contract
+	 * @param msgname The message name
+	 * @param types The list of type references
+	 * @return The WSDL message
+	 */
+	public javax.wsdl.Message getMessage(java.util.List<javax.wsdl.Definition> wsdls,
+						org.savara.contract.model.Contract contract,
+						javax.xml.namespace.QName msgname,
+						java.util.List<org.savara.contract.model.Type> types,
+								WSDLBinding wsdlBinding) {
+		javax.wsdl.Message ret=null;
+		
+		if (types == null || types.size() == 0) {
+			throw new UnsupportedOperationException("Expecting single type reference");
+		} else if (types.size() > 1) {
+			throw new UnsupportedOperationException("Currently only supports single type reference");			
+		} else {
+			Type ref=types.get(0);
+			
+			java.util.Iterator<TypeDefinition> iter=ref.getTypeDefinitions().iterator();
+			boolean f_done=false;
+			
+			while (f_done == false && iter.hasNext()) {
+				TypeDefinition td=iter.next();
+				
+				if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem()) ||
+						TypeDefinition.XSD_TYPE.equals(td.getTypeSystem())) {
+					javax.xml.namespace.QName qname=
+						new javax.xml.namespace.QName(td.getNamespace(),td.getName());
+					javax.wsdl.Definition defn=
+						getDefinition(wsdls, contract, msgname.getNamespaceURI(), wsdlBinding);
+							
+					if (defn != null && qname != null &&
+							(ret = defn.getMessage(msgname)) == null) {
+						ret = defn.createMessage();
+						ret.setUndefined(false);
+						
+						ret.setQName(msgname);
+						
+						// Create single part for type or element
+						Part part=defn.createPart();
+						part.setName("content");
+						
+						if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem())) {
+							part.setElementName(qname);					
+						} else {
+							part.setTypeName(qname);
+						}
+						
+						ret.addPart(part);
+						
+						defn.addMessage(ret);
+						
+						f_done = true;
+					}
+				}
+			}
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPDocLitWSDLBinding.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPDocLitWSDLBinding.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPDocLitWSDLBinding.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,166 @@
+/*
+ * 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.wsdl.generator.soap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.wsdl.generator.WSDLBinding;
+
+/**
+ * This interface is used to establish binding information on a
+ * WSDL definition.
+ *
+ */
+public class SOAPDocLitWSDLBinding implements WSDLBinding {
+	private static Log logger = LogFactory.getLog(SOAPDocLitWSDLBinding.class);
+
+	/**
+	 * This method returns the name of the WSDL binding implementation.
+	 * 
+	 * @return The WSDL binding
+	 */
+	public String getName() {
+		return("SOAP DocLit");
+	}
+	
+	/**
+	 * This method initializes the WSDL definition for the binding.
+	 * 
+	 * @param defn The definition
+	 */
+	public void initDefinition(javax.wsdl.Definition defn) {
+		defn.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the port binding.
+	 * 
+	 * @param defn The definition
+	 * @param binding The port type
+	 */
+	public void updateBinding(javax.wsdl.Definition defn, javax.wsdl.Binding binding) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBinding sb=(javax.wsdl.extensions.soap.SOAPBinding)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.Binding.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
+			sb.setStyle("document");
+			sb.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+			binding.addExtensibilityElement(sb);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP binding", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the operation.
+	 * 
+	 * @param defn The definition
+	 * @param mep The message exchange pattern
+	 * @param operation The operation
+	 */
+	public void updateOperation(javax.wsdl.Definition defn,
+			org.savara.contract.model.MessageExchangePattern mep,
+			javax.wsdl.BindingOperation operation) {
+		try {
+			javax.wsdl.extensions.soap.SOAPOperation soap=(javax.wsdl.extensions.soap.SOAPOperation)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOperation.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "operation"));
+			soap.setSoapActionURI(defn.getTargetNamespace()+"/"+mep.getOperation());
+			operation.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP operation", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the input.
+	 * 
+	 * @param defn The definition
+	 * @param input The input
+	 */
+	public void updateInput(javax.wsdl.Definition defn, javax.wsdl.BindingInput input) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingInput.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+			soap.setUse("literal");
+			input.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to input", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the output.
+	 * 
+	 * @param defn The definition
+	 * @param output The output
+	 */
+	public void updateOutput(javax.wsdl.Definition defn, javax.wsdl.BindingOutput output) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOutput.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+			soap.setUse("literal");
+			output.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to output", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param fault The fault
+	 */
+	public void updateFault(javax.wsdl.Definition defn, javax.wsdl.BindingFault fault) {
+		try {
+			javax.wsdl.extensions.soap.SOAPFault soap=(javax.wsdl.extensions.soap.SOAPFault)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingFault.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "fault"));
+			soap.setUse("literal");
+			soap.setName(fault.getName());
+			
+			fault.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to fault", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param port The port
+	 */
+	public void updatePort(javax.wsdl.Definition defn, javax.wsdl.Port port) {
+		try {
+			javax.wsdl.extensions.soap.SOAPAddress soap=(javax.wsdl.extensions.soap.SOAPAddress)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.Port.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
+			soap.setLocationURI("http://localhost:8080/"+defn.getQName().getLocalPart()+"Service/"+
+								port.getName());
+			
+			port.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP address to port", e);
+		}
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPRPCWSDLBinding.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPRPCWSDLBinding.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/soap/SOAPRPCWSDLBinding.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,170 @@
+/*
+ * 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.wsdl.generator.soap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.wsdl.generator.WSDLBinding;
+
+/**
+ * This interface is used to establish binding information on a
+ * WSDL definition.
+ *
+ */
+public class SOAPRPCWSDLBinding implements WSDLBinding {
+	private static Log logger = LogFactory.getLog(SOAPRPCWSDLBinding.class);
+
+	/**
+	 * This method returns the name of the WSDL binding implementation.
+	 * 
+	 * @return The WSDL binding
+	 */
+	public String getName() {
+		return("SOAP RPC");
+	}
+	
+	/**
+	 * This method initializes the WSDL definition for the binding.
+	 * 
+	 * @param defn The definition
+	 */
+	public void initDefinition(javax.wsdl.Definition defn) {
+		defn.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the port binding.
+	 * 
+	 * @param defn The definition
+	 * @param binding The port type
+	 */
+	public void updateBinding(javax.wsdl.Definition defn, javax.wsdl.Binding binding) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBinding sb=(javax.wsdl.extensions.soap.SOAPBinding)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.Binding.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
+			sb.setStyle("rpc");
+			sb.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+			binding.addExtensibilityElement(sb);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP binding", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the operation.
+	 * 
+	 * @param defn The definition
+	 * @param mep The message exchange pattern
+	 * @param operation The operation
+	 */
+	public void updateOperation(javax.wsdl.Definition defn,
+			org.savara.contract.model.MessageExchangePattern mep,
+			javax.wsdl.BindingOperation operation) {
+		try {
+			javax.wsdl.extensions.soap.SOAPOperation soap=(javax.wsdl.extensions.soap.SOAPOperation)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOperation.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "operation"));
+			soap.setStyle("rpc");
+			soap.setSoapActionURI("");
+			operation.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP operation", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the input.
+	 * 
+	 * @param defn The definition
+	 * @param input The input
+	 */
+	public void updateInput(javax.wsdl.Definition defn, javax.wsdl.BindingInput input) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingInput.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+			soap.setUse("literal");
+			soap.setNamespaceURI(defn.getTargetNamespace());
+			input.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to input", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the output.
+	 * 
+	 * @param defn The definition
+	 * @param output The output
+	 */
+	public void updateOutput(javax.wsdl.Definition defn, javax.wsdl.BindingOutput output) {
+		try {
+			javax.wsdl.extensions.soap.SOAPBody soap=(javax.wsdl.extensions.soap.SOAPBody)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingOutput.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
+			soap.setUse("literal");
+			soap.setNamespaceURI(defn.getTargetNamespace());
+			output.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to output", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param fault The fault
+	 */
+	public void updateFault(javax.wsdl.Definition defn, javax.wsdl.BindingFault fault) {
+		try {
+			javax.wsdl.extensions.soap.SOAPFault soap=(javax.wsdl.extensions.soap.SOAPFault)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.BindingFault.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "fault"));
+			soap.setUse("literal");
+			soap.setNamespaceURI(defn.getTargetNamespace());
+			soap.setName(fault.getName());
+			
+			fault.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP body to fault", e);
+		}
+	}
+	
+	/**
+	 * This method adds WSDL binding information to the fault.
+	 * 
+	 * @param defn The definition
+	 * @param port The port
+	 */
+	public void updatePort(javax.wsdl.Definition defn, javax.wsdl.Port port) {
+		try {
+			javax.wsdl.extensions.soap.SOAPAddress soap=(javax.wsdl.extensions.soap.SOAPAddress)
+				defn.getExtensionRegistry().createExtension(javax.wsdl.Port.class,
+							new javax.xml.namespace.QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
+			soap.setLocationURI("http://localhost:8080/"+defn.getQName().getLocalPart()+"Service/"+
+								port.getName());
+			
+			port.addExtensibilityElement(soap);
+		} catch(Exception e) {
+			logger.error("Failed to add SOAP address to port", e);
+		}
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.wsdl.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/util/WSDLGeneratorUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/util/WSDLGeneratorUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/util/WSDLGeneratorUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,62 @@
+/*
+ * 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.wsdl.util;
+
+/**
+ * This class provides general utility functions for
+ * use when generating artefacts.
+ */
+public class WSDLGeneratorUtil {
+
+	private static final String RESPONSE = "Response";
+	private static final String FAULT = "Fault";
+	private static final String REQUEST = "Request";
+
+	/**
+	 * This method returns the request message type QName.
+	 * 
+	 * @param intfNamespace The interface namespace
+	 * @param op The operation name
+	 * @return The request message type
+	 */
+	public static javax.xml.namespace.QName getRequestMessageType(String intfNamespace, String op) {
+		return(new javax.xml.namespace.QName(intfNamespace, op+REQUEST));
+	}
+
+	/**
+	 * This method returns the response message type QName.
+	 * 
+	 * @param intfNamespace The interface namespace
+	 * @param op The operation name
+	 * @return The response message type
+	 */
+	public static javax.xml.namespace.QName getResponseMessageType(String intfNamespace, String op) {
+		return(new javax.xml.namespace.QName(intfNamespace, op+RESPONSE));
+	}
+
+	/**
+	 * This method returns the fault message type QName.
+	 * 
+	 * @param intfNamespace The interface namespace
+	 * @param faultName The fault name
+	 * @return The fault message type
+	 */
+	public static javax.xml.namespace.QName getFaultMessageType(String intfNamespace, String faultName) {
+		return(new javax.xml.namespace.QName(intfNamespace, faultName+FAULT));
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,591 @@
+/*
+ * 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.tools.wsdl.tests;
+
+import javax.wsdl.Part;
+import javax.xml.namespace.QName;
+
+import org.savara.contract.model.*;
+import org.savara.wsdl.generator.WSDLGenerator;
+import org.savara.wsdl.generator.WSDLGeneratorFactory;
+import org.savara.wsdl.generator.impl.WSDLGeneratorImpl;
+
+import junit.framework.TestCase;
+
+public class WSDLGeneratorTest extends TestCase {
+
+	private static final String TEST_LOCALPART = "test.localpart";
+	private static final String HTTP_TEST_NAMESPACE = "http://test.namespace";
+	private static final String TEST_TYPE_NS = "testTypeNS";
+	private static final String TEST_TYPE_LP = "testTypeLP";
+	private static final String TEST_NAME_SPACE = "testNameSpace";
+	private static final String TEST_NAME_SPACE2 = "testNameSpace2";
+	private static final String TEST_NAME_SPACE3 = "testNameSpace3";
+	private static final String TEST_NAME = "testName";
+
+	public void testDefnNameAndNamespace() {
+		
+		Contract c=new Contract();
+		
+		c.setName(TEST_NAME);
+		c.setNamespace(TEST_NAME_SPACE);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=gen.generate(c, null);
+		
+		if (defns.size() != 1) {
+			fail("Only one Definition found: "+defns.size());
+		}
+		
+		javax.wsdl.Definition defn=defns.get(0);
+		
+		if (defn.getTargetNamespace() == null) {
+			fail("Target namespace not set");
+		}
+		
+		if (TEST_NAME_SPACE.equals(defn.getTargetNamespace()) == false) {
+			fail("Target namespace not correct: "+defn.getTargetNamespace());
+		}
+		
+		if (defn.getQName() == null) {
+			fail("QName not set");
+		}
+		
+		if (defn.getQName().getLocalPart() == null) {
+			fail("QName localpart not set");
+		}
+		
+		if (TEST_NAME.equals(defn.getQName().getLocalPart()) == false) {
+			fail("QName localpart not correct: "+defn.getQName().getLocalPart());
+		}
+	}
+	
+	public void testPortTypeNameAndNamespace() {
+		Interface src=new Interface();
+		
+		src.setName(TEST_NAME);
+		src.setNamespace(TEST_NAME_SPACE);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
+		
+		javax.wsdl.PortType result=gen.createPortType(defns, new Contract(), src, null);
+		
+		if (result == null) {
+			fail("PortType is null");
+		}
+		
+		if (result.getQName() == null) {
+			fail("QName not set");
+		}
+		
+		if (result.getQName().getNamespaceURI() == null) {
+			fail("QName namespace not set");
+		}
+		
+		if (TEST_NAME_SPACE.equals(result.getQName().getNamespaceURI()) == false) {
+			fail("Namespace not correct: "+result.getQName().getNamespaceURI());
+		}
+		
+		if (result.getQName().getLocalPart() == null) {
+			fail("QName localpart not set");
+		}
+		
+		if (TEST_NAME.equals(result.getQName().getLocalPart()) == false) {
+			fail("QName localpart not correct: "+result.getQName().getLocalPart());
+		}
+	}
+	
+	public void testPortTypeBindingNameAndNamespace() {
+		Interface src=new Interface();
+		
+		src.setName(TEST_NAME);
+		src.setNamespace(TEST_NAME_SPACE);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
+		
+		javax.wsdl.Binding result=gen.createBinding(defns, new Contract(), src, null, null);
+		
+		if (result == null) {
+			fail("PortType is null");
+		}
+		
+		if (result.getQName() == null) {
+			fail("QName not set");
+		}
+		
+		if (result.getQName().getNamespaceURI() == null) {
+			fail("QName namespace not set");
+		}
+		
+		if (TEST_NAME_SPACE.equals(result.getQName().getNamespaceURI()) == false) {
+			fail("Namespace not correct: "+result.getQName().getNamespaceURI());
+		}
+		
+		if (result.getQName().getLocalPart() == null) {
+			fail("QName localpart not set");
+		}
+		
+		if (result.getQName().getLocalPart().equals(TEST_NAME+WSDLGeneratorImpl.BINDING_SUFFIX) == false) {
+			fail("QName localpart not correct: "+result.getQName().getLocalPart());
+		}
+	}
+	
+	public void testDefnWithPortTypesAndBindings() {
+		
+		Contract c=new Contract();
+		c.setNamespace(TEST_NAME_SPACE);
+
+		Interface i1=new Interface();
+		i1.setName("I1");
+		i1.setNamespace(TEST_NAME_SPACE);
+		
+		// Need to associate a message, to ensure port type
+		// is generated
+		OneWayRequestMEP m1=new OneWayRequestMEP();
+		
+		m1.setOperation(TEST_NAME);
+		
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
+		ref1.setNamespace(TEST_NAME_SPACE);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m1.getTypes().add(tref1);
+		
+		i1.getMessageExchangePatterns().add(m1);
+		
+		Interface i2=new Interface();
+		i2.setName("I2");
+		i2.setNamespace(TEST_NAME_SPACE);
+		
+		OneWayRequestMEP m2=new OneWayRequestMEP();
+		
+		m2.setOperation(TEST_NAME);
+		
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref1);
+		ref2.setName(TEST_TYPE_LP);
+		ref2.setNamespace(TEST_NAME_SPACE);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m2.getTypes().add(tref2);
+		
+		i2.getMessageExchangePatterns().add(m2);
+		
+		Interface i3=new Interface();
+		i3.setName("I3");
+		i3.setNamespace(TEST_NAME_SPACE);
+		
+		OneWayRequestMEP m3=new OneWayRequestMEP();
+		
+		m3.setOperation(TEST_NAME);
+		
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref1);
+		ref3.setName(TEST_TYPE_LP);
+		ref3.setNamespace(TEST_NAME_SPACE);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m3.getTypes().add(tref3);
+		
+		i3.getMessageExchangePatterns().add(m3);
+		
+		c.getInterfaces().add(i1);
+		c.getInterfaces().add(i2);
+		c.getInterfaces().add(i3);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=gen.generate(c, null);
+		
+		if (defns.size() != 1) {
+			fail("Only one Definition found: "+defns.size());
+		}
+		
+		javax.wsdl.Definition defn=defns.get(0);
+
+		if (defn.getPortTypes().size() != c.getInterfaces().size()) {
+			fail("Number of port types ("+defn.getPortTypes().size()+
+					") does not match number of interfaces ("+
+					c.getInterfaces().size()+")");
+		}
+
+		if (defn.getBindings().size() != c.getInterfaces().size()) {
+			fail("Number of port type bindings ("+defn.getBindings().size()+
+					") does not match number of interfaces ("+
+					c.getInterfaces().size()+")");
+		}
+	}
+	
+	public void testOperationOneWay() {
+		javax.wsdl.Definition defn=null;
+		try {
+			javax.wsdl.factory.WSDLFactory fact=
+						javax.wsdl.factory.WSDLFactory.newInstance();
+			
+			defn = fact.newDefinition();
+			
+		} catch(Exception e) {
+			fail("Failed to get definition");
+		}
+		
+		OneWayRequestMEP src=new OneWayRequestMEP();
+		
+		src.setOperation(TEST_NAME);
+		
+		Type tref=new Type();
+		TypeDefinition ref=new TypeDefinition();
+		tref.getTypeDefinitions().add(ref);
+		ref.setName(TEST_TYPE_LP);
+		ref.setNamespace(TEST_TYPE_NS);
+		ref.setTypeSystem(TypeDefinition.XSD_TYPE);
+		tref.setName(ref.getName());
+		src.getTypes().add(tref);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
+		defns.add(defn);
+		
+		defn.setTargetNamespace(TEST_NAME_SPACE);
+		
+		javax.wsdl.PortType ptype=defn.createPortType();
+		ptype.setQName(new javax.xml.namespace.QName(TEST_NAME_SPACE, TEST_NAME));
+		
+		javax.wsdl.Operation result=gen.createOperation(defns, new Contract(), ptype, src, null);
+		
+		if (result == null) {
+			fail("Operation is null");
+		}
+		
+		if (TEST_NAME.equals(result.getName()) == false) {
+			fail("Operation name mismatch: "+result.getName());
+		}
+		
+		if (result.getInput() == null) {
+			fail("Input not set");
+		}
+		
+		if (result.getOutput() != null) {
+			fail("Output should NOT be set");
+		}
+		
+		if (result.getFaults().size() != 0) {
+			fail("Faults should NOT be defined");
+		}
+	}
+	
+	public void testOperationReqRespFaults() {
+		javax.wsdl.Definition defn=null;
+		try {
+			javax.wsdl.factory.WSDLFactory fact=
+						javax.wsdl.factory.WSDLFactory.newInstance();
+			
+			defn = fact.newDefinition();
+			
+		} catch(Exception e) {
+			fail("Failed to get definition");
+		}
+		
+		RequestResponseMEP src=new RequestResponseMEP();
+		
+		src.setOperation(TEST_NAME);
+		
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
+		ref1.setNamespace(TEST_TYPE_NS);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		src.getTypes().add(tref1);
+		
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref2);
+		ref2.setName(TEST_TYPE_LP);
+		ref2.setNamespace(TEST_TYPE_NS);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		src.getResponseTypes().add(tref2);
+		
+		FaultDetails fd1=new FaultDetails();
+		fd1.setName("faultName1");
+
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref3);
+		ref3.setName(TEST_TYPE_LP);
+		ref3.setNamespace(TEST_TYPE_NS);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		fd1.getTypes().add(tref3);
+		
+		src.getFaultDetails().add(fd1);
+		
+		FaultDetails fd2=new FaultDetails();
+		fd2.setName("faultName2");
+
+		Type tref4=new Type();
+		TypeDefinition ref4=new TypeDefinition();
+		tref4.getTypeDefinitions().add(ref4);
+		ref4.setName(TEST_TYPE_LP);
+		ref4.setNamespace(TEST_TYPE_NS);
+		ref4.setTypeSystem(TypeDefinition.XSD_TYPE);
+		fd2.getTypes().add(tref4);
+		
+		src.getFaultDetails().add(fd2);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
+		defns.add(defn);
+		
+		defn.setTargetNamespace(TEST_NAME_SPACE);
+		
+		javax.wsdl.PortType ptype=defn.createPortType();
+		ptype.setQName(new javax.xml.namespace.QName(TEST_NAME_SPACE, TEST_NAME));
+		
+		javax.wsdl.Operation result=gen.createOperation(defns, new Contract(), ptype, src, null);
+		
+		if (result == null) {
+			fail("Operation is null");
+		}
+		
+		if (TEST_NAME.equals(result.getName()) == false) {
+			fail("Operation name mismatch: "+result.getName());
+		}
+		
+		if (result.getInput() == null) {
+			fail("Input not set");
+		}
+		
+		if (result.getOutput() == null) {
+			fail("Output not set");
+		}
+		
+		if (result.getFaults().size() != src.getFaultDetails().size()) {
+			fail("Faults number ("+result.getFaults().size()+
+						") does not match contract ("+src.getFaultDetails().size()+")");
+		}
+	}
+	
+	public void testMessage() {
+		javax.wsdl.Definition defn=null;
+		try {
+			javax.wsdl.factory.WSDLFactory fact=
+						javax.wsdl.factory.WSDLFactory.newInstance();
+			
+			defn = fact.newDefinition();
+			
+		} catch(Exception e) {
+			fail("Failed to get definition");
+		}
+		
+		TypeDefinition src=new TypeDefinition();
+		src.setName(TEST_TYPE_LP);
+		src.setNamespace(TEST_TYPE_NS);
+		src.setTypeSystem(TypeDefinition.XSD_TYPE);
+		
+		Type t=new Type();
+		t.getTypeDefinitions().add(src);
+		
+		java.util.List<Type> refs=new java.util.Vector<Type>();
+		refs.add(t);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
+		
+		QName msgname=new QName(HTTP_TEST_NAMESPACE,TEST_LOCALPART);
+		
+		javax.wsdl.Message result=gen.getMessage(defns, new Contract(), msgname, refs, null);
+		
+		if (result == null) {
+			fail("Message is null");
+		}
+		
+		if (result.getQName() == null) {
+			fail("QName not set");
+		}
+		
+		if (result.getQName().getLocalPart() == null) {
+			fail("QName localpart not set");
+		}
+		
+		if (TEST_LOCALPART.equals(result.getQName().getLocalPart()) == false) {
+			fail("QName localpart not correct: "+result.getQName().getLocalPart());
+		}
+		
+		if (result.getQName().getNamespaceURI() == null) {
+			fail("QName namespace not set");
+		}
+		
+		if (HTTP_TEST_NAMESPACE.equals(result.getQName().getNamespaceURI()) == false) {
+			fail("QName namespace not correct: "+result.getQName().getNamespaceURI());
+		}
+		
+		if (result.getParts().size() != 1) {
+			fail("Should be one part: "+result.getParts().size());
+		}
+		
+		Part part=(Part)result.getParts().values().toArray()[0];
+		
+		if (part.getElementName() != null) {
+			fail("Element name should not be set");
+		}
+		
+		if (part.getTypeName() == null) {
+			fail("Type name not set");
+		}
+		
+		if (TEST_TYPE_NS.equals(part.getTypeName().getNamespaceURI()) == false) {
+			fail("Element namespace incorrect: "+part.getTypeName().getNamespaceURI());
+		}
+		
+		if (TEST_TYPE_LP.equals(part.getTypeName().getLocalPart()) == false) {
+			fail("Element localpart incorrect: "+part.getTypeName().getLocalPart());
+		}
+	}
+	
+	public void testDefnWithPortTypesAndMesgsInDiffNamespaces() {
+		
+		Contract c=new Contract();
+		c.setNamespace(TEST_NAME_SPACE);
+
+		Interface i1=new Interface();
+		i1.setName("I1");
+		i1.setNamespace(TEST_NAME_SPACE);
+		
+		// Need to associate a message, to ensure port type
+		// is generated
+		OneWayRequestMEP m1=new OneWayRequestMEP();
+		
+		m1.setOperation(TEST_NAME);
+		
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
+		ref1.setNamespace(TEST_NAME_SPACE);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m1.getTypes().add(tref1);
+		
+		i1.getMessageExchangePatterns().add(m1);
+		
+		Interface i2=new Interface();
+		i2.setName("I2");
+		i2.setNamespace(TEST_NAME_SPACE2);
+		
+		OneWayRequestMEP m2=new OneWayRequestMEP();
+		
+		m2.setOperation(TEST_NAME);
+		
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref2);
+		ref2.setName(TEST_TYPE_LP);
+		ref2.setNamespace(TEST_NAME_SPACE2);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m2.getTypes().add(tref2);
+		
+		i2.getMessageExchangePatterns().add(m2);
+		
+		Interface i3=new Interface();
+		i3.setName("I3");
+		i3.setNamespace(TEST_NAME_SPACE2);
+		
+		OneWayRequestMEP m3=new OneWayRequestMEP();
+		
+		m3.setOperation(TEST_NAME);
+		
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref3);
+		ref3.setName(TEST_TYPE_LP);
+		ref3.setNamespace(TEST_NAME_SPACE3);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m3.getTypes().add(tref3);
+		
+		i3.getMessageExchangePatterns().add(m3);
+		
+		c.getInterfaces().add(i1);
+		c.getInterfaces().add(i2);
+		c.getInterfaces().add(i3);
+		
+		WSDLGeneratorImpl gen=new WSDLGeneratorImpl();
+		
+		java.util.List<javax.wsdl.Definition> defns=gen.generate(c, null);
+		
+		if (defns.size() != 2) {
+			fail("Two Definitions expected, but got: "+defns.size());
+		}
+		
+		javax.wsdl.Definition defn1=defns.get(0);
+
+		if (defn1.getPortTypes().size() != 1) {
+			fail("1: Number of port types ("+defn1.getPortTypes().size()+
+					") does not match number expected (1)");
+		}
+		
+		if (defn1.getBindings().size() != 1) {
+			fail("1: Number of port type bindings ("+defn1.getBindings().size()+
+					") does not match number expected (1)");
+		}
+		
+		if (defn1.getMessages().size() != 1) {
+			fail("1: Number of message ("+defn1.getMessages().size()+
+			") does not match number expected (1)");
+		}
+		
+		javax.wsdl.Definition defn2=defns.get(1);
+
+		if (defn2.getPortTypes().size() != 2) {
+			fail("2: Number of port types ("+defn2.getPortTypes().size()+
+					") does not match number expected (2)");
+		}
+		
+		if (defn2.getBindings().size() != 2) {
+			fail("2: Number of port type bindings ("+defn2.getBindings().size()+
+					") does not match number expected (2)");
+		}
+		
+		if (defn2.getMessages().size() != 1) {
+			fail("2: Number of message ("+defn2.getMessages().size()+
+			") does not match number expected (1)");
+		}
+		
+		// Check service only associated with the first defn
+		if (defn1.getServices().size() != 1) {
+			fail("First definition should only have 1 service: "+defn1.getServices().size());
+		}
+		
+		javax.wsdl.Service s=(javax.wsdl.Service)
+					defn1.getServices().values().iterator().next();
+		if (s.getPorts().size() != 3) {
+			fail("Should be 3 ports: "+s.getPorts().size());
+		}
+		
+		if (defn2.getServices().size() != 0) {
+			fail("Second definition should not have any services: "+defn2.getServices().size());
+		}
+	}
+}

Added: branches/experimental/2.0.x/bundles/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,62 @@
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara</groupId>
+	<artifactId>bundles</artifactId>
+	<packaging>pom</packaging>
+	<version>2.0.0-SNAPSHOT</version>
+	<name>Savara::Bundles</name>
+
+    <parent>
+	  <groupId>org</groupId>
+	  <artifactId>savara</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+	<properties>
+        <jaxb.version>2.1</jaxb.version>
+        <osgi.version>1.4.0</osgi.version>
+	</properties>
+
+	<modules>
+		<module>org.savara.core</module>
+		<module>org.savara.contract.model</module>
+		<module>org.savara.wsdl</module>
+		<module>org.savara.bpel</module>
+	</modules>
+ 
+	<build>
+		<!-- This section defines the default plugin settings inherited by child projects. -->
+		<pluginManagement>
+			<plugins>
+				<!-- Fixes how test resources of a project can be used in projects dependent on it  -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-jar-plugin</artifactId>
+					<version>2.2</version>
+          			<configuration>
+          				<archive>
+            				<manifestFile>META-INF/MANIFEST.MF</manifestFile>
+          				</archive>
+        			</configuration>
+				</plugin>
+		      <plugin>
+		        <groupId>org.apache.felix</groupId>
+		        <artifactId>maven-bundle-plugin</artifactId>
+		        <executions>
+		          <execution>
+		            <id>bundle-manifest</id>
+		            <phase>process-classes</phase>
+		            <goals>
+		              <goal>manifest</goal>
+		            </goals>
+		          </execution>
+		        </executions>
+		      </plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+
+</project>
+

Added: branches/experimental/2.0.x/distribution/pom.xml
===================================================================
--- branches/experimental/2.0.x/distribution/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,112 @@
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ * 
+ * (C) 2008
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.savara</groupId>
+    <artifactId>distribution</artifactId>
+    <packaging>pom</packaging>
+    <name>Savara::Distribution</name>
+    <version>2.0.0-SNAPSHOT</version>
+    <url>http://www.jboss.org/savara</url>
+
+	<parent>
+		<groupId>org</groupId>
+		<artifactId>savara</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+    <properties>
+        <maven.test.skip>true</maven.test.skip>
+    </properties>
+	
+    <dependencies>
+        <dependency>
+            <groupId>org.savara.validators</groupId>
+            <artifactId>savara-validator-jboss</artifactId>
+            <version>${pom.version}</version>
+            <classifier>dist</classifier>
+            <type>zip</type>
+        </dependency>
+        <dependency>
+            <groupId>org.savara.validators</groupId>
+            <artifactId>savara-validator-jbossesb</artifactId>
+            <version>${pom.version}</version>
+            <classifier>dist</classifier>
+            <type>zip</type>
+        </dependency>
+        <dependency>
+            <groupId>org.savara.validators</groupId>
+            <artifactId>savara-validator-jbossws-native</artifactId>
+            <version>${pom.version}</version>
+            <classifier>dist</classifier>
+            <type>zip</type>
+        </dependency>
+    </dependencies> 
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+             <artifactId>maven-assembly-plugin</artifactId>
+             <version>2.2-beta-2</version>
+             <executions>
+              <execution>
+                <id>bin</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>savara-${project.version}</finalName>
+                  <appendAssemblyId>false</appendAssemblyId>
+                  <descriptors>
+                    <descriptor>src/main/assembly/bin.xml</descriptor>
+                  </descriptors>
+                </configuration>
+                </execution>
+		          <execution>
+		            <id>distribution-package-source</id>
+		            <phase>package</phase>
+		            <goals>
+		              <goal>single</goal>
+		            </goals>
+		            <configuration>
+		              <finalName>savara-${project.version}-src</finalName>
+		              <appendAssemblyId>false</appendAssemblyId>
+		              <descriptors>
+		                <descriptor>src/main/assembly/src.xml</descriptor>
+		              </descriptors>
+		              <tarLongFileMode>gnu</tarLongFileMode>
+		            </configuration>
+		          </execution>
+               </executions>
+              </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-original.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-original.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-original.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., 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.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+        <property name="org.jboss.soa.esb.mime.text.types" value="text/*;application/xml;application/*-xml"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </properties>
+    <properties name="security">
+        <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
+        <property name="org.jboss.soa.esb.services.security.callbackHandler" value="org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler"/>
+        
+        <!-- Algorithm and key size for internal sealing of objects -->
+        <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+    	<property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+    	
+        <!-- Timeout in milliseconds. After which the context is considered invalid -->
+    	<property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+    	<property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
+
+		<!-- Public keystore configuration used to hold keys for encryption/decryption -->
+    	<property name="org.jboss.soa.esb.services.security.publicKeystore" value="/publicKeyStore"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
+		<property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
+
+    </properties>
+    <properties name="registry">
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/>
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/>
+	<property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/>
+    	<property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" value="root"/>
+    	<property name="org.jboss.soa.esb.registry.password" value="root"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+	<property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/>
+	<property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/>
+
+        <!-- specify the interceptors, in order -->
+        <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor"/>
+		<!-- Example of specifying multiple registry interceptors
+        <property name="org.jboss.soa.esb.registry.interceptors"
+                value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
+		-->
+
+        <!-- The following properties modify the cache interceptor behaviour -->
+        <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
+        <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
+
+        <!-- Organization Category to be used by this deployment. -->
+        <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+    	<property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+    	<property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+    	<!-- expiry of messages to temporary invm destinations (default replies)
+    	     expire after the following timeout, specified in milliseconds (5 mins) -->
+    	<property name="org.jboss.soa.esb.invm.expiryTime" value="300000"/>
+    	
+    	<!--  Uncomment this to return stack traces when exposing an ESB service through WS
+    	<property name="org.jboss.soa.esb.ws.returnStackTrace" value="true"/>
+    	-->
+    	<!--  Uncomment this to specify the WS response timeout when exposing an ESB service through WS
+    	<property name="org.jboss.soa.esb.ws.timeout" value="30000"/>
+    	-->
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool-size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="jca">
+        <property name="org.jboss.soa.esb.jca.activation.mapper.jms-ra.rar" value="org.jboss.soa.esb.listeners.jca.JBossActivationMapper"/>
+        <property name="org.jboss.soa.esb.jca.activation.mapper.wmq.jmsra.rar" value="org.jboss.soa.esb.listeners.jca.WMQActivationMapper"/>
+    </properties>
+
+    <properties name="dbstore">
+    	
+    	<!--  connection manager type -->
+	    <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" 		value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>	 -->    
+	     <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+	    
+	    <!-- this property is only used if using the j2ee connection manager -->
+	    <property name="org.jboss.soa.esb.persistence.db.datasource.name" 	value="java:/JBossESBDS"/>
+		
+		<!-- standalone connection pooling settings -->
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 				value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 				value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"		value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"		value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+		
+    </properties>    
+    <properties name="filters">
+    	<property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+    	<property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+    </properties>
+
+    <properties name="rules">
+    	<!-- change this to true if you wish to have the same behaviour as ESB4.6 and prior (including SOA 4.3) -->
+    	<property name="org.jboss.soa.esb.services.rules.continueState" value="false"/>
+    </properties>
+</esb>

Added: branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-validator.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-validator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-validator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., 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.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+        <property name="org.jboss.soa.esb.mime.text.types" value="text/*;application/xml;application/*-xml"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </properties>
+    <properties name="security">
+        <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
+        <property name="org.jboss.soa.esb.services.security.callbackHandler" value="org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler"/>
+        
+        <!-- Algorithm and key size for internal sealing of objects -->
+        <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+    	<property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+    	
+        <!-- Timeout in milliseconds. After which the context is considered invalid -->
+    	<property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+    	<property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
+
+		<!-- Public keystore configuration used to hold keys for encryption/decryption -->
+    	<property name="org.jboss.soa.esb.services.security.publicKeystore" value="/publicKeyStore"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
+    	<property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
+		<property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
+
+    </properties>
+    <properties name="registry">
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/>
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/>
+	<property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/>
+    	<property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" value="root"/>
+    	<property name="org.jboss.soa.esb.registry.password" value="root"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+	<property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/>
+	<property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/>
+
+        <!-- specify the interceptors, in order -->
+        <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor"/>
+		<!-- Example of specifying multiple registry interceptors
+        <property name="org.jboss.soa.esb.registry.interceptors"
+                value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
+		-->
+
+        <!-- The following properties modify the cache interceptor behaviour -->
+        <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
+        <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
+
+        <!-- Organization Category to be used by this deployment. -->
+        <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+    	<property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+    	<property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+    	<!-- expiry of messages to temporary invm destinations (default replies)
+    	     expire after the following timeout, specified in milliseconds (5 mins) -->
+    	<property name="org.jboss.soa.esb.invm.expiryTime" value="300000"/>
+    	
+    	<!--  Uncomment this to return stack traces when exposing an ESB service through WS
+    	<property name="org.jboss.soa.esb.ws.returnStackTrace" value="true"/>
+    	-->
+    	<!--  Uncomment this to specify the WS response timeout when exposing an ESB service through WS
+    	<property name="org.jboss.soa.esb.ws.timeout" value="30000"/>
+    	-->
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool-size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="jca">
+        <property name="org.jboss.soa.esb.jca.activation.mapper.jms-ra.rar" value="org.jboss.soa.esb.listeners.jca.JBossActivationMapper"/>
+        <property name="org.jboss.soa.esb.jca.activation.mapper.wmq.jmsra.rar" value="org.jboss.soa.esb.listeners.jca.WMQActivationMapper"/>
+    </properties>
+
+    <properties name="dbstore">
+    	
+    	<!--  connection manager type -->
+	    <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" 		value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>	 -->    
+	     <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+	    
+	    <!-- this property is only used if using the j2ee connection manager -->
+	    <property name="org.jboss.soa.esb.persistence.db.datasource.name" 	value="java:/JBossESBDS"/>
+		
+		<!-- standalone connection pooling settings -->
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 				value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 				value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"		value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"		value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+		
+    </properties>    
+    <properties name="filters">
+    	<property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+    	<property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+    	<property name="org.jboss.soa.esb.filter.10" value="org.savara.validator.jbossesb.JBossESBInterceptor" />
+    </properties>
+
+    <properties name="rules">
+    	<!-- change this to true if you wish to have the same behaviour as ESB4.6 and prior (including SOA 4.3) -->
+    	<property name="org.jboss.soa.esb.services.rules.continueState" value="false"/>
+    </properties>
+</esb>

Added: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+  
+  <client-config>
+    <config-name>Standard Client</config-name>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+    <property>
+      <property-name>http://org.jboss.ws/http#chunksize</property-name>
+      <property-value>2048</property-value>
+    </property>
+  </client-config>
+  
+  <client-config>
+    <config-name>HTTP 1.0 Client</config-name>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSAddressing Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard SOAP 1.2 WSAddressing Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSSecurity Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+</jaxws-config>

Added: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+  
+  <client-config>
+    <config-name>Standard Client</config-name>
+    <pre-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
+          <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeClientInterceptor</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </pre-handler-chains>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+    <property>
+      <property-name>http://org.jboss.ws/http#chunksize</property-name>
+      <property-value>2048</property-value>
+    </property>
+  </client-config>
+  
+  <client-config>
+    <config-name>HTTP 1.0 Client</config-name>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSAddressing Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard SOAP 1.2 WSAddressing Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSSecurity Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+</jaxws-config>

Added: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+  
+  <endpoint-config>
+    <config-name>Standard Endpoint</config-name>
+    <pre-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </pre-handler-chains>
+  </endpoint-config>
+  
+  <!--
+    Generates message part names 'parameters' in WSDL for document/literal/wapped.
+    See: [JBWS-771] Use part names that are friendly to .NET
+  -->
+  <endpoint-config>
+    <config-name>.NET friendly Endpoint</config-name>
+    <feature>http://org.jboss.ws/binding/wsdl/dotnet</feature>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard WSAddressing Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard SOAP 1.2 WSAddressing Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard WSSecurity Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSSecurity Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+</jaxws-config>

Added: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+  
+  <endpoint-config>
+    <config-name>Standard Endpoint</config-name>
+    <pre-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
+          <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeServerInterceptor</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </pre-handler-chains>
+  </endpoint-config>
+  
+  <!--
+    Generates message part names 'parameters' in WSDL for document/literal/wapped.
+    See: [JBWS-771] Use part names that are friendly to .NET
+  -->
+  <endpoint-config>
+    <config-name>.NET friendly Endpoint</config-name>
+    <feature>http://org.jboss.ws/binding/wsdl/dotnet</feature>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard WSAddressing Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard SOAP 1.2 WSAddressing Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+  <endpoint-config>
+    <config-name>Standard WSSecurity Endpoint</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSSecurity Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer</javaee:handler-class>
+        </javaee:handler>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </endpoint-config>
+  
+</jaxws-config>

Added: branches/experimental/2.0.x/distribution/src/main/assembly/bin.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/assembly/bin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/assembly/bin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ * 
+ * (C) 2008
+-->
+<assembly>
+    <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
+    <id>bin</id>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <formats>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+
+        <!--Copy files like License and samples etc -->	
+    	<fileSet>
+            <directory>src/main/release</directory>
+            <outputDirectory>/</outputDirectory>
+			<includes>
+			  <include>*.txt</include>
+			  <include>*.properties</include>
+			</includes>
+        </fileSet>
+
+		<fileSet>
+		    <directory>src/main/release/install</directory>
+			<outputDirectory>/install</outputDirectory>
+		</fileSet>
+        
+		<fileSet>
+		    <directory>src/files/jbossesb</directory>
+			<outputDirectory>/modules/conf/jbossesb</outputDirectory>
+		</fileSet>
+        
+		<fileSet>
+		    <directory>src/files/jbossws-native</directory>
+			<outputDirectory>/modules/conf/jbossws-native</outputDirectory>
+		</fileSet>
+        
+        <!-- copy samples -->
+        <fileSet>
+		   <directory>../samples</directory>
+		   <outputDirectory>samples</outputDirectory>
+		</fileSet>
+
+        <!-- copy documents -->
+        <fileSet>
+		   <directory>../docs/userguide/target/docbook/publish/en-US</directory>
+		   <outputDirectory>docs/userguide</outputDirectory>
+		</fileSet>
+
+		<fileSet>
+		   <directory>../docs/gettingstartedguide/target/docbook/publish/en-US</directory>
+		   <outputDirectory>docs/gettingstartedguide</outputDirectory>
+		</fileSet>
+
+		<fileSet>
+		   <directory>../docs/samplesguide/target/docbook/publish/en-US</directory>
+		   <outputDirectory>docs/samplesguide</outputDirectory>
+		</fileSet>
+
+        <fileSet>
+		   <directory>../docs/trailblazer</directory>
+		   <outputDirectory>docs/trailblazer</outputDirectory>
+			<includes>
+			  <include>*.pdf</include>
+			</includes>
+		</fileSet>
+
+        <!-- copy samples -->
+        
+        <fileSet>
+		    <directory>src/main/release/samples</directory>
+			<outputDirectory>samples</outputDirectory>
+		</fileSet>
+
+        <!-- End of copying documents -->       
+         
+    </fileSets>
+    
+    <dependencySets>
+
+        <dependencySet>
+            <outputDirectory>modules</outputDirectory>
+	    	<unpack>true</unpack>
+            <includes>
+               <include>org.savara.validators:savara-validator-jboss:zip:dist</include>
+               <include>org.savara.validators:savara-validator-jbossesb:zip:dist</include>
+               <include>org.savara.validators:savara-validator-jbossws-native:zip:dist</include>
+            </includes>
+        </dependencySet>
+        
+    </dependencySets>
+
+</assembly>

Added: branches/experimental/2.0.x/distribution/src/main/assembly/src.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/assembly/src.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/assembly/src.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., 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.
+ * 
+ * (C) 2008
+-->
+<assembly>
+  <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
+  <id>src</id>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <fileSets>
+      <fileSet>
+          <directory>../distribution</directory>
+          <outputDirectory>/distribution</outputDirectory>
+          <excludes>
+             <exclude>**/.project</exclude>
+             <exclude>**/.classpath</exclude>
+             <exclude>**/.settings</exclude>
+             <exclude>**/.settings/**/*</exclude>
+             <exclude>**/target</exclude>
+         	 <exclude>**/target/**/*</exclude>
+         	 <exclude>**/*.iml</exclude>
+         	 <exclude>**/*.ipr</exclude>
+         	 <exclude>**/*.iws</exclude>
+          </excludes>
+      </fileSet>
+      <fileSet>
+          <directory>../docs</directory>
+          <outputDirectory>/docs</outputDirectory>
+          <excludes>
+             <exclude>**/.project</exclude>
+             <exclude>**/.classpath</exclude>
+             <exclude>**/.settings</exclude>
+             <exclude>**/.settings/**/*</exclude>
+             <exclude>**/target</exclude>
+         	 <exclude>**/target/**/*</exclude>
+         	 <exclude>**/*.iml</exclude>
+         	 <exclude>**/*.ipr</exclude>
+         	 <exclude>**/*.iws</exclude>
+          </excludes>
+      </fileSet>
+      <fileSet>
+          <directory>../validators</directory>
+          <outputDirectory>/validators</outputDirectory>
+          <excludes>
+             <exclude>**/.project</exclude>
+             <exclude>**/.classpath</exclude>
+             <exclude>**/.settings</exclude>
+             <exclude>**/.settings/**/*</exclude>
+             <exclude>**/target</exclude>
+         	 <exclude>**/target/**/*</exclude>
+         	 <exclude>**/*.iml</exclude>
+         	 <exclude>**/*.ipr</exclude>
+         	 <exclude>**/*.iws</exclude>
+          </excludes>
+      </fileSet>
+      <fileSet>
+          <directory>../tools</directory>
+          <outputDirectory>/tools</outputDirectory>
+          <excludes>
+             <exclude>**/.settings</exclude>
+             <exclude>**/.settings/**/*</exclude>
+             <exclude>**/target</exclude>
+         	 <exclude>**/target/**/*</exclude>
+             <exclude>**/bin</exclude>
+         	 <exclude>**/bin/**/*</exclude>
+         	 <exclude>**/*.iml</exclude>
+         	 <exclude>**/*.ipr</exclude>
+         	 <exclude>**/*.iws</exclude>
+          </excludes>
+      </fileSet>
+      <fileSet>
+          <directory>../samples</directory>
+          <outputDirectory>/samples</outputDirectory>
+          <excludes>
+             <exclude>**/.project</exclude>
+             <exclude>**/.classpath</exclude>
+             <exclude>**/.settings</exclude>
+             <exclude>**/.settings/**/*</exclude>
+             <exclude>**/target</exclude>
+         	 <exclude>**/target/**/*</exclude>
+         	 <exclude>**/*.iml</exclude>
+         	 <exclude>**/*.ipr</exclude>
+         	 <exclude>**/*.iws</exclude>
+          </excludes>
+      </fileSet>
+      <fileSet>
+          <directory>..</directory>
+          <outputDirectory>/</outputDirectory>
+          <includes>
+           <include>pom.xml</include>
+          </includes>
+      </fileSet>
+  </fileSets>
+
+</assembly>

Added: branches/experimental/2.0.x/distribution/src/main/release/JBossORG-EULA.txt
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/JBossORG-EULA.txt	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/JBossORG-EULA.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,107 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any updates to the Software 
+Packages, regardless of the delivery mechanism.  Each Software Package is a collective work 
+under U.S. Copyright Law.  Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to 
+the user ("Client") a license to the applicable collective work(s) pursuant to the 
+GNU Lesser General Public License v. 2.1 except for the following Software Packages: 
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the 
+GNU General Public License v.2; 
+
+(b) JBoss Rules, which is licensed pursuant to the Apache  License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the 
+(open source) Sleepycat License (if Client does not wish to use the open source version of this database, 
+it may purchase a license from Sleepycat Software); 
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, 
+and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various 
+royalty-free patent licenses.  
+
+Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
+
+1.  The Software.  "Software Packages" refer to the various software modules that are created and made available 
+for distribution by the JBoss.org open source community at http://www.jboss.org.   Each of the Software Packages 
+may be comprised of hundreds of software components.  The end user license agreement for each component is located in 
+the component's source code.  With the exception of certain image files identified in Section 2 below, 
+the license terms for the components permit Client to copy, modify, and redistribute the component, 
+in both source code and binary code forms.  This agreement does not limit Client's rights under, 
+or grant Client rights that supersede, the license terms of any particular component.
+
+2.  Intellectual Property Rights.  The Software Packages are owned by Red Hat and others and are protected under copyright 
+and other laws.  Title to the Software Packages and any component, or to any copy, modification, or merged portion shall 
+remain with the aforementioned, subject to the applicable license.  The "JBoss" trademark, "Red Hat" trademark, the 
+individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates 
+in the U.S. and other countries.  This agreement permits Client to distribute unmodified copies of the Software Packages 
+using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's 
+trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/.  Client must abide by 
+these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. 
+If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at 
+http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted.  
+Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.  
+
+3.  Limited Warranty.  Except as specifically stated in this Paragraph 3 or a license for a particular 
+component, to the maximum extent permitted under applicable law, the Software Packages and the 
+components are provided and licensed "as is" without warranty of any kind, expressed or implied, 
+including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.  
+Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in 
+materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.  
+Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements 
+or that the operation of the Software Packages will be entirely error free or appear precisely as described 
+in the accompanying documentation. This warranty extends only to the party that purchases the Services 
+pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. 
+
+4.  Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies 
+described below are accepted by Client as its only remedies.  Red Hat's entire liability, and Client's 
+exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of 
+delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or 
+refund the money paid by Client for the Software.  To the maximum extent permitted by applicable law, 
+Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential 
+damages, including lost profits or lost savings arising out of the use or inability to use the Software, 
+even if Red Hat or such dealer has been advised of the possibility of such damages.  In no event shall 
+Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this 
+Agreement during the twelve months preceding the action.
+
+5.  Export Control.  As required by U.S. law, Client represents and warrants that it: 
+(a) understands that the Software Packages are subject to export controls under the 
+U.S. Commerce Department's Export Administration Regulations ("EAR"); 
+
+(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations 
+(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); 
+
+(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, 
+or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; 
+
+(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or 
+biological weapons, or missile technology end-uses unless authorized by the U.S. Government by 
+regulation or specific license; 
+
+(e) understands and agrees that if it is in the United States and exports or transfers the Software 
+Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual 
+reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and 
+address (including country) of each transferee; 
+
+and (f) understands that countries other than the United States may restrict the import, use, or 
+export of encryption products and that it shall be solely responsible for compliance with any such 
+import, use, or export restrictions.
+
+6.  Third Party Programs. Red Hat may distribute third party software programs with the Software Packages 
+that are not part of the Software Packages and which Client must install separately.  These third party 
+programs are subject to their own license terms.  The license terms either accompany the programs or 
+can be viewed at http://www.redhat.com/licenses/.  If Client does not agree to abide by the applicable 
+license terms for such programs, then Client may not install them.  If Client wishes to install the programs 
+on more than one system or transfer the programs to another party, then Client must contact the licensor 
+of the programs.
+
+7.  General.  If any provision of this agreement is held to be unenforceable, that shall not affect the 
+enforceability of the remaining provisions.  This License Agreement shall be governed by the laws of the 
+State of North Carolina and of the United States, without regard to any conflict of laws provisions, 
+except that the United Nations Convention on the International Sale of Goods shall not apply.
+
+Copyright 2006 Red Hat, Inc.  All rights reserved.  
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.  
+All other trademarks are the property of their respective owners. 
+
+	Page 1 of 1	18 October 2006
+

Added: branches/experimental/2.0.x/distribution/src/main/release/README.txt
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/README.txt	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/README.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+SAVARA README
+=============
+
+A Getting Started Guide and User Guide can be found in the docs folder.
+
+The Getting Started Guide is intended to provide an overview of how the Eclipse
+tools, and other SAVARA modules, can be used to develop a "Testable Integration Architecture".
+

Added: branches/experimental/2.0.x/distribution/src/main/release/ReleaseNotes.txt
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/ReleaseNotes.txt	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/ReleaseNotes.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,78 @@
+SAVARA 1.1.0.CR1
+================
+
+This is the first Candidate Release of version 1.1.0 of SAVARA.
+
+The main new features within this release are service validators for
+Web Services based on the jbossws-native stack (which includes BPEL
+processes deployed in RiftSaw), and the first use of the TAP
+(Testable Architecture Project) file as a means of representing artifacts
+and their relationships, and being able to validate them.
+
+The detailed release notes can be found at:
+https://jira.jboss.org/secure/ReleaseNote.jspa?projectId=12310870&version=12315104
+
+
+SAVARA 1.0.0.Final
+==================
+
+This is the Final Release of version 1.0.0 of SAVARA.
+
+This release is primarily a bug fix release, to clear up remaining issues found
+in the candidate releases.
+
+The detailed release notes can be found at:
+https://jira.jboss.org/secure/ReleaseNote.jspa?projectId=12310870&version=12315141
+
+
+SAVARA 1.0.0.CR2
+================
+
+This is the second Candidate Release of version 1.0.0 of SAVARA.
+
+This release is primarily a bug fix release, with a number of issues being resolved
+with the BPEL and WSDL generation.
+
+The detailed release notes can be found at:
+https://jira.jboss.org/secure/ReleaseNote.jspa?projectId=12310870&version=12314160
+
+
+SAVARA 1.0.0.CR1
+================
+
+This is the first Candidate Release of version 1.0.0 of SAVARA.
+
+This release has resulted in a number of significant changes to the structure of the project.
+Rather than have three separate distributions, we have consolidated all functionality into
+one main distribution, and an Eclipse update site for the plugins.
+
+The functionality associated with 'conversation aware' ESB actions has been removed from the
+main distribution, and moved into a separate 'experimental' branch. This work has provided
+some useful insight in to some possible features for the future, however the ideas are
+not mature enough to remain as part of the first release.
+
+NOTE: The annotation used for runtime validation has been renamed. Therefore if any choreographies
+have been written, that include this annotation, you will need to update the annotation name and
+the top level node of the XML fragment included in the annotation, from 'jbossesb' to 'validator'.
+This can either be achieved by create new annotations and copying the destinations, or by
+opening the .cdm files in a text editor, and updating the <semanticAnnotation> elements directly.
+
+The detailed release notes can be found at:
+https://jira.jboss.org/secure/ReleaseNote.jspa?projectId=12310870&version=12313913
+
+
+SAVARA Tools Eclipse 1.0-M1
+===========================
+
+This is the first milestone of version 1.0 of the SAVARA tools for Eclipse.
+
+This distribution includes:
+- early access work on checking the conformance of a choreography, defined using the pi4soa
+choreography editor, against service implementations in BPEL and JBossESB "conversation aware"
+actions
+- generation of a choreography to BPEL services
+- generation of a choreography to JBossESB services (using "conversation aware" ESB actions)
+- generation of a choreography as a BPMN collaboration diagram
+
+The details release notes for all SAVARA 1.0-M1 components can be found at:
+https://jira.jboss.org/jira/secure/ReleaseNote.jspa?version=12313912&styleName=Html&projectId=12310870&Create=Create

Added: branches/experimental/2.0.x/distribution/src/main/release/install/README.txt
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/install/README.txt	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/install/README.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+SAVARA Installation Instructions
+================================
+
+Service Validator for JBossESB:
+
+1) Download JBossAS (http://www.jboss.org/jbossas) - version 5.1.0.GA or higher. Follow the installation
+instructions that accompany this distribution.
+
+2) Download JBossESB (http://www.jboss.org/jbossesb) - version 4.7 or higher. Follow the installation
+instructions that accompany this distribution, on how to install the ESB into the JBossAS environment.
+
+3) Edit the deployment.properties file in this ${SAVARA}/install folder. Set the org.jboss.as.home
+property to the root directory where the JBossAS environment is located, and change the
+org.jboss.as.config property from default if you wish to start your JBossAS using a different
+configuration. Set the org.jboss.esb.home property to the root directory where the JBossESB
+environmet is located.
+
+4) Start a command window and execute the command 'ant deploy'.
+
+5) You should now start your JBossAS server.
+
+When you wish to uninstall this component, simply go back to the ${SAVARA}/install folder
+and execute the command 'ant undeploy'.

Added: branches/experimental/2.0.x/distribution/src/main/release/install/build.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/install/build.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/install/build.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,82 @@
+<project name="SAVARA_Validator_Installer" default="deploy" basedir=".">
+
+	<!-- Set deployment properties filename -->
+	<property name="org.jboss.as.deployment.properties" location="deployment.properties"/>
+
+	<!-- Load Build Properties File -->
+	<property file="${org.jboss.as.deployment.properties}"/>
+	
+    <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+    <property name="conf.dir" value="${server.dir}/conf"/>
+    <property name="deploy.dir" value="${server.dir}/deploy"/>
+    <property name="deployers.dir" value="${server.dir}/deployers"/>
+    <property name="server.lib.dir" value="${server.dir}/lib"/>
+    
+    <property name="modules" value="../modules" />
+
+	<target name="check.deploy.props">
+		<condition property="as.configured">
+			<and>
+				<isset property="org.jboss.as.home"/>
+				<isset property="org.jboss.as.config"/>
+			</and>
+		</condition>
+
+		<fail unless="as.configured" message="Cannot determine target deployment, please check deployment.properties"/>
+	</target>
+
+    <target name="deploy" depends="check.deploy.props,register-jbossesb-interceptor,register-jbossws-native-interceptor"
+						description="Deploys SAVARA Validator to the server">
+        <echo message="Deploy SAVARA Validators to JBossAS" />
+    	<copy todir="${deploy.dir}/savara-validator-jboss.sar">
+    		<fileset dir="${modules}/savara-validator-jboss.sar"/>
+    	</copy>
+    	<copy todir="${deploy.dir}/savara-validator-jbossesb.esb">
+    		<fileset dir="${modules}/savara-validator-jbossesb.esb"/>
+    	</copy>
+    	<copy todir="${deploy.dir}/savara-validator-jbossws-native.sar">
+    		<fileset dir="${modules}/savara-validator-jbossws-native.sar"/>
+    	</copy>
+    </target>
+
+    <target name="undeploy" depends="unregister-jbossesb-interceptor,unregister-jbossws-native-interceptor"
+    					description="Undeploys SAVARA Validator">
+		<echo message="Undeploy the SAVARA Validators from JBossAS" />
+        <delete dir="${deploy.dir}/savara-validator-jboss.sar" />
+        <delete dir="${deploy.dir}/savara-validator-jbossesb.esb" />
+        <delete dir="${deploy.dir}/savara-validator-jbossws-native.sar" />
+    </target>
+
+    <target name="register-jbossesb-interceptor">
+		<echo message="register the jbossesb interceptor" />
+        <delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+		<copy file="${modules}/conf/jbossesb/jbossesb-properties-validator.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+    </target>
+
+    <target name="unregister-jbossesb-interceptor">
+		<echo message="unregister the jbossesb interceptor" />
+        <delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+		<copy file="${modules}/conf/jbossesb/jbossesb-properties-original.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+    </target>
+
+    <target name="register-jbossws-native-interceptor">
+		<echo message="register the jbossws-native interceptor" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
+		<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-validator.xml"
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+		<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-validator.xml"
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
+    </target>
+
+    <target name="unregister-jbossws-native-interceptor">
+		<echo message="unregister the jbossws-native interceptor" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
+		<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-original.xml"
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+		<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-original.xml"
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
+    </target>
+	
+</project>

Added: branches/experimental/2.0.x/distribution/src/main/release/install/deployment.properties
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/install/deployment.properties	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/install/deployment.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+######################################################################
+# SAVARA Configuration
+######################################################################
+# The directory in which JBoss AS is installed.
+# Use of relative paths or paths with spaces will cause runtime errors 
+# when deploying and executing the samples. 
+# (e.g. /local/deploy/jboss-5.1.0.GA) 
+org.jboss.as.home=/local/deploy/jboss-5.1.0.GA
+
+# The Configuration of JBoss AS to use. 
+# (e.g. default) 
+org.jboss.as.config=default
+
+# The directory for JBossESB home.
+# (e.g. /local/deploy/jbossesb-4.8)
+org.jboss.esb.home=/local/deploy/jbossesb-4.8

Added: branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.classpath
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.project
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.project	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>trailblazer-models</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.settings/org.eclipse.core.resources.prefs
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.settings/org.eclipse.core.resources.prefs	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/.settings/org.eclipse.core.resources.prefs	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+#Mon Sep 22 11:55:10 BST 2008
+eclipse.preferences.version=1
+encoding/TrailBlazer.cdm=UTF-8

Added: branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/src/pi4soa.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/src/pi4soa.xml	                        (rev 0)
+++ branches/experimental/2.0.x/distribution/src/main/release/samples/jbossesb/trailblazer/models/src/pi4soa.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,37 @@
+<!--
+/*
+# * Copyright 2005-8 Pi4 Technologies Ltd
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+# *
+# * Change History:
+# * 14, April 2008 : Initial version created by gary
+# */
+-->
+
+<pi4soa>
+   	<tracker>
+	   	<jndi>
+	      	<initialContextFactory>org.jnp.interfaces.NamingContextFactory</initialContextFactory>
+	      	<providerURL>jnp://localhost:1099</providerURL>
+	      <factoryURLPackages>org.jboss.naming:org.jnp.interfaces</factoryURLPackages>
+	    </jndi>
+	   	<jms>
+	     	<connectionFactory>ConnectionFactory</connectionFactory>
+	     	<connectionFactoryAlternate>ConnectionFactory</connectionFactoryAlternate>
+	     	<destination>topic/tracker</destination>
+	   	</jms>
+	</tracker> 
+</pi4soa>
+

Added: branches/experimental/2.0.x/docs/gettingstartedguide/pom.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara.docs</groupId>
+    <artifactId>gettingstartedguide</artifactId>
+    <packaging>jdocbook</packaging>
+    <name>Savara::Docs::GettingStartedGuide</name>
+    <version>2.0.0-SNAPSHOT</version>
+
+   <parent>
+    <groupId>org.savara</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+   </parent>
+
+
+    <build>
+        <plugins>
+            <plugin>
+			<groupId>org.jboss.maven.plugins</groupId>
+			<artifactId>maven-jdocbook-plugin</artifactId>
+			<version>2.2.3</version>
+			<extensions>true</extensions>
+			<executions>
+			  <execution>
+			    <id>generate-docbook</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>resources</goal>
+			      <goal>generate</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<dependencies>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-docbook-xslt</artifactId>
+			    <version>1.1.0</version>
+			  </dependency>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-jdocbook-style</artifactId>
+			    <version>1.1.0</version>
+			    <type>jdocbook-style</type>
+			  </dependency>
+			</dependencies>
+			<configuration>
+			  <sourceDocumentName>master.xml</sourceDocumentName>
+			  <sourceDirectory>${basedir}/src/main</sourceDirectory>
+			  <imageResource>
+			    <directory>${basedir}/src/main</directory>
+			    <includes>
+			      <include>**/images/**/*</include>
+			    </includes>
+			  </imageResource>
+		            <formats>
+		                <format>
+		                    <formatName>pdf</formatName>
+		                    <stylesheetResource>file:///${basedir}/src/main/en-US/xslt/pdf.xsl</stylesheetResource>
+				            <finalName>SAVARA-GettingStartedGuide.pdf</finalName>
+		                </format>
+						<format>
+						    <formatName>html</formatName>
+							<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+							<finalName>index.html</finalName>
+						</format>
+		                <format>
+		                    <formatName>html_single</formatName>
+		                    <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+		                    <finalName>index.html</finalName>
+		                </format>
+		            </formats>
+			  <options>
+			    <xincludeSupported>true</xincludeSupported>
+			    <xmlTransformerType>saxon</xmlTransformerType>
+			    <docbookVersion>1.72.0</docbookVersion>
+			  </options>
+			</configuration>
+            </plugin>           
+        </plugins>
+    </build>
+
+
+</project>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ChoreoMonReady.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ChoreoMonReady.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckError.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckError.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessage.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessage.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessageMenu.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ConformanceCheckErrorMessageMenu.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExpectedToFail.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExpectedToFail.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportBPMNMenu.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportBPMNMenu.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLDialog.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLDialog.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLMenu.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportHTMLMenu.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedBPMN.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedBPMN.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedHTML.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ExportedHTML.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesDialog.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesDialog.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesMenu.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesMenu.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesNav.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/GenerateESBServicesNav.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportDialog.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportDialog.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportFileDialog.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportFileDialog.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportMenu.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportMenu.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportProjectsDialog.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportProjectsDialog.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportedProject.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ImportedProject.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/InvalidPurchasePostTest.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/InvalidPurchasePostTest.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/JavaCompiler1-5Compliant.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/JavaCompiler1-5Compliant.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/MonitorMenu.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/MonitorMenu.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ParticipantAndOtherTypes.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ParticipantAndOtherTypes.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/PurchaseGoods.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/PurchaseGoods.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/QuickFixDialog.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/QuickFixDialog.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/RolesAndRelationships.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/RolesAndRelationships.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing1.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing2.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SAVARAMonitorPurchasing2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ShowReferencedDescription.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/ShowReferencedDescription.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePostTest.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePostTest.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePreTest.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/SuccessfulPurchasePreTest.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailBlazerMonitorError.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailBlazerMonitorError.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailblazerWebPage.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/TrailblazerWebPage.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/editvalidatorann.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/editvalidatorann.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatorannotation.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatorannotation.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatortooltip.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/images/validatortooltip.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/master.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/master.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/master.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % RH-ENTITIES SYSTEM "Common_Config/rh-entities.ent">
+]>
+
+<book lang="en">
+  <bookinfo>
+    <title>SAVARA 1.2</title>
+    <subtitle>Getting Started Guide</subtitle>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/author_group.xml"/>
+  </bookinfo>
+  
+  <toc/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/overview.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/installation.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/businessanalysis.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/architecture.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/serviceanalysisdesign.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/servicedev.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/tap.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/runtimevalidation.xml"/>
+</book>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/architecture.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/architecture.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/architecture.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="architecture">
+	<title>Architecture</title>
+
+	<para>
+	</para>
+	
+	<section>
+		<title>Define Information Model</title>
+
+		<para>
+		One of the stages within the architecture phase is to define the information model
+		for the message types associated with the messages exchanges between the
+		interacting participants.
+		</para>
+		
+		<para>
+		This involves defining message schema for each example message. The schema could
+		already exist and be reused, it could be based on existing schema and just need
+		to be upgraded to support new requirements, or it may need to be defined from
+		scratch.
+		</para>
+		
+		<para>
+		An example of a schema associated with the purchasing model is the
+		<filename>store.xsd</filename> shown here:
+		</para>
+
+		<informalexample>
+  			<programlisting role="XML" ><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+		targetNamespace="http://www.jboss.org/examples/store" 
+		xmlns:tns="http://www.jboss.org/examples/store" 
+		elementFormDefault="qualified">
+
+    <element name="BuyRequest" type="tns:StoreType"></element>
+    <element name="BuyConfirmed" type="tns:StoreType"></element>
+    <element name="BuyFailed" type="tns:StoreType"></element>
+
+    <complexType name="StoreType">
+    	<attribute name="id" type="string"></attribute>
+    </complexType>
+</schema>
+	 		]]></programlisting>
+		</informalexample>
+		
+		<para>
+		Once the schema has been defined, then the example messages need to be updated
+		to reference the schema, as shown in the following <filename>BuyRequest.xml</filename>
+		example message:
+		</para>
+		
+		<informalexample>
+  			<programlisting role="XML" ><![CDATA[
+<tns:BuyRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/store" 
+			xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+			id="1" />
+	 		]]></programlisting>
+		</informalexample>
+
+		<section>
+			<title>Validating Example Messages against Schema</title>
+
+			<para>
+			Once the association between example messages and the schema has been
+			established, it is possible to validate the messages against the
+			schema.
+			</para>
+			
+			<para>
+			For information on how to use the validation capabilities within
+			Eclipse, please read the
+			<ulink url="http://www.eclipse.org/webtools/community/tutorials/XMLValidation/XMLValidationTutorial.html">Eclipse XML Validation Tutorial</ulink>.
+			</para>
+		</section>
+	</section>
+
+	<section>
+		<title>Define Choreography Model</title>
+
+		<para>
+The next step in the development process is to specify a Choreography Model to implement
+the requirements described within the set of scenarios.
+		</para>
+		
+		<para>
+The current representation used to define Choreography Models within SAVARA is the W3C Web Service
+Choreography Description Language (WS-CDL). The pi4soa tools provide a WS-CDL (or choreography
+description) editor. Although this standard is associated with web services, it does not mean
+that a system specified using this standard needs to be implemented using web services. The
+actual WS-CDL language is used for defining the interactions between any distributed system.
+		</para>
+		
+		<para>
+The choreography description for the Purchasing example can be found in
+<filename>purchasing/PurchaseGoods.cdm</filename>. When the 
+choreography editor has been launched, by double-clicking on this file within the Eclipse 
+environment, then navigate to the <emphasis>Choreography Flows</emphasis> tab to see the 
+definition of the purchasing process:
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/PurchaseGoods.jpg" align="center" width="5in" />
+		</imageobject>
+
+		<section>
+			<title>Validating Requirements against Choreography Model</title>
+
+			<para>
+The pi4soa tools can be used to test the scenarios against the choreography description, to 
+ensure that the choreography correctly implements the requirements. To test the 
+<filename>SuccessfulPurchase.scn</filename> scenario against the choreography, launch 
+the scenario editor by double-clicking on the scenario file, and then pressing the 
+green <emphasis>play</emphasis> button in the toolbar. When complete, the scenario 
+should look like the following image, indicating that the scenario completed successfully.
+			</para>
+
+			<imageobject>
+				<imagedata fileref="en-US/images/SuccessfulPurchasePostTest.jpg" align="center" width="5in" />
+			</imageobject>
+
+			<para>
+To view a scenario that demonstrates a test failure, open the 
+<filename>InvalidPurchase.scn</filename> scenario by double-clicking on the file, and 
+then initiate the test using the green <emphasis>play</emphasis> button in the toolbar. 
+When complete, the scenario should look like the following image.
+			</para>
+
+			<imageobject>
+				<imagedata fileref="en-US/images/InvalidPurchasePostTest.jpg" align="center" width="5in" />
+			</imageobject>
+
+			<para>
+You will notice that the <emphasis>Store</emphasis> participant has a red 'send' node, 
+indicating that this action was not expected behaviour when compared with the choreography 
+description. The reason this is considered an error, is that the <emphasis>Store</emphasis> 
+participant should only send a <emphasis>BuyFailed</emphasis> message following an invalid 
+credit check.
+			</para>
+
+			<para>
+When an error is detected in a scenario, the choreography designer can then determine whether 
+the scenario is wrong (i.e. it does not correctly describe a business requirement), or whether 
+the choreography is wrong and needs to be updated to accomodate the scenario.
+			</para>
+		</section>
+
+		<section>
+			<title>Create Documentation</title>
+
+			<para>
+Once the choreography description has been successfully tested against the scenarios, the
+next step may be to obtain approval to proceed to the analysis/design phase. To help support
+this effort, the pi4soa tools provide the means to export the choreography description to
+a range of representations. HTML documentation generation is discussed below, and BPMN
+diagram generation is discussed in the Service Oriented Analysis and Design section.
+			</para>
+			
+			<para>
+			To generate HTML documentation, select the <emphasis>Export->Other->HTML</emphasis>
+			menu item associated with the choreography description file.
+			</para>
+			
+			<imageobject>
+				<imagedata fileref="en-US/images/ExportHTMLMenu.png" align="center" width="4in" />
+			</imageobject>
+			
+			<para>
+			The next step is to provide the location and name of the HTML file to be
+			generated.
+			</para>
+			
+			<imageobject>
+				<imagedata fileref="en-US/images/ExportHTMLDialog.png" align="center" width="4in" />
+			</imageobject>
+			
+			<para>
+			If the HTML has been generated within the scope of Eclipse project, then refresh
+			the relevant folder to show the file and open the file with the Eclipse web
+			browser (as shown below). If outside the Eclipse project, then use a normal
+			web browser to view the file.
+			</para>
+			
+			<imageobject>
+				<imagedata fileref="en-US/images/ExportedHTML.png" align="center" width="6in" />
+			</imageobject>
+			
+		</section>
+	</section>
+
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/author_group.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/author_group.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/author_group.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<authorgroup>
+  <corpauthor>Gary Brown</corpauthor>
+  <corpauthor>Jeff Yu</corpauthor>
+</authorgroup>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="businessanalysis">
+	<title>Business Analysis</title>
+
+	<para>
+	</para>
+	
+	<section>
+		<title>Define Participants</title>
+		
+		<para>
+		In the current Eclipse tools, that use the pi4soa Scenario and Choreography based
+		models for defining requirements and architectural models, this phase would be
+		achieved by defining the Participants and Roles within the choreography model.
+		</para>
+		
+		<para>
+		When a choreography description is initially created, using the
+		<emphasis>New->Other->Choreography->Choreography Description</emphasis> menu
+		item, the roles and relationships can be defined on the first tab.
+		</para>
+		
+		<imageobject>
+			<imagedata fileref="en-US/images/RolesAndRelationships.png" align="center" width="4in" />
+		</imageobject>
+		
+		<para>
+		Default participant types are automatically created, one per role, and can be
+		found on the <emphasis>Base Types</emphasis> tab. For example,
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/ParticipantAndOtherTypes.png" align="center" width="3in" />
+		</imageobject>
+		
+		<para>
+		Only these components need to be specified in the choreography model. This enables
+		them to be referenced in the subsequently defined scenarios. Otherwise it would be
+		necessary to return to the scenarios, once the choreography model had been defined
+		in the <emphasis>Architecture</emphasis> phase.
+		</para>
+	</section>
+
+	<section>
+		<title>Outline Scenarios</title>
+
+		<para>
+When designing a system, it is necessary to capture requirements. Various approaches can be 
+used for this, but currently there are no mechanisms that enable the requirements to be 
+documented in such a way to enable an implementation to be validated back against the requirements.
+		</para>
+
+		<para>
+The pi4soa tools provide a means of describing requirements, representing specific use cases 
+for the interactions between a set of cooperating services, using scenarios - which can be 
+considered similar to UML sequence diagrams that have been enhanced to include example messages.
+		</para>
+
+		<para>
+In the <filename>purchasing</filename> Eclipse project, the 
+<filename>SuccessfulPurchase.scn</filename> scenario looks like this:
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/SuccessfulPurchasePreTest.jpg" align="center" width="5in" />
+		</imageobject>
+		
+		<para>
+		The business requirements can therefore defined as a set of scenarios, each demonstrating
+		a specific use-case, or path through the business process being enacted.
+		</para>
+
+	</section>
+
+	<section>
+		<title>Create Example Messages</title>
+		
+		<para>
+		The next step is to create the example messages required by the scenarios.
+		</para>
+		
+		<para>
+		Some previously defined examples can be found in the <filename>purchasing</filename>
+		Eclipse project. For example, the Buy request is defined as:
+		</para>
+		
+		<informalexample>
+  			<programlisting role="XML" ><![CDATA[
+<tns:BuyRequest xmlns:tns="http://www.jboss.org/examples/store" 
+			id="1" />
+	 		]]></programlisting>
+		</informalexample>
+
+		<para>
+		Although a schema may not have been defined at this stage, unless one previously
+		existed that is being reused, it is a good idea to define a namespace for the
+		message type. This is because it will be used within the scenarios and
+		architectural models defined in the following stage. If the namespace was not
+		specified at this stage, then the example messages, scenarios and architectural
+		models would need to be updated at a later stage.
+		</para>
+		
+		<para>
+		Although this phase has been defined following the definition of the scenarios,
+		in practice these phases are iterative. So scenarios and example messages would be
+		defined concurrently. Similarly, new participants may be added in an evolutionary
+		manner, as scenarios are created that require them.
+		</para>
+		
+	</section>
+
+
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/installation.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/installation.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/installation.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="installation">
+  <title>Installation</title>   
+       
+	<para> 
+	This section describes the installation procedure for SAVARA tools and runtime modules.
+	</para>
+       
+       <section>
+       		<title>Prerequisites</title>
+       		<para>
+       		The pre-requisites for the SAVARA Eclipse Tools are:
+       		</para>
+       		<orderedlist>
+       			<listitem>Eclipse JEE (3.6 or higher)  <ulink url="http://www.eclipse.org">http://www.eclipse.org</ulink></listitem>
+       			<listitem>JBoss Tools (3.2 or higher) <ulink url="http://www.jboss.org/tools">http://www.jboss.org/tools</ulink>
+       			available from an update site</listitem>
+       		</orderedlist>
+
+       		<para>
+       		The pre-requisites for the SAVARA Service Validator are:
+       		</para>
+       		<orderedlist>
+       			<listitem>JBossAS (5.1.0.GA or higher) <ulink url="http://www.jboss.org/jbossas">http://www.jboss.org/jbossas</ulink></listitem>
+       			<listitem>JBossAS (4.8 or higher) <ulink url="http://www.jboss.org/jbossesb">http://www.jboss.org/jbossesb</ulink></listitem>
+       			<listitem>SAVARA (version 1.1.0 or higher), available from <ulink url="http://www.jboss.org/savara/downloads">http://www.jboss.org/savara/downloads</ulink></listitem>
+       		</orderedlist>
+       </section>
+       
+       <section>
+       		<title>Installation Instructions</title>
+       		<para>
+       		The installation instructions for the SAVARA Eclipse tools are:
+       		</para>
+       		<orderedlist>
+       			<listitem>
+       			Eclipse
+       			<para>
+       			Download the latest version of Eclipse JEE, and install in your environment.
+       			</para>
+       			</listitem>
+       			
+       			<listitem>
+       			BPMN Modeller
+       			<para>
+       			When Eclipse has been lauched, go to the <emphasis>Help->Install New Software..</emphasis>
+       			menu item. Select the Eclipse update site
+       			for the version of Eclipse (e.g. Helios). Within the SOA Development
+       			category, select the BPMN Project Feature. Follow the instructions to accept
+       			the license and then restart Eclipse after the plugins have been
+       			installed.
+       			</para>
+       			</listitem>
+       			<listitem>
+       			JBoss Tools
+       			<para>
+       			Start up your Eclipse environment, and go to the <emphasis>Help->Install New Software..</emphasis>
+       			menu item. Select the appropriate update site URL from the JBoss Tools download
+       			page, and enter it into the top text field in the dialog window, and press the
+       			<emphasis>Add</emphasis> button. Once the contents of the update site is available,
+       			then select the appropriate components and follow the instructions to install
+       			them within your Eclipse environment.
+       			</para>
+       			<para>
+       			The <emphasis>JBoss Savara Tools</emphasis> feature should be selected from the
+       			<emphasis>SOA Development</emphasis> category.
+       			</para>
+       			<para>
+       			If you wish to view the generated BPEL using a BPEL editor, rather than
+       			XML, then you should also select the <emphasis>JBoss BPEL Editor</emphasis> from the
+       			<emphasis>SOA Development</emphasis> category.
+       			</para>
+       			<para>
+       			NOTE: If you don't install the BPEL Editor, then you will have to install
+       			GMF. This can be found on the Helios update site, under the <emphasis>Modeling</emphasis>
+       			category. Select the <emphasis>Graphical Modeling Framework</emphasis> entry, and
+       			following the instructions to install.
+       			</para>
+
+       			<para>
+       			It is also recommended that you install the JBoss WebServices Tools, and JBossAS Tools,
+       			from the All category. These are required to define and launch a JBossAS
+       			server from within Eclipse, generate a JAX-WS web service from a WSDL definition,
+       			and test a Web Service.
+       			</para>
+       			</listitem>
+
+       		</orderedlist>
+
+       		<para>
+       		The installation instructions for the SAVARA Service Validator are:
+       		</para>
+       		<orderedlist>
+       			<listitem>
+       			JBossAS
+       			<para>
+       			Download the latest version and follow its installation instructions.
+       			</para>
+       			</listitem>
+       			
+       			<listitem>
+       			JBossESB
+       			<para>
+       			Download the latest version and follow the instructions for installing it
+       			into the JBossAS environment.
+       			</para>
+       			</listitem>
+       			
+       			<listitem>
+       			SAVARA
+       			<para>
+       			Unpack the SAVARA distribution and edit the
+       			<filename>deployment.properties</filename> file
+       			in this <filename>${SAVARA}/install</filename> folder.
+       			Set the <emphasis>org.jboss.as.home</emphasis> property to the root
+       			directory where the JBossAS environment is located, and change the
+       			<emphasis>org.jboss.as.config</emphasis> property from default
+       			if you wish to start your JBossAS using a different configuration. Set the
+       			<emphasis>org.jboss.esb.home</emphasis> property to the root directory
+       			where the JBossESB environment is located.
+       			</para>
+       			<para>
+       			Start a command window and execute the command <emphasis>ant deploy</emphasis>.
+       			</para>
+       			</listitem>
+
+       		</orderedlist>
+       </section>
+
+	<section>
+		<title>Importing Samples into Eclipse</title>
+
+			<para>
+		Once the SAVARA Eclipse Tool distribution has been correctly installed, if you wish to try out 
+		any of the examples then the following steps should be followed to import the relevant
+		projects into the previously configured Eclipse environment.
+			</para>
+
+  <orderedlist>
+	<listitem>
+		<para>
+Select the 'Import...' menu item, associated with the popup menu on the background of the left 
+panal (Navigator or Package depending on perspective being viewed).
+		</para>
+		<imageobject>
+			<imagedata fileref="en-US/images/ImportMenu.jpg" align="center" width="2in" />
+		</imageobject>
+	</listitem>
+	<listitem>
+		<para>
+When the import dialog appears, select the <emphasis>General->ExistingProject from Workspace</emphasis> 
+option and press the 'Next' button.
+		</para>
+		<imageobject>
+			<imagedata fileref="en-US/images/ImportDialog.jpg" align="center" width="4in" />
+		</imageobject>
+	</listitem>
+	<listitem>
+		<para>
+Ensuring that the 'Select root directory' radio button is selected, press the 'Browse' button and 
+navigate to the <filename>${SAVARA-Tools}/samples</filename> folder, then press 'Ok'.
+		</para>
+		<imageobject>
+			<imagedata fileref="en-US/images/ImportFileDialog.jpg" align="center" width="3in" />
+		</imageobject>
+	</listitem>
+	<listitem>
+		<para>
+All of the Eclipse projects contained within the <filename>${SAVARA-Tools}/samples</filename> directory structure 
+will be listed. Press the 'Finish' button to import them all.
+		</para>
+		<imageobject>
+			<imagedata fileref="en-US/images/ImportProjectsDialog.jpg" align="center" width="4in" />
+		</imageobject>
+		<para>
+		Once imported, the Eclipse navigator will list the sample projects:
+		</para>
+		<imageobject>
+			<imagedata fileref="en-US/images/ImportedProject.jpg" align="center" width="2in" />
+		</imageobject>
+	</listitem>
+     </orderedlist>
+
+	</section>
+  
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/overview.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/overview.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/overview.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="overview">
+	<title>Overview</title>   
+    
+    <para>
+    This is the Getting Started Guide for SAVARA. This guide starts with the
+    installation instructions for the SAVARA tools and runtime modules.
+    </para>
+    
+    <para>
+    The remainder of the document is organised to reflect phases within the SAVARA
+    Methodology, and how the current tools can be used in support of that methodology.
+    The tools are still in development, and therefore not all phases will have tools,
+    and the tools in some phases will not necessarily be complete.
+    </para>
+ 
+ 	<para>
+ 	As an overview, the tools currently include capabilities for:
+	</para>
+    
+	<itemizedlist>
+		<listitem>Definition of business requirements as scenarios</listitem>
+		<listitem>Creation of a choreography (global model) to represent the architecture for a system
+ 		that delivers the requirements</listitem>
+		<listitem>Generation of documentation based on the choreography</listitem>
+		<listitem>Generation of service implementation using WS-BPEL</listitem>
+		<listitem>Generation of service interfaces using WSDL</listitem>
+		<listitem>Conformance checking a WS-BPEL service implementation against a choreography</listitem>
+		<listitem>Runtime validation of an ESB service against a choreography description</listitem>
+	</itemizedlist>
+  
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="runtimevalidation">
+	<title>Runtime Validation</title>
+
+		<note>
+		<para>
+		Before you can deploy and run the runtime validation example, you will
+		need to install the SAVARA Validator module for JBoss.
+		</para>
+		</note>
+		
+		<para>
+		The previous sections have provided a brief introduction to the design-time 
+		SOA governance features provided within the SAVARA Eclipse Tools distribution.
+		The aim of these capabilities are to enable verification of an implementation, initially
+		defined just using BPEL process definitions, against a 
+		choreography, which in turn has been verified against business requirements defined using 
+		scenarios. Therefore this helps to ensure that the implemented system meets the original 
+		business requirements.
+		</para>
+
+		<para>
+		Being able to statically check that the implementation should send or receive messages 
+		in the correct order is important, as it will reduce the amount of testing required 
+		to ensure the service behaves correctly. However it does not enable the internal 
+		implementation details to be verified, which may result in invalid decisions being 
+		made at runtime, resulting in unexpected paths being taken.
+		</para>
+		
+		<para>
+		Therefore, to ensure this situation does not occur, we also need runtime governance.
+		We still need to be able to verify that the services continue to conform to the 
+		choreography description. 
+		The <emphasis>Service Validator</emphasis> capability within the SAVARA distribution 
+		can be used to validate the behaviour of each service.
+		</para>
+
+		<para>
+		In this section, we will use the <emphasis>purchasing</emphasis> example found in the 
+		<filename>${SAVARA}/samples/purchasing</filename> folder.
+		</para>
+
+		<section>
+			<title>Service Validator Configuration</title>
+
+			<para>
+			The service validator configuration is defined using specific annotation, that is associated
+			with the 'exchange details' components (contained within interactions), within the 
+			choreography description.
+			</para>
+
+			<para>
+			To view the pre-configured service validator configuration defined for the Purchasing
+			example, edit the <filename>PurchaseGoods.cdm</filename> file, navigate to the 
+			<emphasis>Choreography Flows</emphasis> tab and then select the 
+			<emphasis>Choreography->Edit Annotations</emphasis> menu item associated with the first 
+			'exchange details' component (as shown below).
+			</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/editvalidatorann.png" align="center" width="3in" />
+		</imageobject>
+
+			<para>
+			This will display the annotation editor, with the single configured annotation called 
+			'validator'. This annotation defines the information required for the Service Validator 
+			to monitor this specific message exchange (e.g. the JMS destination
+			on which the message will be passed, or in this case the Service Name for the target
+			Web Service).
+			</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/validatorannotation.png" align="center" width="3in" />
+		</imageobject>
+
+			<para>
+			Once an annotation has been defined, it will also be displayed as part of the tooltip 
+			for the associated model component, for example:
+			</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/validatortooltip.png" align="center" width="4in" />
+		</imageobject>
+
+			<para>
+			Once the annotations have been defined for all relevant 'exchange details' components 
+			in the choreography description, the choreography file can be copied to the 
+			<filename>${JBossAS}/server/default/deploy/savara-validator-jboss.sar/models</filename>
+			folder in the JBossAS environment. The service validator configuration for the 
+			<emphasis>purchasing</emphasis> example has been preconfigured to be deployed as part of 
+			the installation procedure.
+			</para>
+
+			<note>
+			<para>
+			If the <filename>savara-validator-jboss.sar/validator-config.xml</filename> within the JBossAS 
+			environment is modified, or choreography description files added, removed or updated within 
+			the <filename>savara-validator-jboss.sar/models</filename> sub-folder, then the changes will 
+			automatically be detected and used to re-configure the service validators without having to 
+			restart the server.
+			</para>
+			</note>
+
+		</section>
+
+		<section>
+			<title>SAVARA Monitor</title>
+
+			<para>
+			The SAVARA Monitor is an Eclipse based tool that can be used to help develop,
+			test and validate a business process (encoded as a choreography) executing across 
+			a distributed system. (Future releases will include equivalent web based tooling
+			to enable production based logging and query of the validation information).
+			</para>
+			
+			<para>
+			The tool is used to observe a correlated view of the executing business 
+			transactions. Each service validator can be configured to report activites (i.e. sent 
+			and received messages) that it validates, to enable the correlator to reconstitute a 
+			global interpretation of each transaction.
+			</para>
+
+			<para>
+			This correlated view of each transaction can be used to understand where each 
+			transaction is within the process. It can also be used to report
+			<emphasis>out of sequence</emphasis>,  <emphasis>unexpected messages</emphasis> and 
+			more general errors in the context of the business process.
+			</para>
+
+			<para>
+			Once the following examples have been deployed to the JBossAS environment, and the 
+			server is running, then the monitoring tool can be launched from the Eclipse environment 
+			by selecting the <emphasis>Savara->Monitor</emphasis> menu item from the popup menu 
+			associated with the choreography (.cdm) file.
+			</para>
+
+			<para>
+			Wait for the monitor window to start, and indicate that the choreography is being monitored, 
+			shown in the status line at the bottom of the window.
+			</para>
+
+		</section>
+
+		<section>
+			<title>Web Service / WS-BPEL Example - Purchasing</title>
+			
+			<para>
+			Savara includes the ability to validate web services (and therefore BPEL
+			processes) that use the jbossws-native stack. However the ODE engine, used
+			to execute BPEL processes within RiftSaw, currently optimises communications
+			between BPEL processes executing within the same engine, so that the communications
+			do not occur using the Web Service stack. This means that Savara is currently
+			unable to validate these interactions by default.
+			</para>
+			
+			<para>
+			There are two solutions to this problem. The first is to disable the interprocess
+			communications used between the two BPEL processes, which will be the approach
+			described in this section. The other approach is to implement the 'Credit Agency'
+			participant as a JAX-WS service.
+			</para>
+			
+			<section>
+				<title>Deploying the Example</title>
+				
+				<para>
+				Once the BPEL processes have been generated, and the implementation details
+				added, it is currently necessary to disable the 'inter-process' communication
+				that is used to communicate between the two processes (an ODE optimization
+				when the processes are running in the same engine). This is achieved by
+				editing the deployment descriptor for the Store process (using a text editor
+				rather than the Eclipse form editor), and add the attribute
+				<emphasis>usePeer2Peer="false"</emphasis> to the <emphasis>invoke</emphasis> element.
+				</para>
+				
+				<para>
+				The next step is to deploy the BPEL processes for the Store and CreditAgency
+				participants to a JBossAS server running RiftSaw. This can be achieved
+				using the Eclipse Web Tooling Project (WTP) server support, in conjunction with
+				the JBoss Tools features mentioned in the installation section.
+				</para>
+				
+				<para>
+				Create a JBossAS server entry in the <emphasis>Servers</emphasis> view, using
+				the <emphasis>New->Server</emphasis> menu item on the view's context menu.
+				Configure the server entry to point to a JBossAS environment that has
+				previously been configured to run RiftSaw. Select the server in the
+				<emphasis>Servers</emphasis> view, and then select the <emphasis>Add and Remove ...</emphasis>
+				menu item. This will show a dialog window that will include the CreditAgency
+				and Store BPEL projects on the left. Select both projects, and press the
+				<emphasis>Add</emphasis> button. When the <emphasis>Finish</emphasis> button
+				is selected, the BPEL processes will be associated with the server.
+				</para>
+			</section>
+			
+			<section>
+				<title>Running the Example</title>
+				
+				<para>
+				Start the server using the <emphasis>Start</emphasis> menu item associated with
+				the JBossAS server in the <emphasis>Servers</emphasis> view, or manually from
+				a terminal window in the JBossAS server's <filename>bin</filename> folder using
+				the <emphasis>run</emphasis> script. Once the server
+				has fully started, the BPEL processes should have been deployed.
+				</para>
+				
+				<para>
+				The next step is to start the <emphasis>Savara->Monitor</emphasis> associated
+				with the <filename>PurchaseGoods.cdm</filename> choreography description.
+				</para>
+				
+				<para>
+				The final step is to send a test message to the <emphasis>Store</emphasis>
+				BPEL process. This can be achieved by selecting the <filename>PurchaseGoodsProcess_Store.wsdl</filename>
+				file, within the <emphasis>PurchaseGoodsProcess_Store</emphasis> project
+				(<filename>bpelContents</filename> folder), and then select the menu
+				item <emphasis>Web Services->Test with Web Services Explorer</emphasis>.
+				</para>
+				
+				<para>
+				Expand the 'StoreInterfaceBinding' node, in the left hand panel of the explorer,
+				and select the 'buy' operation. Then select the 'Source' link, which will show the
+				various sections of the SOAP message to be sent. Edit the message body to be:
+				</para>
+
+				<informalexample>
+	  				<programlisting role="XML" ><![CDATA[
+		<q0:BuyRequest id="1" amount="200" />
+	 				 ]]></programlisting>
+				</informalexample>
+				
+				<para>
+				Then press the 'Ok' button further down the panel. This will send the message to the
+				Store process, and eventually cause a response to appear in the lower panel.
+				</para>
+				
+				<para>
+				Four entries should appear in the SAVARA monitor, the buy request, credit check
+				request, credit check ok (response) and buy confirmed (response).
+				</para>
+				
+		<imageobject>
+			<imagedata fileref="en-US/images/SAVARAMonitorPurchasing1.png" align="center" width="6in" />
+		</imageobject>
+
+				<para>
+				To demonstrate how an error would be detected and reported, issue a new request
+				such as:
+				</para>
+
+				<informalexample>
+	  				<programlisting role="XML" ><![CDATA[
+		<q0:BuyRequest id="2" amount="300" />
+	 				 ]]></programlisting>
+				</informalexample>
+				
+				<para>
+				This will result in an unexpected message to be reported, as there is a difference
+				between the choreography and the CreditAgency BPEL process (implementation).
+				The choreography defines that a valid credit check should be returned if the
+				amount is less than 250. However the BPEL process has implemented this condition
+				as a valid credit check is where the amount is less or equal to 500.
+				</para>
+				
+		<imageobject>
+			<imagedata fileref="en-US/images/SAVARAMonitorPurchasing2.png" align="center" width="6in" />
+		</imageobject>
+
+			</section>
+		</section>
+		
+		<section>
+			<title>JBossESB Example - Trailblazer</title>
+			
+			<section>
+				<title>Deploying the Example</title>
+	
+				<para>
+				The first step to deploying the Trailblazer example is to configure the JBossAS environment:
+				</para>
+	
+	  			<orderedlist>
+		  			<listitem>
+					Update the <filename>${JBossAS}/server/default/deployers/esb.deployer/jbossesb-properties.xml</filename> 
+					file, in the section entitled "transports" and specify all of the SMTP mail server settings for 
+					your environment.
+					</listitem>
+					<listitem>
+						Update the <filename>trailblazer/trailblazer.properties</filename>
+						<para>
+						Update the <property>file.bank.monitored.directory</property> and 
+						<property>file.output.directory</property> properties. These are folders 
+						used by the File Based Bank, and are set to <filename>/tmp/input</filename> 
+						and <filename>/tmp/output</filename> by default.
+						</para>
+					</listitem>
+					<listitem>
+						Update the <filename>trailblazer/esb/conf/jboss-esb.xml</filename>
+						<para>
+						There is a <emphasis>fs-provider</emphasis> block, update the 
+						<property>directory</property> attribute value to be the same as the 
+						<property>file.output.directory</property> value in 
+						<filename>trailblazer.properties</filename> file.
+						</para>
+					</listitem>
+					<listitem>
+						Start the JBossAS server
+					</listitem>
+				</orderedlist>
+	
+				<para>
+				One the server has been started, the next step is to deploy the relevant 
+				components into the JBossAS environment. This is achieved by:
+				</para>
+	
+	  			<orderedlist>
+					<listitem>
+						From the <filename>trailblazer</filename> folder, execute the following 
+						command to deploy the example to the ESB: 
+						<emphasis role="bold">ant deploy</emphasis>
+						<para>
+						this should deploy the ESB and WAR files to your JBoss AS 
+						<filename>server/default</filename>.
+						</para>
+					</listitem>
+					<listitem>
+						From the <filename>trailblazer/banks</filename> folder, execute the command 
+						to start the JMS Bank service: <emphasis role="bold">ant runJMSBank</emphasis>.
+					</listitem>
+					<listitem>
+						From the <filename>trailblazer/banks</filename> folder, execute the command 
+						to start the JMS Bank service: <emphasis role="bold">ant runFileBank</emphasis>.
+					</listitem>
+				</orderedlist>
+	
+			</section>
+	
+			<section>
+				<title>Running the Example</title>
+	
+				<para>
+				To run the example, you need to start a browser and select the URL 
+				<ulink url="http://localhost:8080/trailblazer">localhost:8080/trailblazer</ulink>. This will 
+				show the following page, if the server has been configured correctly and the TrailBlazer 
+				example deployed:
+				</para>
+	
+			<imageobject>
+				<imagedata fileref="en-US/images/TrailblazerWebPage.jpg" align="center" width="4in" />
+			</imageobject>
+	
+				<para>
+				Now you can submit quotes, You will see either a loan request rejected (single email) because 
+				the score is less than 4, or two emails (one from JMS bank and one from FileBased bank) with 
+				valid quotes. When entering subsequent quotes, make sure that the quote reference is updated, 
+				so that each session has a unique id.
+				</para>
+	
+			</section>
+	
+			<section>
+				<title>Detecting a Validation Error</title>
+	
+				<para>
+				To demonstrate the detection of validation errors, there is an alternative implementation of the 
+				trailblazer modules that behaviour differently to the choreography that is being monitored. 
+				Specifically, the credit score threshold used to determine whether a loan request should be 
+				issued to the banks, is raised from 4 to 7.
+				</para>
+	
+				<para>
+				To deploy the version of the TrailBlazer example that results in validation errors, then:
+				</para>
+	
+	  			<itemizedlist>
+					<listitem>
+					From the <filename>${SAVARA}/samples/trailblazer</filename> folder, execute the 
+					following command to deploy the example to the ESB: 
+					<emphasis role="bold">ant deploy-error-client</emphasis>.
+					</listitem>
+				</itemizedlist>
+	
+				<para>
+				The next step is to issue more transactions, until a credit check score occurs that is between 
+				4 and 6 inclusive. This will result in a <emphasis>insufficientCredit</emphasis> interaction 
+				being reported, which would be unexpected in terms of the choreography.
+				</para>
+	
+			<imageobject>
+				<imagedata fileref="en-US/images/TrailBlazerMonitorError.jpg" align="center" width="4in" />
+			</imageobject>
+	
+				<para>
+				When errors, such as unexpected messages, are detected by the service validators and reported 
+				to the SAVARA Monitor, they are displayed in red.
+				</para>
+	
+			</section>
+		</section>
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="serviceanalysisdesign">
+	<title>Service Oriented Analysis and Design</title>
+
+	<para>
+	At this point in the lifecycle, various activities would occur related to reviewing
+	services (i.e. in a SOA Repository) and understanding whether existing services
+	meet requirements, need to be modified, or whether new services need to be
+	developed from scratch.
+	</para>
+	
+	<section>
+		<title>Service Oriented Design</title>
+
+		<para>
+		In the current SAVARA tooling, the main functionality in the Service Oriented
+		Design phase is the generation of BPMN (version 1) diagrams. These diagrams
+		can be used as guidance for the development teams that are implementing the
+		individual services.
+		</para>
+		
+		<para>
+		It is also possible to extend the generated BPMN (version 1) diagrams to include
+		service logic. However it should be noted that changes to the choreography or
+		BPMN diagrams will not be synchronized/merged. So changes in the choreography will
+		not be checked for conformance against previously generated BPMN diagrams,
+		and it will be necessary to generate new 'service contract' BPMN (version 1)
+		diagrams to reflect changes in behaviour of a service within the updated
+		choreography.
+		</para>
+		
+		<para>
+		In future versions of the SAVARA, based on BPMN2, it will be possible to
+		formally check BPMN2 process models for conformance against a choreography
+		model, and potentially synchronize differences in <emphasis>externally
+		observable behaviour</emphasis> between them.
+		</para>
+		
+		<para>
+		To generate a BPMN (version 1) diagram from a choreography, select the
+		<emphasis>Export</emphasis> menu item associated with the choreography file,
+		and select the <emphasis>Other->BPMN</emphasis> option.
+		</para>
+		
+		<imageobject>
+			<imagedata fileref="en-US/images/ExportBPMNMenu.png" align="center" width="4in" />
+		</imageobject>
+		
+		<para>
+		Once the option has been selected, you will be asked to select the location
+		where the generated BPMN diagrams should be stored. A diagram will be
+		created containing all of the participants involved in the choreography in
+		a single collaboration diagram.
+		</para>
+		
+		<para>
+		Select a folder that is located within a project in your Eclipse workspace.
+		Once the folder has been chosen, the diagrams will be generated. To see
+		them within the Eclipse project, you will need to <emphasis>refresh</emphasis>
+		the relevant folder. 
+		</para>
+		
+		<para>
+		The generated diagram will appear as two files, one contains the underlying
+		BPMN model (i.e. the information about the tasks, control links, message links,
+		etc.) and the other file contains the diagram information (i.e. node positions,
+		etc). Double click on the file with the <filename>.bpmn_diagram</filename>
+		suffix to view the diagram in the Eclipse BPMN editor.
+		</para>
+		
+		<imageobject>
+			<imagedata fileref="en-US/images/ExportedBPMN.png" align="center" width="6in" />
+		</imageobject>
+		
+	</section>
+
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="servicedev">
+	<title>Service Development</title>
+
+	<para>
+Services can be developed by generating initial development artifacts, based on artifacts
+created in preceding phases (e.g. global model or service contracts/designs).
+	</para>
+	
+	<para>
+To ensure that the services continue to conform to the artifacts defined in the previous
+phases, the tools perform conformance checking between the service implementation and
+the existing architecture/design artifacts. This is not possible with all implementation
+languages - they must provide the means to extract the communication structure for
+comparison.
+	</para>
+	
+	<para>
+The following sections explain how the generation and conformance checking can be achieved
+for the WS-BPEL implementation language.
+	</para>
+	
+	<section>
+		<title>WS-BPEL</title>
+
+		<para>
+This tools include a capability to generate a service implementation, for a participant in a choreography,
+using WS-BPEL. A completed version of the <emphasis>PurchasingGoods</emphasis> example can be
+found in the samples directory (which can be imported into Eclipse).
+		</para>
+		
+		<para>
+However if you wish to generate the example from scratch, the follow the instructions in this section.
+More information about how to use this feature can be found in the User Guide.
+		</para>
+
+		<section>
+			<title>Generating WS-BPEL based Services</title>
+
+			<para>
+When a choreography description has been created, it is possible to generate a BPEL Process (and associated
+WSDL files and deployment descriptor) for each of the participants defined within the choreography.
+To try this out, select the <emphasis>Savara->Generate->WS-BPEL</emphasis> menu item from the popup menu
+associated with the <filename>PurchaseGoods.cdm</filename>.
+			</para>
+
+			<imageobject>
+				<imagedata fileref="en-US/images/GenerateBPELMenu.jpg" align="center" width="3in" />
+			</imageobject>
+
+			<para>
+This will display a dialog listing the possible services that can be generated from this choreography,
+with a proposed Eclipse project name.
+			</para>
+
+			<imageobject>
+				<imagedata fileref="en-US/images/GenerateBPELDialog.jpg" align="center" width="3in" />
+			</imageobject>
+
+			<para>
+To test out this feature, uncheck the <emphasis>Buyer</emphasis> participant, leave the build system
+as <emphasis>Ant</emphasis>, and
+press the 'Ok' button. This will create a single new project for the <emphasis>Store</emphasis> and
+<emphasis>CreditAgency</emphasis> participants.
+			</para>
+
+			<para>
+Each project will contain a single <filename>bpel</filename> folder containing the WS-BPEL process
+definition for the participant, a list of relevant WSDL files and a deployment descriptor file
+for use with RiftSaw. Howeve the WS-BPEL and WSDL files are standard, so can be deployed to any
+WS-BPEL 2.0 compliant engine.
+			</para>
+
+			<imageobject>
+				<imagedata fileref="en-US/images/GenerateBPELNav.jpg" align="center" width="2in" />
+			</imageobject>
+
+		</section>
+			
+		<section>
+			<title>Adding implementation details</title>
+				
+			<para>
+			The generated BPEL processes and deployment descriptors are incomplete, due to
+			lack of implementation details in the choreography description. The choreography
+			simply represents the externally observable interactions between the parties,
+			and therefore cannot provide internal implementation details.
+			</para>
+			
+			<para>
+			Therefore a completed version of the deployment descriptor and BPEL process files,
+			for both the creditAgency and store participants, can be found in the
+			<emphasis>purchasing</emphasis> example's <filename>completed</filename> folder.
+			</para>
+			
+			<para>
+			To highlight the differences between the original generated version, and the completed
+			version, simply select both files and use the <emphasis>Compare With->Each Other</emphasis>
+			menu item.
+			</para>
+			
+		</section>
+
+	</section>
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/tap.xml
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/tap.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/module/tap.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="tap">
+	<title>Testable Architecture Project</title>   
+    
+    <section>
+    	<title>Managing Dependencies</title>
+    	
+	    <para>
+	    The previous sections have discussed the various phases of the software development
+	    lifecycle, and the artifacts that can be created. They have also outlined some
+	    validation performed between the scenarios and choreography, when a specific link
+	    has been established from the scenario.
+	    </para>
+	    
+	    <para>
+	    However the aim of the "Testable Architecture" methodology is to provide validation
+	    between all artifacts, to ensure that artifacts defined at any particular phase
+	    can be shown to be valid against the artifacts in preceding phases. 
+	    </para>
+	    
+	    <para>
+	    Therefore the concept of a "Testable Architecture Project" or TAP has been introduced.
+	    This is essentially a file that records information about the artifacts defined in
+	    each phase of the software development lifecycle, and the relationships between them.
+	    This file can then be validated to ensure that each artifact, and its dependencies,
+	    are valid in respect of each other.
+	    </para>
+	    
+	    <para>
+	    For example, the <filename>purchasing</filename> example contains a TAP file with
+	    the following contents:
+	    </para>
+	    
+	    <informalexample>
+		 	<programlisting role="XML" ><![CDATA[
+<project xmlns="http://www.savara.org/ta/project" xmlns:xsi="http://www.w3.org/2001/XMLSchema"
+			xsi:schemaLocation="http://www.savara.org/ta/project tap.xsd"
+			name="Purchasing" version="1.0.0">
+			
+	<phase name="requirements">
+		<resource id="SuccessfulPurchase.scn">
+			<uri type="eclipse" context="purchasing" locator="/SuccessfulPurchase.scn" />
+		</resource>
+		<resource id="InvalidPurchase.scn">
+			<uri type="eclipse" context="purchasing" locator="/InvalidPurchase.scn" />
+		</resource>
+	</phase>
+	
+	<phase name="architecture">
+		<resource id="PurchaseGoods.cdm">
+			<uri type="eclipse" context="purchasing" locator="/PurchaseGoods.cdm" />
+			<relationship type="depends" ref="SuccessfulPurchase.scn" />
+			<relationship type="depends" ref="InvalidPurchase.scn" />
+		</resource>
+	</phase>
+	
+	<phase name="implementation">
+		<resource id="PurchaseGoodsProcess_Store.bpel">
+			<uri type="eclipse" context="PurchaseGoodsProcess-Store"
+						locator="/bpelContent/PurchaseGoodsProcess_Store.bpel" />
+			<relationship type="depends" ref="PurchaseGoods.cdm" >
+				<description>
+					Link from the BPEL process to the 'Store' participant 
+					within the choreography
+				</description>
+				<link type="role" to="Store" />
+			</relationship>
+		</resource>
+		<resource id="PurchaseGoodsProcess_CreditAgency.bpel">
+			<uri type="eclipse" context="PurchaseGoodsProcess-CreditAgency"
+						locator="/bpelContent/PurchaseGoodsProcess_CreditAgency.bpel" />
+			<relationship type="depends" ref="PurchaseGoods.cdm" >
+				<description>
+					Link from the BPEL process to the 'CreditAgency' participant 
+					within the choreography
+				</description>
+				<link type="role" to="CreditAgency" />
+			</relationship>
+		</resource>
+	</phase>
+</project>
+		 	]]></programlisting>
+		</informalexample>
+	    
+	    <para>
+	    The top level element is <emphasis>project</emphasis>, with the <emphasis>name</emphasis>
+	    and <emphasis>version</emphasis> attributes to define the details of the Testable Architecture
+	    Project.
+	    </para>
+	    
+	    <para>
+	    The project then contains <emphasis>phase</emphasis> elements, one for each stage of the
+	    software development lifecycle we are interested in. These elements are only used to
+	    segment the artifacts into the different phases, which can be useful for tasks such as
+	    project management or documentation generation.
+	    </para>
+	    
+	    <para>
+	    The phase element contains <emphasis>resource</emphasis> elements, one per artifact. A
+	    resource represents an artifact that is of interest in the Testable Architecture Project.
+	    </para>
+	    
+	    <para>
+	    The resource element contains one or more of the following elements:
+	    </para>
+	    
+	    <orderedlist>
+	    	<listitem>
+	    	uri
+	    	<para>
+	    	This element is used to define the location of a resource. A URI element is required for
+	    	each environent in which the resource may be accessed, for example, within Eclipse and
+	    	within an SOA Repository.
+	    	</para>
+	    	<para>
+	    	The <emphasis>type</emphasis> attribute defines the type of locator, which will usually
+	    	map onto the environment in which the resource exists. So in this case we are only
+	    	defining URI elements associated with the Eclipse environment.
+	    	</para>
+	    	<para>
+	    	The <emphasis>context</emphasis> attribute defines the local information that can be used
+	    	in the particular environment, to determine where the resource is contained. For example,
+	    	if the environment is Eclipse, the context would be the project name.
+	    	</para>
+	    	<para>
+	    	The <emphasis>locator</emphasis> attribute is used to specify the specific location of
+	    	the resource, within the particular specified context, in the environment type. For example,
+	    	if the environment was Eclipse, then the locator would be the relative path of the resource
+	    	within the project identified in the context attribute.
+	    	</para>
+	    	</listitem>
+	    	<listitem>
+	    	relationship
+	    	<para>
+	    	This element establishes a relationship from the containing resource, to another resource
+	    	identifed by the <emphasis>ref</emphasis> attribute.
+	    	</para>
+	    	<para>
+	    	The relationship element can optionally have additional information associated with it,
+	    	to help clarify the nature of the relationship between the two resources.
+	    	</para>
+	    	<para>
+	    	For example, in the TAP file illustrated above, the two BPEL resources (in the implementation
+	    	phase) have a relationship to the choreography file - however the relationship needs to be
+	    	more specific. We need to indicate what <emphasis>role</emphasis> within that choreography
+	    	the BPEL processes are associated with. The <emphasis>link</emphasis> element enables
+	    	the <emphasis>type</emphasis> to be defined, and a value to be specified in the
+	    	<emphasis>to</emphasis> attribute.
+	    	</para>
+	    	</listitem>
+	    </orderedlist>
+	</section>
+	
+	<section>
+		<title>Validating a Testable Architecture Project</title>
+		
+	    <para>
+	    To trigger validation of a Testable Architecture Project (TAP), select the <filename>.tap</filename>
+	    file and choose the <emphasis>Savara->Validate</emphasis> menu item. If any errors or warnings are
+	    detected, they will be recorded as errors in the Problems or Markers view (depending on which
+	    perspective is being used).
+	    </para>
+	    
+	    <para>
+	    If you invoke the validation on the TAP file within the <emphasis>purchasing</emphasis> project,
+	    you will find that it will create an error associated with the choreography file, indicating
+	    that it does not meet the scenario "InvalidPurchase.scn". This is because this scenario has
+	    specifically been created to demonstrate how an error is reported.
+	    </para>
+	    
+	    <para>
+	    If the scenario is simulated against the choreography, using the green <emphasis>play</emphasis> button on the
+	    toolbar, then it will be possible to see specifically where the scenario is not met by the
+	    choreography.
+	    </para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/InvalidPurchasePostTest.jpg" align="center" width="5in" />
+		</imageobject>
+   
+	    <para>
+	    In this case, it is because the CreditAgency has returned a credit check failed message, but the 
+	    Store is still attempting to return a buy confirmed message.
+	    </para>
+	    
+	    <para>
+	    Its possible that this scenario is valid, and therefore the choreography needs to be updated
+	    to cater for this scenario. However in this case, we may just be wanting to represent a
+	    <emphasis>negative</emphasis> use case, and therefore deliberately describe a situation we
+	    do not want the choreography to handle. Therefore we need to configure the scenario to
+	    indicate that the failure is expected. 
+	    </para>
+	    
+	    <imageobject>
+			<imagedata fileref="en-US/images/ExpectedToFail.png" align="center" width="5in" />
+		</imageobject>
+	    
+	    <para>
+	    Simply select the 'send' node for the final interaction between the Store and Buyer, and
+	    set the 'Expected to Fail' property to true. This will cause a red boundary to be displayed
+	    around the node, indicating that it is expected to fail. Now when the scenario is simulated
+	    or validated, if that node does not fail, that will be reported as an error. However if the
+	    node does fail as expected, that will be treated as a valid case.
+	    </para>
+	   
+	    <para>
+	    If the validation of the TAP file is performed again, the error associated with the
+	    <filename>InvalidPurchase.scn</filename> should no disappear.
+	    </para>
+	    
+	    <para>
+	    To experiment with other types of validation that are performed, open the <filename>PurchaseGoods.cdm</filename>
+	    and go to the <emphasis>Base Types</emphasis> tab. Then open up the node for
+	    <emphasis>Information Types</emphasis> and select the <emphasis>CreditCheckOk</emphasis>
+	    entry. In the <emphasis>Properties</emphasis> view, change the <emphasis>element</emphasis>
+	    attribute, e.g. appending an 'X' to the "ca:CreditCheckOk" value.
+	    </para>
+	    
+	    <para>
+	    When the choreography has been saved, re-perform the validation on the TAP file. This
+	    should now display 'Type Mismatch' errors against the previously generated BPEL
+	    processes, and also flag errors associated with the scenarios.
+	    </para>
+
+    </section>
+
+</chapter>

Added: branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/xslt/pdf.xsl
===================================================================
--- branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/xslt/pdf.xsl	                        (rev 0)
+++ branches/experimental/2.0.x/docs/gettingstartedguide/src/main/en-US/xslt/pdf.xsl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.72.0/fo/docbook.xsl" />
+  <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl" />
+
+  <!-- Override the default font settings -->
+  <xsl:param name="body.font.family" select="'Times New Roman, serif'" />
+  <xsl:param name="monospace.font.family" select="'DejaVu Sans Mono, monospace'" />
+  <xsl:param name="sans.font.family" select="'Arial, sans-serif'" />
+  <xsl:param name="title.font.family" select="$body.font.family" />
+  <xsl:param name="programlisting.font" select="$monospace.font.family" />
+  <xsl:param name="programlisting.font.size" select="'75%'" />
+
+  <!-- Remove the blank pages between the chapters -->
+  <xsl:param name="double.sided" select="0" />
+
+  <!-- Use SVG for callout images instead of PNG -->
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension" select="'.svg'" />
+
+  <!-- Hide URL -->
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- Don't use italic font for links -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="font-style">normal</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Decrease the link font size in the program listing -->
+  <xsl:attribute-set name="monospace.properties">
+    <xsl:attribute name="font-size">1em</xsl:attribute>
+    <xsl:attribute name="font-family">
+        <xsl:value-of select="$monospace.font.family"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+  
+  <!-- Add some spacing between callout listing items -->
+  <xsl:template match="callout">
+    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+    <fo:list-item id="{$id}" space-before="1em">
+      <fo:list-item-label end-indent="label-end()">
+        <fo:block>
+          <xsl:call-template name="callout.arearefs">
+            <xsl:with-param name="arearefs" select="@arearefs"/>
+          </xsl:call-template>
+        </fo:block>
+      </fo:list-item-label>
+      <fo:list-item-body start-indent="body-start()">
+        <fo:block padding-top="0.2em">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:list-item-body>
+    </fo:list-item>
+  </xsl:template>
+  
+  <!-- Slight baseline-shift for callouts in the program listing -->
+  <xsl:template name="callout-bug">
+    <xsl:param name="conum" select='1'/>
+    <xsl:choose>
+      <xsl:when test="$conum &lt;= $callout.graphics.number.limit">
+        <xsl:variable name="filename"
+                      select="concat($callout.graphics.path, $conum,
+                                     $callout.graphics.extension)"/>
+
+        <fo:external-graphic content-width="{$callout.icon.size}"
+                             width="{$callout.icon.size}"
+                             padding="0.0em" margin="0.0em"
+                             baseline-shift="-0.375em">
+          <xsl:attribute name="src">
+            <xsl:choose>
+              <xsl:when test="$passivetex.extensions != 0
+                              or $fop.extensions != 0
+                              or $arbortext.extensions != 0">
+                <xsl:value-of select="$filename"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>url(</xsl:text>
+                <xsl:value-of select="$filename"/>
+                <xsl:text>)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:external-graphic>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
+

Added: branches/experimental/2.0.x/docs/pom.xml
===================================================================
--- branches/experimental/2.0.x/docs/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara</groupId>
+    <artifactId>docs</artifactId>
+    <packaging>pom</packaging>
+    <name>Savara::Docs</name>
+    <version>2.0.0-SNAPSHOT</version>
+    
+    <parent>
+	  <groupId>org</groupId>
+	  <artifactId>savara</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+    <modules>
+      <module>userguide</module>
+	  <module>gettingstartedguide</module>
+	  <module>samplesguide</module>
+    </modules>
+
+  <pluginRepositories>
+    <pluginRepository>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>jboss.release</id>
+      <name>JBoss releases</name>
+      <url>http://repository.jboss.org/maven2</url>
+    </pluginRepository>
+  </pluginRepositories>
+
+</project>

Added: branches/experimental/2.0.x/docs/samplesguide/pom.xml
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,86 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara.docs</groupId>
+    <artifactId>samplesguide</artifactId>
+    <packaging>jdocbook</packaging>
+    <name>Savara::Docs::SamplesGuide</name>
+    <version>2.0.0-SNAPSHOT</version>
+
+   <parent>
+    <groupId>org.savara</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+   </parent>
+
+
+    <build>
+        <plugins>
+            <plugin>
+			<groupId>org.jboss.maven.plugins</groupId>
+			<artifactId>maven-jdocbook-plugin</artifactId>
+			<version>2.2.3</version>
+			<extensions>true</extensions>
+			<executions>
+			  <execution>
+			    <id>generate-docbook</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>resources</goal>
+			      <goal>generate</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<dependencies>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-docbook-xslt</artifactId>
+			    <version>1.1.0</version>
+			  </dependency>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-jdocbook-style</artifactId>
+			    <version>1.1.0</version>
+			    <type>jdocbook-style</type>
+			  </dependency>
+			</dependencies>
+			<configuration>
+			  <sourceDocumentName>master.xml</sourceDocumentName>
+			  <sourceDirectory>${basedir}/src/main</sourceDirectory>
+			  <imageResource>
+			    <directory>${basedir}/src/main</directory>
+			    <includes>
+			      <include>**/images/**/*</include>
+			    </includes>
+			  </imageResource>
+		            <formats>
+		                <format>
+		                    <formatName>pdf</formatName>
+		                    <stylesheetResource>file:///${basedir}/src/main/en-US/xslt/pdf.xsl</stylesheetResource>
+				            <finalName>SAVARA-SamplesGuide.pdf</finalName>
+		                </format>
+						<format>
+						    <formatName>html</formatName>
+							<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+							<finalName>index.html</finalName>
+						</format>
+		                <format>
+		                    <formatName>html_single</formatName>
+		                    <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+		                    <finalName>index.html</finalName>
+		                </format>
+		            </formats>
+			  <options>
+			    <xincludeSupported>true</xincludeSupported>
+			    <xmlTransformerType>saxon</xmlTransformerType>
+			    <docbookVersion>1.72.0</docbookVersion>
+			  </options>
+			</configuration>
+            </plugin>           
+        </plugins>
+    </build>
+
+</project>

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/ChoreoMonReady.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/ChoreoMonReady.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/MonitorMenu.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/MonitorMenu.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/TrailblazerWebPage.jpg
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/images/TrailblazerWebPage.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/master.xml
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/master.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/master.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % RH-ENTITIES SYSTEM "Common_Config/rh-entities.ent">
+]>
+
+<book lang="en">
+  <bookinfo>
+    <title>SAVARA 1.2</title>
+    <subtitle>Samples Guide</subtitle>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/author_group.xml"/>
+  </bookinfo>
+  
+  <toc/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/overview.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/servicevalidator.xml"/>
+
+</book>

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/author_group.xml
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/author_group.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/author_group.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<authorgroup>
+	<corpauthor>Gary Brown</corpauthor>
+	<corpauthor>Jeff Yu</corpauthor>
+</authorgroup>

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/overview.xml
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/overview.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/overview.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="overview">
+  <title>Overview</title>
+  <para>The SAVARA Validator component provides the ability to validate executing services 
+  against a choreography description, demonstrating a form runtime governance.
+  </para>
+  
+	<para>
+		Further information about configuring the runtime validation of services against a choreography 
+		can be found in the <emphasis role="bold">SAVARA User Guide</emphasis>. 
+	</para>
+	
+	<note>
+		<para>
+			Before attempting to deploy and run these examples, you must follow the instructions 
+			in the <filename>${SAVARA}/install</filename> folder. To be able to
+			examine and modify the examples, it is advisable to install the SAVARA Eclipse tools,
+			and import the samples into the Eclipse environment.
+		</para>
+	</note>
+	
+</chapter>

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/servicevalidator.xml
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/servicevalidator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/module/servicevalidator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="servicevalidator">
+  <title>Service Validator</title>
+
+  <section>
+	<title>Trailblazer Example</title>
+
+	<para>
+This example can be found in the <filename>trailblazer</filename> folder. See the TrailBlazer Guide 
+(<filename>${SAVARA}/docs/trailblazer/TBGuide.pdf</filename>) for more information about the example. 
+	</para>
+
+<note>
+	<para>
+The choreography description for the Trailblazer example can be found in the 
+<emphasis>trailblazer-models</emphasis> project in the Eclipse environment. If the project has 
+not yet been imported, then please refer to the instructions in the 
+<emphasis>SAVARA Getting Started Guide</emphasis>.
+	</para>
+	<para>
+You can open the choreography for the trailblazer (trailblazer.cdm) and also a scenario representing 
+a valid transaction associated with the choreography (LoanRequest.scn). In the choreography description 
+editor, view the "Choreography Flows" tab to see the structure of the process.
+	</para>
+	<para>
+To simulate the scenario against the choreography, to ensure that the choreography correctly caters 
+for the valid business scenario, the user should press the green 'play' button in the toolbar, associated 
+with the Scenario Editor.
+	</para>
+</note>
+
+
+  <orderedlist>
+	  <listitem>
+Update the <filename>${JBossAS}/server/default/deployers/esb.deployer/jbossesb-properties.xml</filename> 
+file, in the section entitled "transports" and specify all of the SMTP mail server settings for your 
+environment.
+	</listitem>
+	<listitem>
+Update the <filename>${SAVARA}/samples/trailblazer/trailblazer.properties</filename>
+	<para>
+Update the <property>file.bank.monitored.directory</property> and 
+<property>file.output.directory</property> properties. These are folders used by the File Based Bank, 
+and are set to <filename>/tmp/input</filename> and <filename>/tmp/output</filename> by default. 
+If the selected folders do not exist, then please ensure they are created prior to running the example.
+	</para>
+	</listitem>
+	<listitem>
+Update the <filename>trailblazer/esb/conf/jboss-esb.xml</filename>
+	<para>
+There is a <emphasis>fs-provider</emphasis> block, update the <property>directory</property> 
+attribute value to be the same as the <property>file.output.directory</property> value in 
+<filename>trailblazer.properties</filename> file.
+	</para>
+	</listitem>
+	<listitem>
+Start the JBossAS server
+	</listitem>
+	<listitem>
+From the <filename>trailblazer</filename> folder, execute the command to start the ESB: 
+<emphasis role="bold">ant deploy</emphasis>
+	<para>
+this should deploy the ESB and WAR files to your JBoss AS <filename>server/default</filename>.
+	</para>
+	</listitem>
+	<listitem>
+From the <filename>trailblazer/banks</filename> folder, execute the command to start the JMS 
+Bank service: <emphasis role="bold">ant runJMSBank</emphasis>.
+	</listitem>
+	<listitem>
+From the <filename>trailblazer/banks</filename> folder, execute the command to start the File based 
+Bank service: <emphasis role="bold">ant runFileBank</emphasis>.
+	</listitem>
+	<listitem>
+		<para>
+In the Eclipse environment, select the popup menu associated with the <filename>trailblazer.cdm</filename> 
+file, and choose the <emphasis>Choreography->Monitor</emphasis> menu item.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/MonitorMenu.jpg" align="center" width="2in" />
+		</imageobject>
+
+		<para>
+Wait for the monitor window to start, and indicate that the choreography is being monitored, shown in the 
+status line at the bottom of the window.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/ChoreoMonReady.jpg" align="center" width="4in" />
+		</imageobject>
+
+	</listitem>
+	<listitem>
+		<para>
+Start a browser and enter the URL: 
+<ulink url="http://localhost:8080/trailblazer">localhost:8080/trailblazer</ulink>.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/TrailblazerWebPage.jpg" align="center" width="4in" />
+		</imageobject>
+
+	</listitem>
+	<listitem>
+Now you can submit quotes, You will see either a loan request rejected (single email) because the 
+score is less than 4, or two emails (one from JMS bank and one from FileBased bank) with valid quotes. 
+When entering subsequent quotes, make sure that the quote reference is updated, so that each session 
+has a unique id.
+	</listitem>
+     </orderedlist>
+	<para>
+To demonstrate what occurs when the implementation deviates from the expected behaviour as defined 
+in the choreography description, try the following steps:
+	</para>
+    <orderedlist>
+	<listitem>
+		Run the ant task <emphasis role="bold">ant deploy-error-client</emphasis> to redeploy the 
+		trailblaizer example.
+	</listitem>	
+	<listitem>
+		Run the commands from step 6 above.
+	</listitem>
+	</orderedlist>
+	<para>
+		The above steps show how changing the service implementation without updating a choreography 
+		can result in behavioural validation errors being detected. 	
+	</para>
+	<tip>
+	   <title>What is changed when we run ant deploy-error-client</title>
+		<para>
+			Compared to command of <emphasis role="bold">ant deploy</emphasis>, basically, we have 
+			just updated the following code in
+			<emphasis role="bold">${SAVARA}/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java</emphasis> file.
+		</para>
+		<para>
+		In the following code within the <emphasis role="bold">processLoanRequest</emphasis> 
+		method, we've changed the "4" to "7"
+		
+<programlisting>
+        //step 2 - check if score is acceptable        
+        if (score >= 4) {
+</programlisting>
+		</para>
+	</tip>  
+	
+	<para>
+	Issue further loan requests, remembering to change the quote reference each time, until a Credit 
+	Check result of between 4 and 6 inclusive occurs, which will result in an out of sequence message 
+	being reported (in red) to the Choreography Monitor
+	</para>
+
+	<note>
+		<para>
+		It is currently a requirement that the choreography used within the Choreography Monitor is 
+		the same as the description used to locally monitor the services 
+		(i.e. within the savara-validator-jbossesb.esb/models directory).
+		</para>
+	</note>	
+
+  </section>
+	
+</chapter>

Added: branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/xslt/pdf.xsl
===================================================================
--- branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/xslt/pdf.xsl	                        (rev 0)
+++ branches/experimental/2.0.x/docs/samplesguide/src/main/en-US/xslt/pdf.xsl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.72.0/fo/docbook.xsl" />
+  <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl" />
+
+  <!-- Override the default font settings -->
+  <xsl:param name="body.font.family" select="'Times New Roman, serif'" />
+  <xsl:param name="monospace.font.family" select="'DejaVu Sans Mono, monospace'" />
+  <xsl:param name="sans.font.family" select="'Arial, sans-serif'" />
+  <xsl:param name="title.font.family" select="$body.font.family" />
+  <xsl:param name="programlisting.font" select="$monospace.font.family" />
+  <xsl:param name="programlisting.font.size" select="'75%'" />
+
+  <!-- Remove the blank pages between the chapters -->
+  <xsl:param name="double.sided" select="0" />
+
+  <!-- Use SVG for callout images instead of PNG -->
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension" select="'.svg'" />
+
+  <!-- Hide URL -->
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- Don't use italic font for links -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="font-style">normal</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Decrease the link font size in the program listing -->
+  <xsl:attribute-set name="monospace.properties">
+    <xsl:attribute name="font-size">1em</xsl:attribute>
+    <xsl:attribute name="font-family">
+        <xsl:value-of select="$monospace.font.family"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+  
+  <!-- Add some spacing between callout listing items -->
+  <xsl:template match="callout">
+    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+    <fo:list-item id="{$id}" space-before="1em">
+      <fo:list-item-label end-indent="label-end()">
+        <fo:block>
+          <xsl:call-template name="callout.arearefs">
+            <xsl:with-param name="arearefs" select="@arearefs"/>
+          </xsl:call-template>
+        </fo:block>
+      </fo:list-item-label>
+      <fo:list-item-body start-indent="body-start()">
+        <fo:block padding-top="0.2em">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:list-item-body>
+    </fo:list-item>
+  </xsl:template>
+  
+  <!-- Slight baseline-shift for callouts in the program listing -->
+  <xsl:template name="callout-bug">
+    <xsl:param name="conum" select='1'/>
+    <xsl:choose>
+      <xsl:when test="$conum &lt;= $callout.graphics.number.limit">
+        <xsl:variable name="filename"
+                      select="concat($callout.graphics.path, $conum,
+                                     $callout.graphics.extension)"/>
+
+        <fo:external-graphic content-width="{$callout.icon.size}"
+                             width="{$callout.icon.size}"
+                             padding="0.0em" margin="0.0em"
+                             baseline-shift="-0.375em">
+          <xsl:attribute name="src">
+            <xsl:choose>
+              <xsl:when test="$passivetex.extensions != 0
+                              or $fop.extensions != 0
+                              or $arbortext.extensions != 0">
+                <xsl:value-of select="$filename"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>url(</xsl:text>
+                <xsl:value-of select="$filename"/>
+                <xsl:text>)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:external-graphic>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
+

Added: branches/experimental/2.0.x/docs/trailblazer/TBGuide.odt
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/trailblazer/TBGuide.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/trailblazer/TBGuide.pdf
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/trailblazer/TBGuide.pdf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/pom.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara.docs</groupId>
+    <artifactId>userguide</artifactId>
+    <packaging>jdocbook</packaging>
+    <name>Savara::Docs::UserGuide</name>
+    <version>2.0.0-SNAPSHOT</version>
+
+   <parent>
+    <groupId>org.savara</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+   </parent>
+
+
+    <build>
+        <plugins>
+            <plugin>
+			<groupId>org.jboss.maven.plugins</groupId>
+			<artifactId>maven-jdocbook-plugin</artifactId>
+			<version>2.2.3</version>
+			<extensions>true</extensions>
+			<executions>
+			  <execution>
+			    <id>generate-docbook</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>resources</goal>
+			      <goal>generate</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<dependencies>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-docbook-xslt</artifactId>
+			    <version>1.1.0</version>
+			  </dependency>
+			  <dependency>
+			    <groupId>org.jboss</groupId>
+			    <artifactId>jbossorg-jdocbook-style</artifactId>
+			    <version>1.1.0</version>
+			    <type>jdocbook-style</type>
+			  </dependency>
+			</dependencies>
+			<configuration>
+			  <sourceDocumentName>master.xml</sourceDocumentName>
+			  <sourceDirectory>${basedir}/src/main</sourceDirectory>
+			  <imageResource>
+			    <directory>${basedir}/src/main</directory>
+			    <includes>
+			      <include>**/images/**/*</include>
+			    </includes>
+			  </imageResource>
+		            <formats>
+		                <format>
+		                    <formatName>pdf</formatName>
+		                    <stylesheetResource>file:///${basedir}/src/main/en-US/xslt/pdf.xsl</stylesheetResource>
+				            <finalName>SAVARA-UserGuide.pdf</finalName>
+		                </format>
+						<format>
+						    <formatName>html</formatName>
+							<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+							<finalName>index.html</finalName>
+						</format>
+		                <format>
+		                    <formatName>html_single</formatName>
+		                    <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+		                    <finalName>index.html</finalName>
+		                </format>
+		            </formats>
+			  <options>
+			    <xincludeSupported>true</xincludeSupported>
+			    <xmlTransformerType>saxon</xmlTransformerType>
+			    <docbookVersion>1.72.0</docbookVersion>
+			  </options>
+			</configuration>
+            </plugin>           
+        </plugins>
+    </build>
+
+
+</project>

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorann.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorann.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatoranndiag.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatoranndiag.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorannselect.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/editvalidatorannselect.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel1.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel2.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel3.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genbpel3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig1.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig2.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig3.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genesbconfig3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatordialog.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatordialog.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatormenu.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/genvalidatormenu.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorprefs.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorprefs.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorui.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/monitorui.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/setconversationtype.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/setconversationtype.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/validatorannotation.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/docs/userguide/src/main/en-US/images/validatorannotation.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/master.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/master.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/master.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % RH-ENTITIES SYSTEM "Common_Config/rh-entities.ent">
+]>
+
+<book lang="en">
+  <bookinfo>
+    <title>SAVARA 1.2</title>
+    <subtitle>User Guide</subtitle>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/author_group.xml"/>
+  </bookinfo>
+  
+  <toc/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/overview.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/bpel.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="module/conversation-validation.xml"/>
+
+</book>

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/author_group.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/author_group.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/author_group.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<authorgroup>
+	<corpauthor>Gary Brown</corpauthor>
+	<corpauthor>Jeff Yu</corpauthor>
+</authorgroup>

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/bpel.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/bpel.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/bpel.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="bpel">
+	<title>BPEL</title>
+
+	<section>
+		<title>Overview</title>
+		<para>
+This section will describe generation and conformance checking features related to WS-BPEL.
+		</para>
+		
+		<para>
+This initial release provides basic support for generating BPEL processes from a choreography 
+description. Subsequent releases will also provide conformance checking, to ensure that changes 
+to a BPEL process are validated to ensure the process remains conformant with the choreography.
+		</para>
+	</section>
+
+	<section>
+      	<title>Generating a BPEL process</title>
+		<section>
+			<title>Overview</title>
+			<para>
+This section explains how to generate a template BPEL process from architectural and design
+artifacts.
+			</para>
+		</section>
+		<section>
+			<title>Generating the BPEL Process from a Choreography Description</title>
+			<para>
+When the choreography description has been completed, and has no errors, the user should select
+the "SAVARA->Generate->WS-BPEL" menu item from the popup menu associated with the choreography
+description (.cdm) file.
+			</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/genbpel1.png" width="4in" />
+		</imageobject>
+
+			<para>
+When the dialog window is displayed, it will contain the list of services that can be generated,
+along with the project names that will be created. The user can unselect the services they do not 
+wish to generate (also using the 'Check All' or 'Clear All' buttons).
+			</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/genbpel2.png" width="4in" />
+		</imageobject>
+
+			<para>
+The user can also select their preferred build system, which will create the relevant build structure.
+		</para>
+		<para>
+If there is a problem with the name of the project select, such as invalid characters used in the name, 
+or the project name already exists, then it will be displayed in red.
+			</para>
+
+		<para>
+Once the BPEL is generated, it can be viewed using the Eclipse BPEL editor, e.g.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/genbpel3.png" width="4in"  />
+		</imageobject>
+
+		</section>
+
+		<section>
+			<title>Limitations with the current CDL to BPEL mapping</title>
+
+			<para>
+This initial version of the BPEL generation is primarily targeted at generating the interactions 
+and grouping constructs. These are the important components that will be required when doing 
+conformance checking as part of the next milestone.
+			</para>
+
+			<para>
+This means that assignments and conditional expressions are not currently generated. The 'when' 
+construct in CDL (also known as the blocking workunit) is also not currently handled. This may possible 
+be implemented using flow links.
+			</para>
+		</section>
+	</section>
+
+</chapter>
+

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/conversation-validation.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/conversation-validation.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/conversation-validation.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,432 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="conversationvalidationwithcdl">
+	<title>Conversation Validation with CDL</title>
+	<section>
+      	<title>Overview</title>
+		<para>
+Conversation validation is a form of runtime governance concerned with the dynamic behaviour of a system.
+		</para>
+		<para>
+When coupled with a choreography description model of a system, this means having the ability to ensure that the way a collection of services interact correctly adheres to a description of the business process being enacted.
+		</para>
+		<para>
+This section introduces the choreography description language (CDL) defined by W3C, and the <emphasis>pi4soa</emphasis> open source project which provides an editor for creating choreography descriptions, as well as utilizing these descriptions for runtime validation and execution purposes.
+
+		</para>
+
+	</section>
+
+	<section>
+		<title>Configuration of Conversation Validation</title>
+
+		<para>
+		This section explains how to configure the conversation validation mechanism to validate services
+		against a choreography description. The first sub-section describes how the mechanism is hooked into the
+		JBossESB and JBossWS-Native environments. The following two sub-sections explain two alternate ways that relevant endpoint
+		references can be configured for validation.
+		</para>
+
+		<section>
+			<title>Installing the Conversation Validation Mechanism</title>
+			
+			<section>
+				<title>JBossWS-Native</title>
+				
+				<para>
+				The principle mechanism used for validating conversations within the JBossWS Native stack
+				is through the use of a global filter registered in the
+				<filename>standard-jaxws-client-config.xml</filename> and
+				<filename>standard-jaxws-endpoint-config.xml</filename> files.
+				These files are located in the <emphasis>$JBossAS/server/default/deployers/jbossws.deployter/META-INF</emphasis>
+				folder.
+				</para>
+				
+				<para>
+				The <filename>standard-jaxws-client-config.xml</filename> is updated to include a
+				<emphaiss>pre handler</emphaiss> implemented by a Savara client interceptor.
+				</para>
+				
+				<informalexample>
+	  				<programlisting role="XML" ><![CDATA[
+  <client-config>
+    <config-name>Standard Client</config-name>
+    <pre-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>SAVARA JBossWS-Native Client Validator Interceptor</javaee:handler-name>
+          <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeClientInterceptor</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </pre-handler-chains>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+    <property>
+      <property-name>http://org.jboss.ws/http#chunksize</property-name>
+      <property-value>2048</property-value>
+    </property>
+  </client-config>
+	 				 ]]></programlisting>
+				</informalexample>
+		
+				<para>
+				The <filename>standard-jaxws-endpoint-config.xml</filename> is updated to include a
+				<emphaiss>pre handler</emphaiss> implemented by a Savara server interceptor.
+				</para>
+				
+				<informalexample>
+	  				<programlisting role="XML" ><![CDATA[
+  <endpoint-config>
+    <config-name>Standard Endpoint</config-name>
+    <pre-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>Recording Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
+          <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeServerInterceptor</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </pre-handler-chains>
+  </endpoint-config>
+	 				 ]]></programlisting>
+				</informalexample>
+		
+				<para>
+				These interceptors are installed as part of the installation process for the SAVARA
+				distribution.
+				</para>
+			</section>
+
+			<section>
+				<title>JBossESB</title>
+				
+				<para>
+				The principle mechanism used for validating conversations within an ESB is through the use 
+				of a global filter registered with the <emphasis>jbossesb-properties.xml</emphasis>.
+				This file is located in the <emphasis>$JBossAS/server/default/deployers/esb.deployer</emphasis>
+				folder.
+				</para>
+				<informalexample>
+	  				<programlisting role="XML" ><![CDATA[
+		<properties name="filters">
+			...
+			<property name="org.jboss.soa.esb.filter.10" 
+					value="org.savara.validator.jbossesb.ValidatorFilter"/>
+		</properties>
+	 				 ]]></programlisting>
+				</informalexample>
+		
+				<para>
+				This filter is installed as part of the installation process for the SAVARA distribution.
+				</para>
+			</section>
+		</section>
+
+		<section>
+			<title>Explicit Configuration</title>
+
+		<para>
+		The information concerning which destinations will be validated, and to which model/role 
+		they relate, can be explicitly defined within the <emphasis>validator-config.xml</emphasis> 
+		file, contained within the <emphasis>savara-validator-jbossesb.esb</emphasis> bundle.
+		</para>
+		
+		<para>
+An example of the contents of this file, that would related to the TrailBlazer example, is:
+		</para>
+			<informalexample>
+  				<programlisting role="XML" ><![CDATA[
+	<validator mode="monitor" replyToTimeout="10000" >
+		<service model="TrailBlazer.cdm" 
+					role="LoanBrokerParticipant" >
+			<output epr="jms:queue/esb-tb-creditAgencyQueue" />
+			<input epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+			<output epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+			<output epr="jms:queue/esb-tb-fileBankRequestQueue" />
+			<input epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+			<output epr="jms:queue/esb-tb-customerNotifier" />
+			<input epr="jms:queue/esb-tb-fileBankResponseQueue" />
+		</service>
+		<service model="TrailBlazer.cdm" 
+					role="CreditAgencyParticipant" >
+			<input epr="jms:queue/esb-tb-creditAgencyQueue" />
+			<output epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+		</service>
+		<service model="TrailBlazer.cdm" 
+					role="BankParticipant" >
+			<input epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+			<input epr="jms:queue/esb-tb-fileBankRequestQueue" />
+			<output epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+			<output epr="jms:queue/esb-tb-fileBankResponseQueue" />
+		</service>
+		<service model="TrailBlazer.cdm" 
+					role="NotifierParticipant" >
+			<input epr="jms:queue/esb-tb-customerNotifier" />
+		</service>
+	</validator>
+ 				 ]]></programlisting>
+			</informalexample>
+
+			<para>
+			The 'validator' element has an optional attribute called 'mode', with the possible values 
+			of 'monitor' or 'manage'. If the mode is 'monitor' (which is the default), then any messages 
+			that result in validation errors being detected will continue to be received or sent, with 
+			the errors only be reported for information purposes. If the mode is 'manage', then any 
+			erronous messages detected during validation, that conflict with the behaviour as described 
+			in the choreography, will be prevented from being received or sent.
+		</para>
+		<note>
+			<para>
+			It is important to note that if 'manage' validation mode is used, then the validation 
+			mechanism will be an integral part of the message flow. This may have a slight performance 
+			impact on the delivery of messages between services.
+			</para>
+		</note>
+
+		<para>
+		The optional 'replyToTimeout' (defined in milliseconds) is used to determine how long a dynamic 
+		reply-to destination should be monitored for validation purposes. In some message exchanges, 
+		the response destination will not always be known in advance. Therefore the configuration can 
+		identify such situations, and monitor the reply-to destination for the response. However, if a 
+		response is not delivered in a particular time period, we need to be able to discontinue the 
+		validation of the dynamic endpoint. If this did not occur, then over time too many endpoints 
+		would be monitored, which may result in out-of-memory problems. The default timeout period is 
+		10 seconds.
+		</para>
+		<para>
+		Within the 'validator' element is a list of 'service' elements, one per service being validated. 
+		The behaviour of the service being validated is identified by specifying the model (e.g. 
+		choreography description file) and the role (e.g. participant type) within the model. Therefore, 
+		within the above configuration, the first set of destinations (eprs) are associated with the 
+		<emphasis>LoanBrokerParticipant</emphasis> defined within the choreography description model 
+		found in the file <filename>TrailBlazer.cdm</filename>, which will be located within the 
+		<filename>models</filename> folder contained within the
+		<emphasis>savara-validator-jboss.sar</emphasis> bundle.
+		</para>
+		<para>
+		The elements contained within the 'service' element define the <emphasis>input</emphasis> and 
+		<emphasis>output</emphasis> eprs (Endpoint References) that are associated with the service. 
+		The <emphasis>input</emphasis> eprs are the destinations on which messages will be received and 
+		the <emphasis>output</emphasis> eprs are the destinations on which messages will be sent by the 
+		service.
+		</para>
+		<para>
+		The format of the 'epr' attribute will be specific to the type of transport being validated.
+		Currently JMS is supported, and can be identified by the protocol prefix 'jms:', or a
+		Web Service endpoint using a service name with the QName style of '{namespace}localpart'.
+		</para>
+		<para>
+		Each 'input' and 'output' element can also define an optional 'dynamicReplyTo' boolean attribute. 
+		If defined, it will indicate to the Service Validator that the message on the specified endpoint 
+		(epr) will contain a dynamically defined 'reply-to' destination that needs to be monitored for 
+		a response.
+		</para>
+
+		</section>
+
+		<section>
+			<title>Defining the Validator Configuration within a Choreography</title>
+
+		<para>
+		The first step to configuring the validator is to associate the endpoint references (EPRs)
+		against the relevant choreography interactions. This is achieved by defining an
+		annotation for each 'exchange details' component (i.e. each request and response/notification).
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/editvalidatorann.png" width="5in" />
+		</imageobject>
+
+		<para>
+		When the annotation editor is displayed for the relevant 'exchange details' component,
+		the <emphasis>validator</emphasis> annotation should be added. This is achieved by
+		selecting the popup menu associated with the background of the lefthand panel,
+		and selecting the <emphasis>Add Defined Annotation</emphasis> menu item.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/editvalidatoranndiag.png" width="5in" />
+		</imageobject>
+
+		<para>
+		When the list of defined annotations is displayed, select the
+		<emphasis>validator</emphasis> annotation.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/editvalidatorannselect.png" width="3in" />
+		</imageobject>
+
+		<para>
+		After pressing the <emphasis>Ok</emphasis> button, the annotation editor
+		will configure the righthand panel with the parameters associated with this
+		annotation.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/validatorannotation.png" width="5in" />
+		</imageobject>
+
+		<para>
+		To specify the Endpoint Reference (EPR) for a particular message exchange, enter the EPR into the
+		<emphasis>Destination</emphasis> field. The value specified in this field will
+		be dependent upon the technology being validated. For example, if the JBossESB
+		is being monitored, then the value will be a physical address associated with the
+		ESB service endpoint (e.g. jms:queue/esb-quotes). If the technology being validated is a Web
+		Service (or BPEL process), then the field will represent the WSDL service name
+		specified using the QName style (e.g. {namespace}localpart).
+		</para>
+		
+		<para>
+		The <emphasis>Type</emphasis> field is used to define the style of endpoint being
+		validated. In the image above, the endpoint being validated is a Web Service (or
+		BPEL process), and therefore the type is specified as a 'service name'. However if
+		the technology being validated identifies a different endpoint address, for the request
+		and response (as in the case of JBossESB), then the type should be set to
+		'endpoint address'.
+		</para>
+		
+		<para>
+		If the exchange is a request, that
+		will result in a response being sent on a dynamically provided "reply-to"
+		destination, then the <emphasis>Dynamic Reply-To</emphasis> checkbox should be selected.
+		This situation may occur in the case of validating a JBossESB service, where a
+		well-defined endpoint address has not been defined for the response.
+		</para>
+
+		<para>
+		Once the annotation has been defined, then press the <emphasis>Save</emphasis>
+		button to save the annotation against the interaction's exchange details.
+		</para>
+
+		<para>
+		When all of the relevant 'exchange details' components have been configured with
+		a <emphasis>validator</emphasis> annotation, defining the EPR to be validated,
+		then the choreography description file can be copied into the
+		<filename>savara-validator-jboss.sar/models</filename> folder. This will cause
+		the validation mechanism to derive the configuration information from the choreography
+		description model, and begin validating the defined destinations against that
+		choreography description model.
+		</para>
+
+		</section>
+
+	</section>
+
+	<section>
+		<title>Monitoring the Choreography Description</title>
+		
+		<para>
+		Once the server environment has been configured, to perform service validation of a set of
+		services against a choreography description, and the server has been started, then the next
+		step is to configure the monitoring tool. This can be achieved by opening the
+		<emphasis>Window->Preferences->Savara->Monitor</emphasis> dialog, as shown in the following
+		image.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/monitorprefs.png" width="5in" />
+		</imageobject>
+
+		<para>
+		In general, the default values specified for the JNDI and JMS properties will be fine.
+		The only information that should need to be provided is a path to the JMS and JNDI
+		libraries. When using the JBossAS server, this path can be set to the top level
+		<filename>client</filename> folder.		
+		</para>
+		
+		<para>
+		The next step is to launch the monitoring tool. This is located on the popup menu, for
+		the choreography description (i.e. .cdm) file, by selecting the Savara->Monitor menu
+		item. Once the tool has been launched, it will load the choreography description, subscribe
+		to the relevant event destination, and then indicate via a message in the bottom status line
+		that it is ready to monitor.
+		</para>
+
+		<imageobject>
+			<imagedata fileref="en-US/images/monitorui.png" width="5in" />
+		</imageobject>
+
+		<para>
+		When the information is received, from the service validators representing the different
+		participants (services), it is correlated to show the global status of the business 
+		transaction. The list of correlated interactions is shown in reverse time order in the 
+		image.
+		</para>
+		
+		<para>
+		If any <emphasis>out of sequence</emphasis> or other error situations arise, these are 
+		displayed in red.
+		</para>
+	</section>
+
+	<section>
+		<title>Configuration for Conversation Recording</title>
+
+		<para>
+		As well as validating the interactions between a set of
+		services, against a pre-defined choreography description,
+		it is also possible to use the <emphasis>Service Validators</emphasis>
+		in a non-validating record mode.
+		</para>
+
+		<para>
+		This will be useful in situations where a choreography
+		description does not currently exist, and we wish to
+		use the stream of business events being sent and received
+		by each identified service (or participant type) to
+		gain an understanding of the current business process.
+		</para>
+
+		<para>
+		An example of this type of configuration, associated
+		with the TrailBlazer example, is:
+		</para>
+			<informalexample>
+  				<programlisting role="XML" ><![CDATA[
+	<validator>
+		<service role="LoanBrokerParticipant" validate="false" >
+			<output epr="jms:queue/esb-tb-creditAgencyQueue" />
+			<input epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+			<output epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+			<output epr="jms:queue/esb-tb-fileBankRequestQueue" />
+			<input epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+			<output epr="jms:queue/esb-tb-customerNotifier" />
+			<input epr="jms:queue/esb-tb-fileBankResponseQueue" />
+		</service>
+		<service role="CreditAgencyParticipant" validate="false" >
+			<input epr="jms:queue/esb-tb-creditAgencyQueue" />
+			<output epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+		</service>
+		<service role="BankParticipant" validate="false" >
+			<input epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+			<input epr="jms:queue/esb-tb-fileBankRequestQueue" />
+			<output epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+			<output epr="jms:queue/esb-tb-fileBankResponseQueue" />
+		</service>
+		<service role="NotifierParticipant" validate="false" >
+			<input epr="jms:queue/esb-tb-customerNotifier" />
+		</service>
+	</validator>
+ 				 ]]></programlisting>
+			</informalexample>
+
+		<para>
+		To define a <emphasis>Service Validator</emphasis> in record
+		only mode, the <emphasis>model</emphasis> attribute
+		is not specified (because no choreography description exists
+		to be validated against), and the optional <emphasis>validate</emphasis>
+		attribute should be set to <emphasis role="bold">false</emphasis> (by default
+		this attribute is <emphasis role="bold">true</emphasis>).
+		</para>
+	</section>
+
+</chapter>

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/overview.xml
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/overview.xml	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/module/overview.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="overview">
+  <title>Overview</title>   
+       
+			  <para>
+			  		The SAVARA project aims to leverage the concept of a choreography (or conversation) 
+			  		description to provide design-time and run-time governance of an SOA.
+			  </para>
+			  <para>
+			  		A Choreography provides the means to describe the service interactions between multiple parties from a global (or service neutral) perspective. 
+			  		This means that it is possible for an organisation to define how an end-to-end business process should function, regardless of whether orchestrated 
+			  		or peer-to-peer service collaboration will be used.
+			   </para>
+			  <para>
+			  		Although in simple situations, a BPEL process description can provide a description of the interactions between multiple services, this only works where a 
+			  		single orchestrating process is in control. The benefit of the choreography description is that it can be used to provide a global view of a process across multiple 
+			  		orchestrated service domains.
+			  	</para>
+			  <para>
+			  		This document will outline how the Choreography Description is being used as part of SAVARA to provide SOA governance capabilities 
+			  		for each phase of the SOA lifecycle. 
+			   </para>
+			  <para> 
+			  		When a validated design has been approved by the users, it can be used to generate an initial skeleton of the implementation for each service. 
+			  		The current version of SAVARA enables a skeleton implementation to be generated as a service
+			  		implementation (e.g. WS-BPEL process). 
+			    </para>
+		  
+		<section>
+			<title>WS-CDL</title>
+
+			<para>
+WS-CDL, or Web Service Choreography Description Language, is a candidate recommendation from W3C. Although associated with W3C and Web Services, it is important to begin by stating that the Choreography Description Language (CDL) is <emphasis role="bold">not</emphasis> web service specific.
+		</para>
+		<para>
+The purpose of CDL is to enable the interactions between a collection of peer to peer services to be described from a neutral (or global) perspective. This is different to other standards, such as WS-BPEL, that describe interactions from a service specific viewpoint.
+		</para>
+		<para>
+In essence a choreography description declares roles which will pass messages between each other, called interactions. The interactions are ordered based on a number of structuring mechanism which enables loops, conditional, choices and parallelism to be described. In CDL variables used for messages and for conditionals are all situated at roles. There is no shared state rather there is a precise description of the state at each role and a precise description of how these roles interact in order to reach some notion of common state in which information is exchanged and processed between them.
+		</para>
+		<para>
+In CDL we use interactions and these structuring mechanisms to describe the observable behaviour, the messages exchanges and the rules for those exchanges and any supporting observable state on which they depend, of a system.
+		</para>
+		</section>
+
+		<section>
+			<title>pi4soa</title>
+			<para>
+<emphasis>pi4soa</emphasis> is an open source project established to demonstrate the potential benefits that a global model (as described using CDL) can provide when building an SOA. The open source project is managed by the Pi4 Technologies Foundation, which is a collaboration between industry and academia.
+		</para>
+		<para>
+Building complex distributed systems, without introducing unintended consequences, is a real challenge. Although the Choreography Description Language provides a means of describing complex systems at a higher level, and therefore help to reduce such complexity, it does not necessarily guarantee that erronous situations cannot occur due to inappropriately specified interactions. The research, being carried out by members of the Pi4 Technologies Foundation, into the global model and endpoint projection is targeted at identifying potential unintended consequences, to ensure that a global description of a system can be reliably executed and can be free from unintended consequences. 
+		</para>
+		<para>
+The tool suite currently offers the ability to:
+		</para>
+		<para>
+				<itemizedlist>
+					<listitem>
+			Define a choreography description
+					</listitem>
+					<listitem>
+			Export the description to a range of other formats, such as BPMN, UML activity/state/sequence models, and HTML
+					</listitem>
+					<listitem>
+	Define scenarios (equivalent to sequence diagrams), with example messages, which can then be simulated against an associated choreography
+					</listitem>
+				</itemizedlist>
+		</para>
+	</section>
+
+		  <section> 
+		  <title> SOA Lifecycle Governance </title>
+		   
+		   <section>
+		   		<title>Design Time Governance</title>
+		   		<para>
+		   			Design-time governance is concerned with ensuring that the resulting system correctly implements requirements (whether functional or non-functional). 
+		   			A choreography description can be used to ensure that the implemented system meets the behavioural requirements.
+		   		  </para>
+		   		<para>
+		   			The behavioural requirements can be captured as a collection of scenarios (e.g. sequence diagrams) with associated example messages. 
+		   			This enables an unambiguous representation of the business requirements to be stored in a machine processable form, which can subsequently 
+		   			be used to validate other phases of the SOA lifecycle.
+		   		</para>
+		   		<para>
+		   			Once the choreography description for the SOA has been defined, it can be validated against the scenarios, 
+		   			to ensure that the choreography correctly handles all of the business requirements.
+		   		</para>
+		   		<para>
+		   			Once the service enters the implementation phase, it is important to ensure that it continues to adhere to the design 
+		   			and therefore meets the business requirements. Currently this is achieved through the use of techniques such as continuous testing. 
+		   			However this is only as reliable as the quality of the unit tests that have been written.
+		   		 </para>
+		   		<para>
+		   			When a 'structured' implementation language has been used, such as WS-BPEL,
+		   			 it will be possible to infer the behaviour of the service being implemented, to compare it against the choreography description. 
+		   		 </para>
+		   		<para>
+		   			 Detecting incorrectly implemented behaviour at the earliest possible time saves on downstream costs associated with finding and fixing errors. 
+		   			 By using static validation against the original design, it ensures that the implemented service will deliver its expected behaviour first time. 
+		   			 This is important in building large scale SOAs where different services may be implemented in different locations.
+		   		</para>
+		   		<para>
+		   			There are two other areas where a choreography description can be used as part of design-time governance, 
+		   			that are not currently implemented in SAVARA:
+		   		</para>
+				<itemizedlist>
+		   			<listitem>
+		   						   Service lookup – the choreography description can be used to determine if a service already exists in the Service Repository that meets the appropriate behavioural requirements. 
+		   			</listitem>
+		   			<listitem>
+		   							Service unit testing - this can be achieved using the scenarios originally specified to document the behavioural requirements. 
+		   							Rather than develop an independent source of test data, the scenarios can be used to validate the sequence of messages sent to, 
+		   							and received from, a service, as well as validating the contents of the messages returned from the service under test.
+		   			</listitem>
+		   		</itemizedlist>
+		   </section>
+		   
+		   <section>
+		   		<title>Runtime Governance</title>
+		   		 <para>
+		   		    Runtime governance ensures that the SOA executes as expected according to predefined policies. In this context, a choreography description can be used in two ways.
+		   		  </para>
+		   		  
+		   		  <section>
+		   		  	 <title> Service validator</title>
+		   		  	 <para>
+		   		  	    The choreography description represents the interactions between multiple services to deliver a business goal. 
+		   		  	    To validate the behaviour of each individual service, within the choreography description, the behaviour of each service can be derived from the choreography.
+		   		  	  </para>
+		   		  	  <para>
+		   		  	  	 The derived behaviour (or “endpoint projection”) of a service can be used within a 'service validator' to monitor the inbound and outbound messages for the service, 
+		   		  	  	 to ensure they conform to the expected behaviour. 
+		   		  	  	 If an invalid message is detected, it would be possible to block it, to prevent it from causing subsequent problems in downstream systems. 
+		   		  	  	 The error can also be reported to a central management capability.
+		   		  	  </para>
+		   		  	  <para>
+		   		  	     The SAVARA Validator provides the ability to configure service validators to monitor the behaviour of individual services. 
+		   		  	     An enhanced version of the JBossESB trailblazer example has been included, with the appropriate validator configuration, to demonstrate this mechanism.
+		   		  	  </para>
+		   		  </section>
+		   		  
+		   		  <section>
+		   		  	  <title>Process correlation</title>
+		   		  	   <para> 
+			   		  	   Validating each service locally can enable errors to be detected quickly, 
+			   		  	   and the effects of the error prevented from contaminating other systems by blocking the erroneous messages.
+		   		  	   </para>
+		   		  	   <para>
+		   		  	      However local service specific validation may not be adequate to identify errors that would affect the end-to-end business process. 
+		   		  	      Therefore the message activity at each service validator can be reported to a central 'process correlation engine' which can reconstitute a global view of the business transaction, 
+		   		  	      and determine if it matches the expected behaviour as defined in the choreography description.
+		   		  	   </para>
+		   		  	   <para>
+		   		  	   		The benefit of a correlated global view of the distributed business transaction is that it can be further analysed to ensure other governance polices have been followed – e.g. SLAs.
+		   		  	   </para>
+		   		  	   <para>
+		   		  	       The pi4soa tool suite includes a simple GUI based monitoring tool to display the information obtained from correlating message events associated with individual services. 
+		   		  	       The trailblazer example has been written to cause out of sequence messages under certain circumstances. See the “Samples Guide” for more information on how to run this example.
+		   		  	    </para>
+		   		  </section>	   		  
+		   </section>	
+		 </section>   
+		 
+		 <section> 
+		     <title> First Steps </title>
+		     <para>The first step will be to follow the instructions in the Getting Started Guide to install SAVARA. </para>
+		     <para> Once installed, the next step should be to try out the examples in the samples folder. The examples consistent of:</para>
+		     <itemizedlist>
+                 <listitem>
+                    Choreography related examples
+					<para> 
+                        These examples provide an illustration of how to use scenarios, choreographies
+                        and other associated artifacts.
+                    </para>
+                 </listitem>
+		        <listitem>
+		           Service Validation related examples
+		           <para> 
+		            The samples folder contains an enhanced version of the trailblazer example from the 
+		            JBossESB, with the addition of a File Based Bank, and message content including a 
+		            conversation id to enable the messages to be correlated with a specific session.
+		            </para>
+                 </listitem>
+              </itemizedlist>
+	</section>
+</chapter>

Added: branches/experimental/2.0.x/docs/userguide/src/main/en-US/xslt/pdf.xsl
===================================================================
--- branches/experimental/2.0.x/docs/userguide/src/main/en-US/xslt/pdf.xsl	                        (rev 0)
+++ branches/experimental/2.0.x/docs/userguide/src/main/en-US/xslt/pdf.xsl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.72.0/fo/docbook.xsl" />
+  <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl" />
+
+  <!-- Override the default font settings -->
+  <xsl:param name="body.font.family" select="'Times New Roman, serif'" />
+  <xsl:param name="monospace.font.family" select="'DejaVu Sans Mono, monospace'" />
+  <xsl:param name="sans.font.family" select="'Arial, sans-serif'" />
+  <xsl:param name="title.font.family" select="$body.font.family" />
+  <xsl:param name="programlisting.font" select="$monospace.font.family" />
+  <xsl:param name="programlisting.font.size" select="'75%'" />
+
+  <!-- Remove the blank pages between the chapters -->
+  <xsl:param name="double.sided" select="0" />
+
+  <!-- Use SVG for callout images instead of PNG -->
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension" select="'.svg'" />
+
+  <!-- Hide URL -->
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- Don't use italic font for links -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="font-style">normal</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Decrease the link font size in the program listing -->
+  <xsl:attribute-set name="monospace.properties">
+    <xsl:attribute name="font-size">1em</xsl:attribute>
+    <xsl:attribute name="font-family">
+        <xsl:value-of select="$monospace.font.family"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+  
+  <!-- Add some spacing between callout listing items -->
+  <xsl:template match="callout">
+    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+    <fo:list-item id="{$id}" space-before="1em">
+      <fo:list-item-label end-indent="label-end()">
+        <fo:block>
+          <xsl:call-template name="callout.arearefs">
+            <xsl:with-param name="arearefs" select="@arearefs"/>
+          </xsl:call-template>
+        </fo:block>
+      </fo:list-item-label>
+      <fo:list-item-body start-indent="body-start()">
+        <fo:block padding-top="0.2em">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:list-item-body>
+    </fo:list-item>
+  </xsl:template>
+  
+  <!-- Slight baseline-shift for callouts in the program listing -->
+  <xsl:template name="callout-bug">
+    <xsl:param name="conum" select='1'/>
+    <xsl:choose>
+      <xsl:when test="$conum &lt;= $callout.graphics.number.limit">
+        <xsl:variable name="filename"
+                      select="concat($callout.graphics.path, $conum,
+                                     $callout.graphics.extension)"/>
+
+        <fo:external-graphic content-width="{$callout.icon.size}"
+                             width="{$callout.icon.size}"
+                             padding="0.0em" margin="0.0em"
+                             baseline-shift="-0.375em">
+          <xsl:attribute name="src">
+            <xsl:choose>
+              <xsl:when test="$passivetex.extensions != 0
+                              or $fop.extensions != 0
+                              or $arbortext.extensions != 0">
+                <xsl:value-of select="$filename"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>url(</xsl:text>
+                <xsl:value-of select="$filename"/>
+                <xsl:text>)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:external-graphic>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
+

Added: branches/experimental/2.0.x/pom.xml
===================================================================
--- branches/experimental/2.0.x/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,159 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org</groupId>
+	<artifactId>savara</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>pom</packaging>
+    <name>Savara</name>
+	<url>http://www.savara.org</url>
+	<description>
+		The SAVARA project
+	</description>
+	<scm>
+		<connection>scm:svn:https://svn.jboss.org/repos/savara</connection>
+	</scm>
+	<developers>
+		<developer>
+			<name>Jeff Yu</name>
+			<id>jeff.yuchang</id>
+			<email>cyu at redhat.com</email>
+			<organization>Red Hat</organization>
+			<roles>
+				<role>Developer</role>
+			</roles>
+			<timezone>+8</timezone>
+		</developer>
+		<developer>
+		    <name>Gary Brown</name>
+		    <id>objectiser</id>
+		    <email>gbrown at redhat.com</email>
+		    <organization>Red Hat</organization>
+		    <roles>
+		        <role>Developer</role>
+		    </roles>
+		    <timezone>+1</timezone>
+		</developer>
+	</developers>
+
+	<properties>
+		<savara.version>2.0.0-SNAPSHOT</savara.version>
+		<scribble.version>2.0.0.20101208-M2</scribble.version>
+		<pi4soa.version>3.1.0.Final</pi4soa.version>
+		<junit.version>4.4</junit.version>
+		<rosetta.version>4.7</rosetta.version>
+		<log4j.version>1.2.14</log4j.version>
+        <mvel.version>1.3.4-java1.5</mvel.version>
+        <jaxb.version>2.1</jaxb.version>
+    	<jboss.version>5.1.0.GA</jboss.version>
+    	<jbossws.version>3.2.2.GA</jbossws.version>
+	</properties>
+
+	<modules>
+		<module>validators</module>
+		<module>bundles</module>
+		<module>docs</module>
+		<module>distribution</module>
+	</modules>
+
+	<build>
+		<!-- This section defines the default plugin settings inherited by child projects. -->
+		<pluginManagement>
+			<plugins>
+				<!-- Fixes how test resources of a project can be used in projects dependent on it  -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-jar-plugin</artifactId>
+					<version>2.2</version>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-javadoc-plugin</artifactId>
+					<version>2.2</version>
+					<configuration>
+						<aggregate>true</aggregate>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+		<plugins>
+			<!-- Specify the compiler options and settings -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+					<showDeprecation>false</showDeprecation>
+					<showWarnings>false</showWarnings>
+				</configuration>
+			</plugin>
+			<!-- Produce source jars during the 'verify' phase -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>attach-sources</id>
+						<phase>verify</phase>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<includes>
+						<include>**/*TestCase.java</include>
+						<include>**/*Test.java</include>
+					</includes>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<reporting>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-report-plugin</artifactId>
+			</plugin>
+	    </plugins>
+	</reporting>
+	
+	<repositories>
+	    <repository>
+	        <id>jboss-public-repository-group</id>
+	        <name>JBoss Public Maven Repository Group</name>
+		<url>https://repository.jboss.org/nexus/content/groups/public/</url>
+		<releases>
+		  <enabled>true</enabled>
+		  <updatePolicy>never</updatePolicy>
+		</releases>
+		<snapshots>
+		  <enabled>true</enabled>
+		  <updatePolicy>never</updatePolicy>
+		</snapshots>
+	    </repository>
+	</repositories>
+
+  <!-- No need for distribution details as there are no artifacts to publish
+  <distributionManagement>
+    <repository>
+      <id>jboss-releases-repository</id>
+      <name>JBoss Releases Repository</name>
+      <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
+    </repository>
+    <snapshotRepository>
+      <id>jboss-snapshots-repository</id>
+      <name>JBoss Snapshots Repository</name>
+      <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
+    </snapshotRepository>
+  </distributionManagement>
+  -->
+  
+</project>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,489 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 11">
+<meta name=Originator content="Microsoft Word 11">
+<link rel=File-List
+href="JBoss%20ESB%20Loan%20Broker%20Banks%20Guide_files/filelist.xml">
+<title>BANKS FOR THE LOANBROKER DEMO</title>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="country-region"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="Street"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="address"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="place"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="City"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="State"/>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Author>kstam</o:Author>
+  <o:LastAuthor>kstam</o:LastAuthor>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>7</o:TotalTime>
+  <o:Created>2006-08-03T14:42:00Z</o:Created>
+  <o:LastSaved>2006-08-03T14:42:00Z</o:LastSaved>
+  <o:Pages>1</o:Pages>
+  <o:Words>743</o:Words>
+  <o:Characters>4237</o:Characters>
+  <o:Company>JBoss, Inc.</o:Company>
+  <o:Lines>35</o:Lines>
+  <o:Paragraphs>9</o:Paragraphs>
+  <o:CharactersWithSpaces>4971</o:CharactersWithSpaces>
+  <o:Version>11.6568</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:SpellingState>Clean</w:SpellingState>
+  <w:GrammarState>Clean</w:GrammarState>
+  <w:PunctuationKerning/>
+  <w:ValidateAgainstSchemas/>
+  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+  <w:Compatibility>
+   <w:BreakWrappedTables/>
+   <w:SnapToGridInCell/>
+   <w:WrapTextWithPunct/>
+   <w:UseAsianBreakRules/>
+   <w:DontGrowAutofit/>
+  </w:Compatibility>
+  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ </w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
+ </w:LatentStyles>
+</xml><![endif]--><!--[if !mso]><object
+ classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
+<style>
+st1\:*{behavior:url(#ieooui) }
+</style>
+<![endif]-->
+<style>
+<!--
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+h1
+	{mso-style-link:"Heading 1 Char";
+	mso-style-next:Normal;
+	margin-top:12.0pt;
+	margin-right:0in;
+	margin-bottom:3.0pt;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	page-break-after:avoid;
+	mso-outline-level:1;
+	font-size:16.0pt;
+	font-family:Arial;
+	mso-font-kerning:16.0pt;}
+h2
+	{mso-style-next:Normal;
+	margin-top:12.0pt;
+	margin-right:0in;
+	margin-bottom:3.0pt;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	page-break-after:avoid;
+	mso-outline-level:2;
+	font-size:14.0pt;
+	font-family:Arial;
+	font-style:italic;}
+h3
+	{mso-style-next:Normal;
+	margin-top:12.0pt;
+	margin-right:0in;
+	margin-bottom:3.0pt;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	page-break-after:avoid;
+	mso-outline-level:3;
+	font-size:13.0pt;
+	font-family:Arial;}
+a:link, span.MsoHyperlink
+	{color:blue;
+	text-decoration:underline;
+	text-underline:single;}
+a:visited, span.MsoHyperlinkFollowed
+	{color:purple;
+	text-decoration:underline;
+	text-underline:single;}
+span.Heading1Char
+	{mso-style-name:"Heading 1 Char";
+	mso-style-locked:yes;
+	mso-style-link:"Heading 1";
+	mso-ansi-font-size:16.0pt;
+	mso-bidi-font-size:16.0pt;
+	font-family:Arial;
+	mso-ascii-font-family:Arial;
+	mso-hansi-font-family:Arial;
+	mso-bidi-font-family:Arial;
+	mso-font-kerning:16.0pt;
+	mso-ansi-language:EN-US;
+	mso-fareast-language:EN-US;
+	mso-bidi-language:AR-SA;
+	font-weight:bold;}
+span.SpellE
+	{mso-style-name:"";
+	mso-spl-e:yes;}
+span.GramE
+	{mso-style-name:"";
+	mso-gram-e:yes;}
+ at page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Times New Roman";
+	mso-ansi-language:#0400;
+	mso-fareast-language:#0400;
+	mso-bidi-language:#0400;}
+</style>
+<![endif]-->
+</head>
+
+<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h1>JBoss ESB Loan Broker Banks Guide</h1>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal>By: Kurt Stam (<a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>)</p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal>JBoss ESB JBoss Labs Home Page: <a
+href="http://labs.jboss.com/portal/jbossesb">http://labs.jboss.com/portal/jbossesb</a></p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal>JBoss ESB Developer Community Forums: <a
+href="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=220">http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=220</a></p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal>########################################################################</p>
+
+<p class=MsoNormal># JBoss, Home of Professional Open Source</p>
+
+<p class=MsoNormal># Copyright 2006, JBoss Inc., and individual contributors as
+indicated</p>
+
+<p class=MsoNormal># <span class=GramE>by</span> the @authors tag. See the
+copyright.txt in the distribution for a</p>
+
+<p class=MsoNormal># <span class=GramE>full</span> listing of individual
+contributors.</p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>This</span> is free software; you can
+redistribute it and/or modify it</p>
+
+<p class=MsoNormal># <span class=GramE>under</span> the terms of the GNU Lesser
+General Public License as</p>
+
+<p class=MsoNormal># published by the Free Software Foundation; either version
+2.1 of</p>
+
+<p class=MsoNormal># <span class=GramE>the</span> License, or (at your option)
+any later version.</p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>This</span> software is distributed in
+the hope that it will be useful,</p>
+
+<p class=MsoNormal># <span class=GramE>but</span> WITHOUT ANY WARRANTY; without
+even the implied warranty of</p>
+
+<p class=MsoNormal><span class=GramE># MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.</span> See the GNU</p>
+
+<p class=MsoNormal><span class=GramE># Lesser General Public License for more
+details.</span></p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>You</span> should have received a copy
+of the GNU Lesser General Public</p>
+
+<p class=MsoNormal># License along with this software; if not, write to the
+Free</p>
+
+<p class=MsoNormal># Software Foundation, Inc., <st1:Street w:st="on"><st1:address
+ w:st="on">51 Franklin St</st1:address></st1:Street>, Fifth Floor, <st1:place
+w:st="on"><st1:City w:st="on">Boston</st1:City>, <st1:State w:st="on">MA</st1:State></st1:place></p>
+
+<p class=MsoNormal># 02110-1301 <st1:place w:st="on"><st1:country-region w:st="on">USA</st1:country-region></st1:place>,
+or see the FSF site: http://www.fsf.org.</p>
+
+<p class=MsoNormal>########################################################################</p>
+
+<p class=MsoNormal><b><span style='font-size:16.0pt;font-family:Arial;
+background:white;mso-highlight:white;mso-font-kerning:16.0pt'><o:p>&nbsp;</o:p></span></b></p>
+
+<p class=MsoNormal><b><span style='font-size:16.0pt;font-family:Arial;
+background:white;mso-highlight:white;mso-font-kerning:16.0pt'><o:p>&nbsp;</o:p></span></b></p>
+
+<b><span style='font-size:16.0pt;font-family:Arial;mso-fareast-font-family:
+"Times New Roman";background:white;mso-highlight:white;mso-font-kerning:16.0pt;
+mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA'><br
+clear=all style='page-break-before:always'>
+</span></b>
+
+<p class=MsoNormal><span class=Heading1Char><span style='font-size:16.0pt;
+background:white;mso-highlight:white'>1. Introduction</span></span><span
+class=Heading1Char><span style='font-size:16.0pt'><o:p></o:p></span></span></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>As part
+of the Loan Broker Demo, the broker goes out to a few banks to obtain loan
+quotes.</span></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>This
+folder contains two banks:</span></p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>1. <span
+class=GramE>a</span> Flat File Based Bank, and</span></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>2. <span
+class=GramE>a</span> JMS Based bank.</span></p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>To make
+the demo a little more interesting we have the banks use two different
+protocols (flat file and JMS), and two</span> <span style='background:white;
+mso-highlight:white'>different message formats (<span class=SpellE>csv</span>,
+xml). You can customize some of the configuration in the <span class=SpellE>bank.properties</span>
+file. Not that</span> <span style='background:white;mso-highlight:white'>the
+banks use to log4j.xml in the current directory. </span></p>
+
+<h2><span style='background:white;mso-highlight:white'>2. Flat File Based Bank</span></h2>
+
+<h3><span style='background:white;mso-highlight:white'>2.1 Starting the bank</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The Flat
+File Based Bank uses the property '<span class=SpellE>file.monitored.directory</span>'
+which by default is set to 'C<span class=GramE>:\</span>Temp\<span
+class=SpellE>BankInput</span>'.</span> <span style='background:white;
+mso-highlight:white'>You can start this bank by typing:</span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier New";background:
+white;mso-highlight:white'>ant</span></span><span style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'> <span
+class=SpellE>runFileBank</span></span><span style='font-size:10.0pt;font-family:
+"Courier New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'>* Not of caution, there is
+no filter set in the <span class=SpellE>poller</span> code, so it will pick up
+and try to move any files it finds.<o:p></o:p></span></p>
+
+<h3><span style='background:white;mso-highlight:white'>2.2 Processing details</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The <span
+class=SpellE>FlatFilePollManager</span> monitors a directory specified in the
+configuration. When a file arrives it</span> <span style='background:white;
+mso-highlight:white'>tries to process the content assuming it contains one line
+with loan request information.</span> <span style='background:white;mso-highlight:
+white'>So for example the content of the file could read something like </span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New";background:white;mso-highlight:
+white'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New";background:white;mso-highlight:
+white'>23456890<span class=GramE>,3,4,20000,5</span></span><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The order
+of values needs to be <span class=SpellE>SocialSecurityNumber</span>, <span
+class=SpellE>CreditScore</span>, <span class=SpellE>HistoryLength</span>
+[month], <span class=SpellE>LoanAmount</span> [dollar],</span> <span
+style='background:white;mso-highlight:white'>and finally the <span
+class=SpellE>LoanTerm</span> [month]. The request will be processed and a <span
+class=SpellE>BankQouteReply</span> is generated. The</span> <span
+style='background:white;mso-highlight:white'>original file is moved to a
+'processed' directory, and the <span class=SpellE>BankQuoteReply</span> is
+serialized to an 'outgoing' directory from <span class=GramE>the it</span> can
+be picked up by the system that dropped the request.</span></p>
+
+<h3><span style='background:white;mso-highlight:white'>2.3 Testing</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>You can
+test whether or not the bank is working by dropping a file in the monitored
+directory (C:\Temp\BankInput).Let's say we</span> <span style='background:white;
+mso-highlight:white'>use a file with name 'request.txt'. The file should be
+ASCII and can contain the following line:</span></p>
+
+<p class=MsoNormal><o:p>&nbsp;</o:p></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New";background:white;mso-highlight:
+white'>23456890<span class=GramE>,3,4,20000,5</span></span><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The file
+should get moved to the C:\Temp\BankInput\processed directory, and in the
+C:\Temp\ <span class=SpellE>BankInput</span>\outgoing directory a reply file
+should</span> <span style='background:white;mso-highlight:white'>appear with
+the name 'reply_to_request.txt'. It should contain the line:</span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New";background:white;mso-highlight:
+white'>8.29<span class=GramE>,FileBasedBank</span>-1,0</span><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal><span class=GramE><span style='background:white;mso-highlight:
+white'>which</span></span><span style='background:white;mso-highlight:white'>
+means the </span><span class=SpellE><span style='font-size:10.0pt;mso-bidi-font-size:
+12.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
+background:white;mso-highlight:white'>QuoteId</span></span><span
+style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:"Courier New";
+mso-bidi-font-family:"Times New Roman";background:white;mso-highlight:white'>=FileBasedBank-1</span><span
+style='background:white;mso-highlight:white'>, the </span><span
+style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:"Courier New";
+mso-bidi-font-family:"Times New Roman";background:white;mso-highlight:white'>interest=8.29</span><span
+style='background:white;mso-highlight:white'> and the </span><span
+class=SpellE><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
+font-family:"Courier New";mso-bidi-font-family:"Times New Roman";background:
+white;mso-highlight:white'>errorCode</span></span><span style='font-size:10.0pt;
+mso-bidi-font-size:12.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
+background:white;mso-highlight:white'>=0</span><span style='background:white;
+mso-highlight:white'> (which means success). You can check the logging for</span>
+<span style='background:white;mso-highlight:white'>additional details.</span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<h2><span style='background:white;mso-highlight:white'>3. JMS Based Bank</span></h2>
+
+<h3><span style='background:white;mso-highlight:white'>3.1 Starting the bank</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>Before
+starting the bank you need to bring up your JMS provider. For the example this
+is the JBoss AS. We are using</span> <span style='background:white;mso-highlight:
+white'>the default queues (C and D). The JMS bank uses the properties: <span
+class=SpellE>jms.provider.url</span>, <span class=SpellE>jms.queue.in</span>
+and <span class=SpellE>jms.queue.out</span>. By</span> <span style='background:
+white;mso-highlight:white'>default these are set to '<span class=SpellE>localhost</span>',
+'queue/C' and 'queue/D'. So, by default, it assumes <st1:place w:st="on"><st1:City
+ w:st="on">JBoss</st1:City> <st1:State w:st="on">AS</st1:State></st1:place> is
+running on the <span class=SpellE>localhost</span>.</span> <span
+style='background:white;mso-highlight:white'>Next you can start the JMS Based
+bank by typing:</span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier New";background:
+white;mso-highlight:white'>ant</span></span><span style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'> <span
+class=SpellE>runJMSBank</span></span><span style='font-size:10.0pt;font-family:
+"Courier New"'><o:p></o:p></span></p>
+
+<h3><span style='background:white;mso-highlight:white'>3.2 Processing details</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The <span
+class=SpellE>JMSManager</span> listens to an incoming queue (by default queue/C
+on <span class=SpellE>localhost</span>). It consumes the</span> <span
+style='background:white;mso-highlight:white'>message assuming it is a <span
+class=SpellE>TextMessage</span>, and that the text is an XML structure that can
+be marshaled</span> <span style='background:white;mso-highlight:white'>into a <span
+class=SpellE>BankQuoteRequest</span>. The request will be processed and a <span
+class=SpellE>BankQuote</span> Reply will be serialized to XML</span> <span
+style='background:white;mso-highlight:white'>and send to the outgoing queue (by
+default this is queue/D on <span class=SpellE>localhost</span>). If the
+processing results</span> <span style='background:white;mso-highlight:white'>in
+an error a <span class=SpellE>BankQuoteReply</span> with <span class=SpellE>ErrorCode</span>
+other then 0 is send to the outgoing queue.</span></p>
+
+<h3><span style='background:white;mso-highlight:white'>3.3 Testing</span></h3>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>The unit
+test <span class=SpellE>JMSProcessorTest</span> drops a <span class=SpellE>BankQuoteRequest</span>
+Message on the queue/C of <span class=SpellE>localhost</span>. You can use</span></p>
+
+<p class=MsoNormal><span class=GramE><span style='background:white;mso-highlight:
+white'>this</span></span><span style='background:white;mso-highlight:white'>
+test to check the health of the <span class=SpellE>JMSBank</span>. The tests
+can be executed by typing</span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier New";background:
+white;mso-highlight:white'>ant</span></span><span style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'> test</span><span
+style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
+
+<h1><span style='background:white;mso-highlight:white'>4. Finally</span></h1>
+
+<p class=MsoNormal><span style='background:white;mso-highlight:white'>You are
+now ready to run the larger Load Broker Demo itself.</span></p>
+
+</div>
+
+</body>
+
+</html>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.odt
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/build.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/build.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/build.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,134 @@
+<project name="BANKS" default="compile" basedir=".">
+
+	<property file="../trailblazer.properties"/>
+	<property name="install.dir" value="../../../../install"/>
+	<property file="${install.dir}/deployment.properties"/>
+	<property name="org.jboss.as.server" value="${org.jboss.as.home}/server/${org.jboss.as.config}" />
+        <property name="org.jboss.as.deploy.dir" value="${org.jboss.as.server}/deploy" />
+
+	<!-- Some default build locations -->
+	
+	<property name="org.jboss.esb.samples.loanbroker.banks.dest"             value="${basedir}/build"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.classes.dir"      value="${basedir}/build/classes/banks/"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.testclasses.dir"  value="${basedir}/build/classes/tests/"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.src.dir"          value="${basedir}/src"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.test.dir"         value="${basedir}/test"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.jar.dest"         value="${basedir}/build/dist/lib/"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.lib.ext.dir"      value="${basedir}/lib/ext"/>
+	<property name="org.jboss.esb.samples.loanbroker.banks.tests.report.dir" value="${basedir}/build/tests"/>
+		
+	<path id="org.jboss.esb.samples.loanbroker.banks.classpath">
+	   <fileset dir="${org.jboss.as.home}/client" includes="jboss-remoting.jar jboss-javaee.jar jboss-messaging-client.jar jboss-aop-client.jar jboss-mdr.jar" /> <!-- Required for JMS Client Code. -->
+	   <fileset dir="${org.jboss.as.server}/lib" includes="hibernate3.jar commons-collections.jar hsqldb.jar" /> <!-- Required for jbpm Client Code. -->
+	   <fileset dir="${org.jboss.as.server}/lib" includes="bsh.jar" /> <!-- Required for scripting Client Code. -->
+           <fileset dir="${org.jboss.as.home}/lib/endorsed" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+	   <!-- fileset dir="${org.jboss.as.deploy.dir}/jboss-aop-jdk50.deployer" includes="jboss-aop-jdk50.jar" / --> <!-- Required for JMS Client Code. -->
+	    <fileset dir="${org.jboss.esb.samples.loanbroker.banks.lib.ext.dir}" includes="*.jar"/>
+	</path>
+	<path id="org.jboss.esb.samples.loanbroker.banks.testclasspath">
+	   <fileset dir="${org.jboss.as.home}/client" includes="jboss-remoting.jar jboss-javaee.jar jboss-messaging-client.jar jboss-aop-client.jar jboss-mdr.jar" /> <!-- Required for JMS Client Code. -->
+           <fileset dir="${org.jboss.as.home}/lib/endorsed" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+	   <!-- fileset dir="${org.jboss.as.deploy.dir}/jboss-aop-jdk50.deployer" includes="jboss-aop-jdk50.jar" / --> <!-- Required for JMS Client Code. -->
+	    <fileset dir="${org.jboss.esb.samples.loanbroker.banks.lib.ext.dir}" includes="*.jar"/>
+	    <pathelement location="${org.jboss.esb.samples.loanbroker.banks.classes.dir}"/>
+		<pathelement location="${org.jboss.esb.samples.loanbroker.banks.testclasses.dir}"/>
+		<pathelement location="."/>
+	</path>
+	
+	<target name="clean">
+		<delete dir="${org.jboss.esb.samples.loanbroker.banks.dest}" />
+	</target>
+	<!-- =================================================================== -->
+	<!-- Prepares the directory structure                                    -->
+    <!-- =================================================================== -->
+    <target name="org.jboss.esb.samples.loanbroker.banks.prepare">
+    	<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}"/>
+    	<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/dist"/>
+		<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/classes/banks"/>
+    	<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/classes/tests"/>
+    	<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/tests"/>
+		<mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib"/>
+    </target>
+	
+	<!-- Compilation targets -->
+	<target name="org.jboss.esb.samples.loanbroker.banks.compile" depends="org.jboss.esb.samples.loanbroker.banks.prepare"
+		description="Compile all classes">
+
+		        <javac
+		            destdir="${org.jboss.esb.samples.loanbroker.banks.classes.dir}"
+		            classpathref="org.jboss.esb.samples.loanbroker.banks.classpath"
+		        	debug="true"
+		        	>
+		            <src path="${org.jboss.esb.samples.loanbroker.banks.src.dir}"/>
+		        </javac>
+				<javac
+		            destdir="${org.jboss.esb.samples.loanbroker.banks.testclasses.dir}"
+					debug="true"
+					classpathref="org.jboss.esb.samples.loanbroker.banks.testclasspath"
+		    		>
+		            <src path="${org.jboss.esb.samples.loanbroker.banks.test.dir}"/>
+		        </javac>
+	</target>
+
+    <!-- javadocs paths -->
+	<path id="org.jboss.esb.samples.loanbroker.banks.javadocs.path">
+		<pathelement path="esb/classes"/>
+	</path>
+
+	<!-- Jar targets -->
+	<target name="org.jboss.esb.samples.loanbroker.banks.jar" depends="org.jboss.esb.samples.loanbroker.banks.compile">
+		<echo message="Building jar file"/>
+		<delete file="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib/bank.jar" />
+        <jar    destfile="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib/bank.jar" 
+                basedir="${org.jboss.esb.samples.loanbroker.banks.classes.dir}" 
+                includes="**/*.class"
+                />
+	</target>
+	
+	<target name="runJMSBank" depends="org.jboss.esb.samples.loanbroker.banks.jar">
+		<echo>Running JMS Based Bank</echo>
+		<echo>Note that your app-server on host: localhost needs to be up and running!</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.loanbroker.banks.ManagerJMS" failonerror="true">
+			<arg value="${jms.provider.url}"/>
+			<arg value="${jms.queue.in}"/>
+		    <arg value="${jms.queue.out}"/>
+			<classpath refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+		</java>
+	</target>	
+	
+	<target name="runFileBank" depends="org.jboss.esb.samples.loanbroker.banks.jar">
+		<echo>Running File Based Bank</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.loanbroker.banks.ManagerFlatFile" failonerror="true" >
+			<classpath refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+			<arg value="${file.bank.monitored.dir}" />
+			<arg value="${file.output.directory}" />
+		</java>
+	</target>	
+	
+	<!-- Short target names -->
+	<target name="compile" depends="org.jboss.esb.samples.loanbroker.banks.compile"/>
+    <target name="test" depends="org.jboss.esb.samples.loanbroker.banks.test"/>
+    <target name="jar" depends="org.jboss.esb.samples.loanbroker.banks.jar"/>
+	
+    <!-- ====================================================================== -->
+    <!--         U N I T   T E S T S                                            -->
+    <!-- ====================================================================== -->
+    <target name="org.jboss.esb.samples.loanbroker.banks.test" depends="org.jboss.esb.samples.loanbroker.banks.compile">
+        <echo message="Running tests for banks"/>
+        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
+            <formatter type="plain" usefile="false"/>
+            <formatter type="xml"/>
+            <batchtest todir="${org.jboss.esb.samples.loanbroker.banks.tests.report.dir}">
+                <fileset dir="${org.jboss.esb.samples.loanbroker.banks.test.dir}">
+                    <include name="**/**Test.java"/>
+                </fileset>
+            </batchtest>
+            <classpath>
+            	<!-- Need the tests src folder because there may be non-compiled test resources -->
+                <pathelement location="${org.jboss.esb.samples.loanbroker.banks.test.dir}"/>
+                <path refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+            </classpath>
+        </junit>
+    </target>
+
+</project>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,445 @@
+The jars in this directory are covered by a range of licences, as described
+below.
+
+JBoss jars:
+
+/*
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ */
+   
+JUnit
+   
+   Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+    a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+    b) in the case of each subsequent Contributor:
+
+    i) changes to the Program, and
+
+    ii) additions to the Program;
+
+    where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+    c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire that license
+before distributing the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+    a) it complies with the terms and conditions of this Agreement; and
+
+    b) its license agreement:
+
+    i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+    ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+    iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+    iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange. 
+
+When the Program is made available in source code form:
+
+    a) it must be made available under this Agreement; and
+
+    b) a copy of this Agreement must be included with each copy of the Program. 
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
+
+
+XStream, Antlr, Stingtemplate BSD License
+
+Copyright (c) 2003-2005, Joe Walnes
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions and the following disclaimer. Redistributions in binary form must reproduce
+the above copyright notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the distribution.
+
+Neither the name of XStream nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+
+
+pollmgt.jar, org.sadun.util.jar
+
+GNU Lesser General Public License
+
+Version 2.1, February 1999
+
+    Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+    [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+    These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+    Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+    In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+    a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+
+    b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Libraries
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and an idea of what it does.> Copyright (C) <year> <name of author>
+
+    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful, but WITHOUT ANY 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 along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+    signature of Ty Coon, 1 April 1990
+    Ty Coon, President of Vice
+
+That's all there is to it!
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/jbossall-client.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/jbossall-client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/junit-4.1.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/junit-4.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/log4j.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/log4j.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/trove.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/trove.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/xstream-1.2.2.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/lib/ext/xstream-1.2.2.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/log4j.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/log4j.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/log4j.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A time/date based rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="File" value="./banks.log"/>
+      <param name="Append" value="false"/>
+
+      <!-- Rollover at midnight each day -->
+      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+      <!-- Rollover at the top of each hour
+      <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+      -->
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+         <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+          -->
+      </layout>
+   </appender>
+
+   <!-- A size based file rolling appender
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>	    
+   </appender>
+   -->
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ====================== -->
+   <!-- More Appender examples -->
+   <!-- ====================== -->
+
+   <!-- Buffer events and log them asynchronously
+   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <appender-ref ref="FILE"/>
+     <appender-ref ref="CONSOLE"/>
+     <appender-ref ref="SMTP"/>
+   </appender>
+   -->
+
+   <!-- EMail events to an administrator
+   <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="To" value="admin at myhost.domain.com"/>
+     <param name="From" value="nobody at myhost.domain.com"/>
+     <param name="Subject" value="JBoss Sever Errors"/>
+     <param name="SMTPHost" value="localhost"/>
+     <param name="BufferSize" value="10"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Syslog events
+   <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Facility" value="LOCAL7"/>
+     <param name="FacilityPrinting" value="true"/>
+     <param name="SyslogHost" value="localhost"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Log events to JMS (requires a topic to be created)
+   <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
+     <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
+   </appender>
+   -->
+
+   <!-- Log events through SNMP
+   <appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+     <param name="ManagementHost" value="127.0.0.1"/>
+     <param name="ManagementHostTrapListenPort" value="162"/>
+     <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+     <param name="LocalIPAddress" value="127.0.0.1"/>
+     <param name="LocalTrapSendPort" value="161"/>
+     <param name="GenericTrapType" value="6"/>
+     <param name="SpecificTrapType" value="12345678"/>
+     <param name="CommunityString" value="public"/>
+     <param name="ForwardStackTraceWithTrap" value="true"/>
+     <param name="Threshold" value="DEBUG"/>
+     <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
+     <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!--  Emit events as JMX notifications
+   <appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      
+      <param name="Threshold" value="WARN"/>
+      <param name="ObjectName" value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+      
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d %-5p [%c] %m"/>
+      </layout>
+   </appender>
+   -->
+   
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+   <category name="org.jgroups">
+      <priority value="WARN"/>
+   </category>
+
+   <!-- Limit jboss axis to INFO as its DEBUG is even more verbose -->
+   <category name="org.jboss.axis">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit JBoss categories
+   <category name="org.jboss">
+      <priority value="INFO"/>
+   </category>
+   -->
+   
+   <!-- Limit the JSR77 categories -->
+   <category name="org.jboss.management">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit JBoss webservice category
+   <category name="org.jboss.webservice">
+      <priority value="DEBUG"/>
+   </category>
+   -->
+
+   <!-- Decrease the priority threshold for the org.jboss.varia category
+   <category name="org.jboss.varia">
+     <priority value="DEBUG"/>
+   </category>
+   -->
+
+   <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]
+   <category name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   -->
+
+   <!--
+      | An example of enabling the custom TRACE level priority that is used
+      | by the JBoss internals to diagnose low level details. This example
+      | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+      | subpackages. This will produce A LOT of logging output.
+   <category name="org.jboss.system">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   <category name="org.jboss.ejb.plugins">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   -->
+  
+   <!--
+       | Logs these events to SNMP:
+           - server starts/stops
+           - cluster evolution (node death/startup)
+           - When an EJB archive is deployed (and associated verified messages)
+           - When an EAR archive is deployed
+      	 
+   <category name="org.jboss.system.server.Server">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+  
+   <category name="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+
+   <category name="org.jboss.deployment.MainDeployer">
+     <priority value="ERROR" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+   
+   <category name="org.jboss.ejb.EJBDeployer">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+   
+   <category name="org.jboss.deployment.EARDeployer">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+  
+   -->
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+   <!-- Clustering logging -->
+   <!-- Uncomment the following to redirect the org.jgroups and
+      org.jboss.ha categories to a cluster.log file.
+
+   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.home.dir}/log/cluster.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>
+   </appender>
+   <category name="org.jgroups">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   <category name="org.jboss.ha">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   -->
+
+</log4j:configuration>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,153 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.math.BigDecimal;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * This Bank is pretty well focussed on doing one thing, which is giving out loans. On the 
+ * reception of a BankQuoteRequest it will compute the interest rate it will return
+ * in the BankQuoteReply.
+ * 
+ * Each bank instance can be customized using the parameters bankName, RatePremium and MaxLoanTerm.
+ * 
+ * @author kstam
+ *
+ */
+public class Bank 
+{
+	private Logger logger = Logger.getLogger(this.getClass());
+	
+	private static final BigDecimal PRIME_RATE            = BigDecimal.valueOf(8.0);
+	private static final BigDecimal DEFAULT_RATE_PREMIUM  = BigDecimal.valueOf(0.5);
+	private static final int        DEFAULT_MAX_LOAN_TERM = 30;
+	private static final String     DEFAULT_BANK_NAME     = "DefaultBank";
+	private static int _quoteCounter                      = 0;
+	
+	//Default values for bank
+	private String bankName                               = DEFAULT_BANK_NAME;
+	private BigDecimal ratePremium                        = DEFAULT_RATE_PREMIUM;
+	private int maxLoanTerm                               = DEFAULT_MAX_LOAN_TERM;
+
+	/** 
+	 * The Bank's constructor.
+	 * 
+	 * @param bankName    - the name of the bank
+	 * @param ratePremium - the premium it charges for the loan
+	 * @param maxLoanTerm - the maximum loan term
+	 */
+	public Bank(String bankName, BigDecimal ratePremium, int maxLoanTerm) {
+		super();
+		if (bankName!=null) {
+			this.bankName=bankName;
+		}
+		if (ratePremium!=null) {
+			this.ratePremium=ratePremium;
+		}
+		if (maxLoanTerm > 0) {
+			this.maxLoanTerm=maxLoanTerm;
+		}
+	}
+	/**
+	 * The bank computes the interest rate based on configuration parameters of the bank and
+	 * the information in the {@link BankQuoteRequest.
+	 * @param bankQuoteRequest - the bank quote request containing requests parameters
+	 * @return bankQuoteReply  - the bank quote replay contaning the interest rate
+	 */
+	private BankQuoteReply computeBankQuoteReply(BankQuoteRequest bankQuoteRequest)
+	{
+		BankQuoteReply bankQuoteReply = new BankQuoteReply();
+		if (bankQuoteRequest.loanTerm <= maxLoanTerm) {
+			BigDecimal interestRate=BigDecimal.valueOf((bankQuoteRequest.loanTerm/12.0)/10.0);
+			interestRate=PRIME_RATE.add(ratePremium).add(interestRate);
+			bankQuoteReply.setInterestRate(interestRate.setScale(2, BigDecimal.ROUND_HALF_UP));
+			bankQuoteReply.setErrorCode(0);
+		} else {
+			bankQuoteReply.setInterestRate(BigDecimal.valueOf(0.00).setScale(2, BigDecimal.ROUND_HALF_UP));
+			bankQuoteReply.setErrorCode(1);
+		}
+		String quoteId=bankName + "-" + _quoteCounter++;
+		bankQuoteReply.setQuoteId(quoteId);
+		bankQuoteReply.setRef(bankQuoteRequest.getRef());
+		bankQuoteReply.setCustomerUID(bankQuoteRequest.getCustomerUID());
+		bankQuoteReply.setCustomerEmail(bankQuoteRequest.customerEmail);
+		return bankQuoteReply;
+	}
+	/**
+	 * Processes the Loan Quote request and returns the banks reply.
+	 * 
+	 * @param bankQuoteRequest - the bank quote request
+	 * @return bankQuoteReply  - the bank quote reply
+	 */
+	protected BankQuoteReply processMessage(BankQuoteRequest bankQuoteRequest)
+	{
+		logger.log(Level.INFO, "Bank '" + bankName + "' received a request for SSN=" 
+				+ bankQuoteRequest.getSsn()
+				+ " for $" + bankQuoteRequest.loanAmount 
+				+ " over " + bankQuoteRequest.loanTerm + " months.");
+		logger.log(Level.DEBUG, bankQuoteRequest);
+		
+		BankQuoteReply bankQuoteReply = computeBankQuoteReply(bankQuoteRequest);
+		logger.log(Level.INFO, "Bank '" + bankName + " offers SSN=" 
+				+ bankQuoteRequest.getSsn() + " " + bankQuoteReply);
+		
+		return bankQuoteReply;
+	}
+
+	protected BankQuoteRequest getQuoteFromXML(String xml) {
+		BankQuoteRequest quote = new BankQuoteRequest();
+		
+		try {
+			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+			fact.setNamespaceAware(true);
+			
+			java.io.InputStream xmlstr=
+				new java.io.ByteArrayInputStream(xml.getBytes());
+
+			DocumentBuilder builder=fact.newDocumentBuilder();
+			org.w3c.dom.Document doc=builder.parse(xmlstr);
+			
+			org.w3c.dom.Element tree = doc.getDocumentElement();
+			
+			quote.setSsn(Integer.parseInt(tree.getAttribute("ssn")));
+			quote.setRef(tree.getAttribute("ref"));
+			quote.setCreditScore(Integer.parseInt(tree.getAttribute("creditScore")));
+			quote.setHistoryLength(Integer.parseInt(tree.getAttribute("creditHistoryLen")));
+			quote.setLoanAmount(Integer.parseInt(tree.getAttribute("amount")));
+			quote.setLoanTerm(Integer.parseInt(tree.getAttribute("term")));
+			quote.setCustomerUID(tree.getAttribute("customerUID"));
+			quote.customerEmail=tree.getAttribute("customerEmail");
+			
+		} catch(Exception ex) {
+			logger.error(ex.getMessage(), ex);
+		}
+		
+		return quote;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,180 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+public class BankQuoteReply implements Serializable 
+{
+	private static final long serialVersionUID = 1L;
+	
+	private BigDecimal interestRate;
+	private String quoteId;
+	private String ref;
+	private int errorCode;
+	private String customerUID;
+	private String customerEmail;
+	private String customerSSN;
+	private String customerName;	
+	private String customerAddress;	
+	private String customerSalary;
+	private String loanAmount;
+	private String loanDuration;
+	
+	/**
+	 * Gets the SerialVersionUID.
+	 * @return serialVersionUID
+	 */
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+	/**
+	 * Gets the errorCode.
+	 * 	<li>0 - success
+	 *  <li>1 - loan term exceeds the maximum available loan term
+	 *  <li>2 - invalid SSN
+	 *  <li>3 - invalid credit score
+	 *  <li>4 - invalid credit history length
+	 *  <li>5 - invalid loan term
+	 *  <li>6 - invalid message
+	 *  <li>7 - invalid customerUID
+	 * @return errorCode
+	 */
+	public int getErrorCode() {
+		return errorCode;
+	}
+	/**
+	 * Sets the errorCode.
+	 *  <li>0 - success
+	 *  <li>1 - loan term exceeds the maximum available loan term
+	 *  <li>2 - invalid SSN
+	 *  <li>3 - invalid credit score
+	 *  <li>4 - invalid credit history length
+	 *  <li>5 - invalid loan term
+	 * @param errorCode
+	 */
+	public void setErrorCode(int errorCode) {
+		this.errorCode = errorCode;
+	}
+	/**
+	 * Gets the quoted interest rate.
+	 * @return interestRate
+	 */
+	public BigDecimal getInterestRate() {
+		return interestRate;
+	}
+	/**
+	 * Sets the quoted interest rate.
+	 * @param interestRate
+	 */
+	public void setInterestRate(BigDecimal interestRate) {
+		this.interestRate = interestRate;
+	}
+	/**
+	 * Gets the Quote ID.
+	 * @return quoteId
+	 */
+	public String getQuoteId() {
+		return quoteId;
+	}
+	/**
+	 * Sets the quoteId.
+	 * @param quoteId
+	 */
+	public void setQuoteId(String quoteId) {
+		this.quoteId = quoteId;
+	}
+	/**
+	 * Gets the ref.
+	 * @return ref
+	 */
+	public String getRef() {
+		return ref;
+	}
+	/**
+	 * Sets the ref.
+	 * @param ref
+	 */
+	public void setRef(String ref) {
+		this.ref = ref;
+	}
+	/**
+	 * Returns a human readable string representation of this object.
+	 * @return toString
+	 */
+	public String toString() {
+		return this.getClass().getSimpleName() + "=["
+			+ "interestRate=" + interestRate
+			+ ", quoteId=" + quoteId
+			+ ", errorCode=" + errorCode 
+			+ ", customerUID=" + customerUID + "]";
+	}
+	public String getCustomerUID() {
+		return customerUID;
+	}
+	public void setCustomerUID(String customerUID) {
+		this.customerUID = customerUID;
+	}
+	public String getCustomerAddress() {
+		return customerAddress;
+	}
+	public void setCustomerAddress(String customerAddress) {
+		this.customerAddress = customerAddress;
+	}
+	public String getCustomerEmail() {
+		return customerEmail;
+	}
+	public void setCustomerEmail(String customerEmail) {
+		this.customerEmail = customerEmail;
+	}
+	public String getCustomerName() {
+		return customerName;
+	}
+	public void setCustomerName(String customerName) {
+		this.customerName = customerName;
+	}
+	public String getCustomerSalary() {
+		return customerSalary;
+	}
+	public void setCustomerSalary(String customerSalary) {
+		this.customerSalary = customerSalary;
+	}
+	public String getCustomerSSN() {
+		return customerSSN;
+	}
+	public void setCustomerSSN(String customerSSN) {
+		this.customerSSN = customerSSN;
+	}
+	public String getLoanAmount() {
+		return loanAmount;
+	}
+	public void setLoanAmount(String loanAmount) {
+		this.loanAmount = loanAmount;
+	}
+	public String getLoanDuration() {
+		return loanDuration;
+	}
+	public void setLoanDuration(String loanDuration) {
+		this.loanDuration = loanDuration;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,149 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.Serializable;
+
+
+public class BankQuoteRequest implements Serializable 
+{
+	private static final long serialVersionUID = 1L;
+	public int ssn;
+	public String ref;
+	public int creditScore;
+	public int historyLength;
+	public int loanAmount;
+	public int loanTerm;
+	public String customerUID;
+	public String customerEmail;
+	public String customerSSN;
+	public String customerName;	
+	public String customerAddress;	
+	public String customerSalary;	
+	public String loanDuration;
+	
+	/**
+	 * Gets for the credit score.
+	 * @return credit score
+	 */
+	public int getCreditScore() {
+		return creditScore;
+	}
+	/**
+	 * Sets the credit score.
+	 * @param creditScore
+	 */
+	public void setCreditScore(int creditScore) {
+		this.creditScore = creditScore;
+	}
+	/**
+	 * Gets the credit history length (in months).
+	 * @return credit history length
+	 */
+	public int getHistoryLength() {
+		return historyLength;
+	}
+	/**
+	 * Sets the credit history length (in months).
+	 * @param historyLength
+	 */
+	public void setHistoryLength(int historyLength) {
+		this.historyLength = historyLength;
+	}
+	/**
+	 * Gets the requested loan amount (in dollar).
+	 * @return the loan amount
+	 */
+	public int getLoanAmount() {
+		return loanAmount;
+	}
+	/** 
+	 * Sets the loan amount.
+	 * @param loanAmount - the loan amount (in dollar).
+	 */
+	public void setLoanAmount(int loanAmount) {
+		this.loanAmount = loanAmount;
+	}
+	/**
+	 * Gets the duration of the loan, the term, (in months).
+	 * @return loanTerm
+	 */
+	public int getLoanTerm() {
+		return loanTerm;
+	}
+	/**
+	 * Sets the term (duration) of the loan (in months)
+	 * @param loanTerm
+	 */
+	public void setLoanTerm(int loanTerm) {
+		this.loanTerm = loanTerm;
+	}
+	/** 
+	 * Sets the Social Security Number (SSN).
+	 * @return ssn
+	 */
+	public int getSsn() {
+		return ssn;
+	}
+	/**
+	 * Sets the Social Security Number (SSN).
+	 * @param ssn
+	 */
+	public void setSsn(int ssn) {
+		this.ssn = ssn;
+	}
+	/**
+	 * Gets the ref.
+	 * @return ref
+	 */
+	public String getRef() {
+		return ref;
+	}
+	/**
+	 * Sets the ref.
+	 * @param ref
+	 */
+	public void setRef(String ref) {
+		this.ref = ref;
+	}
+	/**
+	 * Returns a human readable string representation of this object.
+	 * @return toString
+	 */
+	public String toString() {
+		return this.getClass().getSimpleName() + "=["
+			+ "ssn=" + ssn
+			+ "ref=" + ref
+		    + ", creditScore=" + creditScore
+			+ ", historyLength=" + historyLength
+			+ ", loanAmount=" + loanAmount
+			+ ", loanTerm=" + loanTerm
+			+ ", customerUID="+ customerUID + "]";	
+	}
+	
+	public String getCustomerUID() {
+		return customerUID;
+	}
+	public void setCustomerUID(String customerUID) {
+		this.customerUID = customerUID;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+/**
+ * Utility class for reading a file into a String and back.
+ * @author kstam
+ */
+public class FileUtil {
+    /**
+     * Read the file into a String.
+     * @param file - the file to be read
+     * @return String with the content of the file
+     * @throws IOException - when we can't read the file
+     */
+    public static String readTextFile(File file) throws IOException 
+    {
+        StringBuffer sb = new StringBuffer(1024);
+        BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
+        char[] chars = new char[1];
+        while( (reader.read(chars)) > -1){
+            sb.append(String.valueOf(chars)); 
+            chars = new char[1];
+        }
+        reader.close();
+        return sb.toString();
+    }
+    /**
+     * Write a String into a file.
+     * @param file - File to which we write the String
+     * @param str - string which will be written
+     * @throws IOException - when we can't write to the file
+     */
+    public static void writeTextFile(File file, String str) throws IOException 
+    {
+        BufferedWriter writer = new BufferedWriter(new FileWriter(file.getPath()));
+        writer.write(str);
+        writer.close();
+    }
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.File;
+import java.math.BigDecimal;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.sadun.util.polling.BasePollManager;
+import org.sadun.util.polling.CycleEndEvent;
+import org.sadun.util.polling.CycleStartEvent;
+import org.sadun.util.polling.DirectoryLookupEndEvent;
+import org.sadun.util.polling.DirectoryLookupStartEvent;
+import org.sadun.util.polling.DirectoryPoller;
+import org.sadun.util.polling.FileFoundEvent;
+import org.sadun.util.polling.FileSetFoundEvent;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+/**
+ * The FlatFilePollManager monitors a directory specified in the configuration. When a file arrives it
+ * tries to process the content assuming it contains one line with loan request information.
+ * So for example the content of the file could read some like <br>23456890,3,4,20000,5<br>
+ * The order of values needs to be SocialSecurityNumber, CreditScore, HistoryLength [month], LoanAmount [dollar],
+ * and finally the LoanTerm [month]. The request will be processed and a BankQouteReply is generated. The
+ * original file is moved to a 'processed' directory, and the BankQuoteReply is serialized to an 'outgoing' 
+ * directory from the it can be picked up by the system that dropped the request.
+ * 
+ * @author kstam
+ *
+ */
+class ManagerFlatFile extends BasePollManager 
+{
+	private Logger logger = Logger.getLogger(this.getClass());
+	
+	private static final String BANK_NAME        = "FileBasedBank";
+	private static final BigDecimal RATE_PREMIUM = BigDecimal.valueOf(0.25);
+	private static final int MAXLOANTERM         = 120;
+	private static final String QUOTE_SUFFIX 	 = "quote";
+	private String m_outputDir=null;
+	
+	public ManagerFlatFile(String outputDir) {
+		m_outputDir = outputDir;
+	}
+	
+	/**
+	 * Handle to the cycle start event.
+	 */
+	public void cycleStarted(CycleStartEvent evt) {
+		logger.log(Level.DEBUG, "Poller awakened "
+				+ (evt.getPoller().getFilter() == null ? "(no filtering)" : evt
+						.getPoller().getFilter().toString()));
+	}
+	/**
+	 * Handle to the cycle end event.
+	 */
+	public void cycleEnded(CycleEndEvent evt) {
+		logger.log(Level.DEBUG, "Poller going to sleep");
+	}
+	/**
+	 * Handle to the directory lookup start event.
+	 */
+	public void directoryLookupStarted(DirectoryLookupStartEvent evt) {
+		logger.log(Level.DEBUG, "Scanning " + evt.getDirectory());
+	}
+	/**
+	 * Handle to the directory lookup end event.
+	 */
+	public void directoryLookupEnded(DirectoryLookupEndEvent evt) {
+		logger.log(Level.DEBUG, "Finished scanning " + evt.getDirectory());
+	}
+	/**
+	 * Handle to the file set found event. Currenty this is the only event that
+	 * is actually used to proces the incoming loan quote requests. Each file
+	 * is send to be processed.
+	 */
+	public void fileSetFound(FileSetFoundEvent evt) {
+		File[] files = evt.getFiles();
+		
+		for (int i = 0; i < files.length; i++) {
+			File file = files[i];
+			processFile(file);
+		}
+	}
+	/**
+	 * Handle to the file found event.
+	 */
+	public void fileFound(FileFoundEvent evt) {
+		logger.log(Level.DEBUG, evt);
+		// Add artificial delay
+	}
+	/**
+	 * Returns the name of this PollManager and a quick summary of what it does.
+	 */
+	public String toString() {
+		return "FlatFilePollManager - a pollmanager which processed incoming -flat file based- loan requests";
+	}
+	/**
+	 * Each file is processed assuming it contains one line with loan request information.
+	 * So for example the content of the file could read some like <br>23456890,3,4,20000,5<br>
+	 * The order of values needs to be SocialSecurityNumber, CreditScore, HistoryLength [month], LoanAmount [dollar],
+	 * and finally the LoanTerm [month]. The BankQuoteRequest is processed and a BankQouteReply is generated. The
+	 * original file is moved to a processed directory, and the BankQuoteReply is serialized to an 'outgoing' 
+	 * directory from the it can be picked up by the system that dropped the request.
+	 * 
+	 * @param file - incoming flat file with loan quote request info.
+	 */
+	protected void processFile(File file) 
+	{
+		BankQuoteReply bankQuoteReply=new BankQuoteReply();
+		bankQuoteReply.setQuoteId(BANK_NAME);
+		int errorCode=7;
+		String message=null;
+		logger.log(Level.INFO, "Found " + file.getAbsolutePath() );
+		
+		try {
+            //Read the content of the file into a String
+			message=FileUtil.readTextFile(file);
+			
+			Bank fileBasedBank = new Bank(BANK_NAME, RATE_PREMIUM, MAXLOANTERM);
+			
+			BankQuoteRequest bankQuoteRequest = fileBasedBank.getQuoteFromXML(message);
+	      
+			bankQuoteReply = fileBasedBank.processMessage(bankQuoteRequest);	
+		} catch (Throwable e) {
+			//Package up the error, so it can be processed
+			logger.log(Level.ERROR, e.getMessage());
+			bankQuoteReply.setErrorCode(errorCode);
+		}
+		
+		try {
+			//Create the outgoing response file
+			File outgoingDir  = new File(m_outputDir);
+			if (!outgoingDir.exists()) {
+				outgoingDir.mkdir();
+			}
+			File outgoingFile = new File(outgoingDir + "/" + file.getName()+"."+QUOTE_SUFFIX);
+			
+			logger.log(Level.INFO, "Creating outgoing file " + outgoingFile.getAbsolutePath());
+			outgoingFile.createNewFile();
+			
+			XStream xstream = new XStream(new DomDriver());
+			xstream.alias("quote", BankQuoteReply.class);
+			
+			String reply = xstream.toXML(bankQuoteReply);
+						
+			logger.log(Level.INFO, "Writing reply " + reply);
+			FileUtil.writeTextFile(outgoingFile, reply);
+
+			// Delete file
+			file.delete();
+			
+		} catch (Exception e) {
+			logger.log(Level.ERROR, e.getMessage(), e);
+		}
+	}
+	
+	public static void main(String[] args)
+	{
+		DOMConfigurator.configure("log4j.xml");
+		String monitoredDir = "C:/tmp/input";
+		String outputDir = "C:/tmp/output";
+		if (args!=null && args.length > 0) {
+			monitoredDir=args[0];
+			if (args.length > 1) {
+				outputDir=args[1];
+			}
+		}
+System.out.println("MONITOR="+monitoredDir+" OUTPUT="+outputDir);		
+		File monitoredDirectory = new File(monitoredDir);
+		if (!monitoredDirectory.exists() || !monitoredDirectory.isDirectory()){
+			System.err.println("Invalid directory " + monitoredDirectory.getAbsolutePath());
+			System.out.println("Trying to create the directory.");
+			try {
+				monitoredDirectory.mkdir();
+			} catch (SecurityException e) {
+				e.printStackTrace();
+			}
+		}
+		DirectoryPoller poller = new DirectoryPoller(monitoredDirectory);
+		poller.addPollManager(new ManagerFlatFile(outputDir));
+		poller.start();
+	}
+	
+
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,276 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.math.BigDecimal;
+import java.util.Properties;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.xml.DOMConfigurator;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * The JMS Manager listens to an incoming queue (by default queue/A on localhost). It consumes the
+ * message assuming it is a TextMessage, and that the text is an XML structure that can be marshalled
+ * into a BankQuoteRequest. The request will be processed and a BankQuoteRequest Reply will be serialized to XML
+ * and send to the outgoing queue (by default this is queue/B on localhost).
+ * 
+ * @author kstam
+ */
+public class ManagerJMS implements javax.jms.MessageListener, ExceptionListener {
+	private static Logger logger = Logger.getLogger(ManagerJMS.class);
+	/** Name of the Bank */
+	private static final String BANK_NAME = "JMSBasedBank";
+	/** Rate premium the bank charges */
+	private static final BigDecimal RATE_PREMIUM = BigDecimal.valueOf(0.50);
+	/** Maximum duration of the loan the bank will accept [months] */
+	private static final int MAXLOANTERM = 120;
+	/** Default incoming queue */
+	private static String QUEUE_IN = "queue/C";
+	/** Default outgoing queue */
+	private static String QUEUE_OUT = "queue/D";
+	/** Properties used when constructing the InitialContext */
+	private static Properties properties = new Properties();
+	/** Queue connection for incoming queue */
+	private QueueConnection inQueueConnection;
+        
+        /**
+         * The minimum error delay.
+         */
+        private static final long MIN_ERROR_DELAY = 1000 ;
+        /**
+         * The maximum error delay.
+         */
+        private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
+        /**
+         * The error delay.
+         */
+        private long errorDelay ;
+
+
+	/**
+	 * Sets up the queue listener. By default is listenes to queue/A on localhost.
+	 */
+	public void listen() throws NamingException, JMSException {
+			//MQ Series
+			//properties.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
+			//properties.put(Context.PROVIDER_URL           , "dev38:1415/SYSTEM.DEF.SVRCONN");
+			//ActiveMQ
+			//properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+			//properties.put(Context.PROVIDER_URL           , "tcp://localhost:61616");
+			//JBossMQ
+            /** Context used to lookup the Queues */
+            InitialContext ctx = getContext();
+                try {
+			logger.info("Looking up connection factory");
+			QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
+					.lookup("ConnectionFactory");
+			logger.info("Creating connection");
+			inQueueConnection = qcf.createQueueConnection();
+			logger.info("Creating session");
+			QueueSession qs = inQueueConnection.createQueueSession(false,
+					Session.DUPS_OK_ACKNOWLEDGE);
+			logger.info("Looking up queue=" + QUEUE_IN);
+			Queue inQueue=null;
+			try {
+				inQueue = (Queue) ctx.lookup(QUEUE_IN);
+			} catch (NamingException ne) {
+				inQueue = qs.createQueue(QUEUE_IN);
+			}
+			//Queue 
+			QueueReceiver qr = qs.createReceiver(inQueue);
+			qr.setMessageListener(this);
+                        inQueueConnection.setExceptionListener(this);
+			inQueueConnection.start();
+                } finally {
+                        ctx.close();
+		}
+	}
+
+    private InitialContext getContext() throws NamingException {
+        InitialContext ctx;
+        properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+        properties.put(Context.PROVIDER_URL           , "localhost");
+        ctx = new InitialContext(properties);
+        return ctx;
+    }
+
+    /**
+	 * Sets up the queue listener. By default is listenes to queue/A on localhost.  It consumes the
+	 * message assuming it is a TextMessage, and that the text is an XML structure that can be marshalled
+	 * into a BankQuoteRequest. The request will be processed and a BankQuoteRequest Reply will be serialized to XML
+	 * and send to the outgoing queue (by default this is queue/B on localhost). If the processing results
+	 * in an error a BankQuoteReply with ErrorCode other then 0 is send to the outgoing queue.
+	 * 
+	 * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
+	 * changed this to use a CSV from the request, left the reply as is - dbrum
+	 */
+	public void onMessage(Message message) {
+		QueueConnection outQueueConnection;
+		logger.info("Got message: " + message);
+		try {
+			TextMessage textMessage = (TextMessage) message;
+			String xml = textMessage.getText();
+
+			Bank bank = new Bank(BANK_NAME, RATE_PREMIUM, MAXLOANTERM);
+
+			BankQuoteRequest bankQuoteRequest = bank.getQuoteFromXML(xml);
+			           
+			BankQuoteReply bankQuoteReply = bank
+					.processMessage(bankQuoteRequest);
+			
+			XStream xstream = new XStream(new DomDriver());
+			xstream.alias("quote", BankQuoteReply.class);
+			
+			String bankQuoteReplyXML = xstream.toXML(bankQuoteReply);
+			
+			logger.log(Level.INFO, "Looking up connection factory");
+            InitialContext ctx = getContext();
+			QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
+					.lookup("ConnectionFactory");
+			
+			logger.log(Level.INFO, "Creating connection");
+			outQueueConnection = qcf.createQueueConnection();
+			try {
+				logger.log(Level.INFO, "Creating session");
+				QueueSession qs = outQueueConnection.createQueueSession(false,
+						Session.DUPS_OK_ACKNOWLEDGE);
+				Queue outQueue;
+				try {
+					outQueue = (Queue) ctx.lookup(QUEUE_OUT);
+				} catch (NamingException ne) {
+					outQueue = qs.createQueue(QUEUE_OUT);
+				}
+				TextMessage responseTextMessage = qs.createTextMessage(bankQuoteReplyXML);
+
+				QueueSender queueSender = qs.createSender(outQueue);
+
+				queueSender.send(responseTextMessage);
+				logger.info("message being sent back on " + QUEUE_OUT + "\n" + responseTextMessage);
+				System.out.println("message being sent back on " + QUEUE_OUT + "\n" + responseTextMessage);
+			} catch (JMSException je) {
+				logger.log(Level.ERROR, je.getMessage(), je);
+			} finally {
+				outQueueConnection.close();
+			}
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+	}
+        
+        /**
+         * Handle an asynchronous exception.
+         * @param jmsException The asynchronous exception
+         */
+        public void onException(final JMSException jmsException) {
+            errorDelay = MIN_ERROR_DELAY ;
+            logger.warn("JMS Connection lost, attempting to reconnect") ;
+            
+            while(true)
+            {
+                try {
+                    close() ;
+                } catch (final Exception ex) {} // ignore
+                
+                try {
+                    listen() ;
+                    logger.warn("Established connection, continuing with processing") ;
+                    break ;
+                } catch (final Exception ex) {} // ignore
+                
+                logger.warn("Error establishing connection, backing off for " + errorDelay + " milliseconds") ;
+                
+                try {
+                    Thread.sleep(errorDelay) ;
+                } catch (final InterruptedException ie) {} // ignore
+                
+                if (errorDelay < MAX_ERROR_DELAY)
+                {
+                    errorDelay <<= 1 ;
+                }
+            }
+                
+            
+        }
+        
+	/** 
+	 * Closing the queue connection as to not leak connection resources.
+	 */
+	public void close() throws JMSException {
+                if (inQueueConnection != null) {
+                    inQueueConnection.close();
+                    inQueueConnection = null ;
+                }
+	}
+	/**
+	 * Invokes an instance of JMS based bank listener.
+	 * @param args - provider url, queue_in, queue_out
+	 */
+	public static void main(String[] args) {
+		if (args != null && args.length > 0) {
+			if (args.length > 0) {
+				QUEUE_IN = args[1];
+				if (args.length > 1) {
+					QUEUE_OUT = args[2];
+				}
+			}
+		} else {
+			System.out.println(
+					"Usage: ManagerJMS providerURL, queueIn, queueOut");
+		}
+		System.out.println("Starting JMS Bank Listener...");
+		System.out.println("Listening  to Queue '" + QUEUE_IN + "'.");
+		System.out.println("Responding to Queue '" + QUEUE_OUT + "'.");
+		DOMConfigurator.configure("log4j.xml");
+		ManagerJMS managerJMS = new ManagerJMS();
+                try {
+                    managerJMS.listen();
+
+		    synchronized(managerJMS) {
+			managerJMS.wait();
+		    }
+                } catch (final Exception ex) {
+                    logger.error(ex.getMessage(), ex) ;
+                }
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import com.thoughtworks.xstream.XStream;
+
+public class BankQuoteReplyTest {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+	
+	/**
+	 * Testing the XML layout of a BankQuoteReply
+	 */
+	@Test public void obtainExampleXML(){
+		BankQuoteReply bankQuoteReply = new BankQuoteReply();
+		bankQuoteReply.setErrorCode(0);
+		bankQuoteReply.setCustomerUID("unique");
+		bankQuoteReply.setInterestRate(BigDecimal.valueOf(11.7));
+		bankQuoteReply.setQuoteId("JBBANK_1");
+		
+		XStream xstream = new XStream();
+		String bankQuoteReplyXml=xstream.toXML(bankQuoteReply);
+		logger.info("xml=\n" + bankQuoteReplyXml);
+		String expectedXml = 
+			  "<org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteReply>\n"
+			+ "  <interestRate>11.7</interestRate>\n"
+            + "  <quoteId>JBBANK_1</quoteId>\n"
+            + "  <errorCode>0</errorCode>\n"
+            + "  <customerUID>unique</customerUID>\n"
+            + "</org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteReply>";
+		assertTrue(expectedXml.equals(bankQuoteReplyXml));
+	}
+	
+	public static junit.framework.Test suite() {
+        return new JUnit4TestAdapter(BankQuoteReplyTest.class);
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import com.thoughtworks.xstream.XStream;
+
+public class BankQuoteRequestTest {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+	
+	/**
+	 * Testing the XML layout of a BankQuoteRequest
+	 */
+	@Test public void obtainExampleXML(){
+		BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+		bankQuoteRequest.setSsn(123456890);
+		bankQuoteRequest.setCreditScore(3);
+		bankQuoteRequest.setHistoryLength(4);
+		bankQuoteRequest.setLoanTerm(5);
+		bankQuoteRequest.setLoanAmount(20000);
+		bankQuoteRequest.setCustomerUID("unique");
+		
+		XStream xstream = new XStream();
+		String bankQuoteRequestXml=xstream.toXML(bankQuoteRequest);
+		logger.info("xml=\n" + bankQuoteRequestXml);
+		String expectedXml = 
+			  "<org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>\n"
+			+ "  <ssn>123456890</ssn>\n"
+			+ "  <creditScore>3</creditScore>\n"
+			+ "  <historyLength>4</historyLength>\n"
+			+ "  <loanAmount>20000</loanAmount>\n"
+			+ "  <loanTerm>5</loanTerm>\n"
+		    + "  <customerUID>unique</customerUID>\n"
+			+ "</org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>";
+		assertTrue(expectedXml.equals(bankQuoteRequestXml));
+	}
+	
+	public static junit.framework.Test suite() {
+        return new JUnit4TestAdapter(BankQuoteRequestTest.class);
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class BankTest {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+	
+	/**
+	 * Tests the computation of the interestRate for the TestBank.
+	 *
+	 */
+	@Test public void processLoanRequest(){
+		
+		//Building a BankQuoteRequest
+		BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+		bankQuoteRequest.setSsn(123456890);
+		bankQuoteRequest.setCreditScore(3);
+		bankQuoteRequest.setHistoryLength(4);
+		bankQuoteRequest.setLoanTerm(72);
+		bankQuoteRequest.setLoanAmount(20000);
+		bankQuoteRequest.setCustomerUID("unique");
+		logger.log(Level.INFO, bankQuoteRequest);
+		
+		//Getting a Bank Instance
+		String bankName        = "TestBank";
+		BigDecimal ratePrimium = BigDecimal.valueOf(0.25);
+		int maxLoanTerm        = 120;
+		Bank bank = new Bank(bankName, ratePrimium, maxLoanTerm);
+		
+		//Getting a quote from this bank
+		BankQuoteReply bankQuoteReply = bank.processMessage(bankQuoteRequest);
+		logger.log(Level.INFO, bankQuoteReply);
+		
+		//Checking for validity
+		BigDecimal expectedInterestRate = BigDecimal.valueOf(8.85);
+		assertTrue(bankQuoteReply.getInterestRate().equals(expectedInterestRate));
+	}
+	
+	public static junit.framework.Test suite() {
+        return new JUnit4TestAdapter(BankTest.class);
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class FlatFileProcessorTest {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+	private static String FLAT_FILE = "FlatFileProcessorTest.txt";
+	/**
+	 * Tests the processing of flat file containing a loan quote request. First
+	 * we try to find a temporary directory. When this succeeds we drop a
+	 * loan request file in there and try to process it.
+	 *
+	 */
+	@Test public void processRequest()
+	{
+		File writableDir=null;
+		logger.log(Level.INFO, "Check to see if I can write to /tmp");
+		File tmpDir = new File("/tmp");
+		if (tmpDir.exists() && tmpDir.canWrite()) {
+			writableDir=tmpDir;
+		} else {
+			File tempDir = new File("C:/temp");
+			if (tempDir.exists() && tempDir.canWrite()) {
+				writableDir=tempDir;
+			} else {
+				logger.log(Level.ERROR, "Could not find either /tmp or C:\\Temp for a temporary " 
+						+ "writing space.");
+			    assertTrue(false);
+			}
+		}
+//		We found a temp space so now we can drop in a load request file.
+		try {
+			logger.log(Level.INFO, "Creating " + FLAT_FILE + " file in " + writableDir.getAbsolutePath());
+			File loanRequestFile = new File(writableDir.getAbsolutePath() + "/"+ FLAT_FILE);
+			if (loanRequestFile.exists()) {
+				loanRequestFile.delete();
+			}
+			loanRequestFile.createNewFile();
+			String str="23456890,3,4,20000,5,unique";
+			FileUtil.writeTextFile(loanRequestFile, str);
+			
+			logger.log(Level.INFO, "Processing FlatFileProcessorTest.txt");
+			ManagerFlatFile pollManager = new ManagerFlatFile(null);
+			pollManager.processFile(loanRequestFile);
+			
+			//Check to see if the file is now moved.
+			assertFalse(loanRequestFile.exists());
+			
+			File replyToFile = null;//new File(writableDir.getAbsolutePath() + "/" 
+			//	+ ManagerFlatFile.OUTGOING_DIR + "/" + ManagerFlatFile.PREFIX
+			//	+ FLAT_FILE);
+			logger.log(Level.INFO, "Check to see if " + replyToFile.getAbsolutePath()
+					+ " exists");
+			assertTrue(replyToFile.exists());
+			logger.log(Level.INFO, "OK");
+			
+			//Checking the content of the reply
+			logger.log(Level.INFO, "Check the reply, should be ('8.29,FileBasedBank-0,0,unique'");
+			assertTrue("8.29,FileBasedBank-0,0,unique".equals(FileUtil.readTextFile(replyToFile)));
+			logger.log(Level.INFO, "OK");
+			//Cleaning up
+			replyToFile.delete();
+			
+		} catch (Throwable e) {
+			logger.log(Level.ERROR,e.getMessage(),e);
+			assertTrue(false);
+		}
+	}
+	
+	public static junit.framework.Test suite() {
+        return new JUnit4TestAdapter(FlatFileProcessorTest.class);
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.Properties;
+
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class JmsProcessorTest {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+
+	/**
+	 * This can be activate if the server is running and you want
+	 * to drop a message on the queue
+	 *
+	 */
+	@Test public void sendLoanRequestXML()
+	{
+
+		QueueSession sess;
+		Queue queue;
+		try {
+			Properties properties = new Properties();
+			
+			//ActiveMQ
+			//properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+		    //properties.put(Context.PROVIDER_URL           , "tcp://localhost:61616");
+			//JBossMQ
+		    properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+		    properties.put(Context.PROVIDER_URL           , "localhost");
+			InitialContext ctx = new InitialContext(properties);
+		
+			QueueConnectionFactory factory = (QueueConnectionFactory) ctx
+					.lookup("ConnectionFactory");
+			QueueConnection cnn = factory.createQueueConnection();
+			sess = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+			queue = sess.createQueue("queue/C");
+			//queue = sess.createQueue("queue/C");
+			String str="23456890,3,4,20000,5,unique,kurt.stam at jboss.com";
+			TextMessage msg = sess.createTextMessage(str);
+			QueueSender sender = sess.createSender(queue);
+			sender.send(msg);
+            ctx.close();
+			//if the test gets here without errors it passes.
+			assertTrue(true);
+		} catch (Exception e) {
+			//if it fails it may be because the server is not up and the Queue is not found
+			//I'm not letting the test fail, since we may want to do nightly build/test runs
+			//which may not have the server up.
+			logger.log(Level.ERROR, e.getMessage(), e);
+			logger.log(Level.ERROR, "Is the server up and running?");
+		}
+	}
+
+	public static junit.framework.Test suite() {
+        return new JUnit4TestAdapter(JmsProcessorTest.class);
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/build.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/build.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/build.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,268 @@
+<project name="TRAILBLAZER" default="war" basedir=".">	
+
+	<!-- UPDATE THIS WITH YOUR JBOSS_HOME AND SERVER -->
+	<property name="trailblazer.dir" location="."/>
+	<property name="install.dir" value="../../../install"/>
+	<property file="${install.dir}/deployment.properties"/>
+
+    <property name="esb.home.dir" value="${org.jboss.esb.home}"/>
+	<property name="org.jboss.as.home" value="${org.jboss.as.home}"/>
+	<property name="org.jboss.as.config" value="${org.jboss.as.config}"/>
+
+	<!-- properties for the esb part of the trailblazer -->
+	<property name="esb.dest"     	value="${basedir}/esb/build"/>
+	<property name="classes.dir" 	value="${basedir}/esb/build/classes"/>
+	<property name="esb.testclasses.dir"  value="${basedir}/esb/build/classes/tests/"/>
+	<property name="esb.src.dir"    value="${basedir}/esb/src"/>
+	<property name="esb.test.dir"   value="${basedir}/esb/test"/>
+	<property name="esb.lib.dir"   	value="${basedir}/esb/lib"/>
+	<property name="report.dir" 	value="${basedir}/esb/build/tests"/>
+
+	<!-- properties for the client(web) part of the trailblazer -->
+	<property name="client.dir" value="${basedir}/client"/>
+	<property name="esb.samples.trailblazer.client.dest" 
+		value="${basedir}/client/build"/>
+	<property name="esb.samples.trailblazer.client.classes.dir" 
+		value="${basedir}/client/build/classes"/>
+	<property name="esb.samples.trailblazer.client.testclasses.dir" 
+		value="${basedir}/client/build/classes/tests/"/>
+	<property name="esb.samples.trailblazer.client.src.dir" 
+		value="${basedir}/client/src"/>
+	<property name="esb.samples.trailblazer.client.test.dir" 
+		value="${basedir}/client/test"/>
+	<property name="esb.samples.trailblazer.client.lib.dir"	
+		value="${basedir}/client/lib"/>
+	<property name="esb.samples.trailblazer.client.tests.report.dir"
+		value="${basedir}/client/build/tests"/>
+
+	<property environment="env" />
+
+	<property name="esb.lib.file" value="jbossesb-rosetta.jar"/>
+	<property name="soa.esb.lib.dist.dir" value="${esb.home.dir}/lib"/>
+	<property name="soa.esb.lib.src.dir" value="../../build/jbossesb/lib"/>
+
+	<available file="${esb.lib.file}"
+            filepath="${soa.esb.lib.dist.dir}"
+            property="soa.esb.lib.dir"
+            value="${soa.esb.lib.dist.dir}"/>
+
+	<available file="${esb.lib.file}"
+            filepath="${soa.esb.lib.src.dir}"
+            property="soa.esb.lib.dir"
+            value="${soa.esb.lib.src.dir}"/>
+
+	<property name="soa.esb.lib.ext.dir" value="${soa.esb.lib.dir}/ext"/>
+	
+	<property name="target-server" value="${org.jboss.as.home}/server/${org.jboss.as.config}" />
+	
+	<!-- classpath -->
+	<path id="esb.samples.trailblazer.esb.classpath">
+		<fileset dir="${soa.esb.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${org.jboss.as.home}/client" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+		<fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+		<fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext" includes="*.jar"/>
+	</path>
+
+	<!-- classpath for running the listener-->
+	<path id="esb.samples.trailblazer.esb.classpath.run">
+		<fileset dir="${soa.esb.lib.ext.dir}"
+			includes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+		<fileset dir="${esb.dest}/dist" includes="trailblazer-esb.jar"/>
+		<fileset dir="${esb.home.dir}/lib/ext" includes="*.jar" excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+		<fileset dir="${soa.esb.lib.ext.dir}" includes="*.jar" excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+		<fileset dir="${org.jboss.as.home}/client" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+		<fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+		<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+		<!-- for finding the jbossesb-properties.xml file -->
+		<pathelement location="${basedir}"/>
+	</path>
+
+	<path id="esb.samples.trailblazer.esb.classpath.client">
+		<fileset dir="${soa.esb.lib.ext.dir}"/>
+		<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${org.jboss.as.home}/client" includes="jboss-jaxrpc.jar jbossall-client.jar jbossws-client.jar mail.jar"/>
+		<fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+		<fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${esb.dest}/dist" includes="trailblazer-esb.jar"/>
+		<pathelement location="${classes.dir}"/>
+	</path>
+
+	<target name="clean">
+		<delete dir="${esb.dest}"/>
+		<delete dir="${esb.samples.trailblazer.client.dest}"/>
+	</target>
+
+    <target name="messaging-config">
+		<property name="org.jboss.as.deploy.dir"
+			value="${org.jboss.as.home}/server/${org.jboss.as.config}/deploy"/>
+		<condition property="messaging.present">
+			<available file="${org.jboss.as.deploy.dir}/jboss-messaging"/>
+		</condition>
+		<condition property="messaging.present">
+			<available file="${org.jboss.as.deploy.dir}/jboss-messaging.sar"/>
+        </condition>
+
+        <condition property="jbossmq.present">
+            <not>
+                <isset property="messaging.present"/>
+            </not>
+        </condition>
+    </target>
+	
+	<!-- dependencies specific to JBoss Messaging -->
+    <target name="messaging-dependencies" if="messaging.present">
+        <property name="jms.service.file" value="jbm-queue-service.xml"/>
+        <property name="jms.description" value="JBoss Messaging"/>
+    </target>
+
+    <!-- dependencies specific to JBoss MQ -->
+    <target name="jbossmq-dependencies" if="jbossmq.present">
+        <property name="jms.service.file" value="jbmq-queue-service.xml"/>
+        <property name="jms.description" value="JBoss MQ"/>
+    </target>
+
+	<!-- =================================================================== -->
+	<!-- Prepares the directory structure                                    -->
+	<!-- =================================================================== -->
+	<target name="esb.built" unless="soa.esb.lib.dir">
+		<echo>Please build the ESB with "ant dist" in the ESB parent</echo>
+		<echo>directory in order to run the Trailblazer application.</echo>
+		<fail>Please build ESB first.</fail>
+	</target>
+
+	<target name="trailblazer.prepare" depends="esb.built,clean" if="soa.esb.lib.dir">
+		<mkdir dir="${esb.dest}"/>
+		<mkdir dir="${esb.dest}/dist"/>
+		<mkdir dir="${esb.dest}/classes"/>
+		<mkdir dir="${esb.samples.trailblazer.client.dest}"/>
+		<mkdir dir="${esb.samples.trailblazer.client.dest}/dist"/>
+		<mkdir dir="${esb.samples.trailblazer.client.dest}/classes"/>
+	</target>
+
+	<!-- Compilation targets -->
+	<!-- ___________________ -->
+	
+	<!-- ESB COMPILATION -->
+	<target name="esb.compile" 
+		depends="trailblazer.prepare"
+		description="Compiling Trailblazer ESB classes">
+		<javac
+		        destdir="${classes.dir}"
+		        classpathref="esb.samples.trailblazer.esb.classpath"
+			target="1.5"
+			debug="true">
+			<src path="${esb.src.dir}"/>
+		</javac>
+	</target>
+
+	<!-- CLIENT(WEB) COMPILATION -->
+    	<target name="client.compile" 
+		depends="trailblazer.prepare"
+		description="Compiling Trailblazer client classes">
+		<javac	destdir="${esb.samples.trailblazer.client.classes.dir}"
+            		classpathref="esb.samples.trailblazer.esb.classpath.client"
+			target="1.5"
+			debug="true">
+	    		<src path="${esb.samples.trailblazer.client.src.dir}"/>
+		</javac>
+	</target>
+
+	<!-- JAR/WAR targets -->
+	<target name="esb.jar" depends="messaging-config, messaging-dependencies, jbossmq-dependencies, compile" >
+		<property name="esb.build.dir" value="${esb.dest}" />
+
+		<echo>${jms.service.file}</echo>
+
+	        <!-- ESB Client JAR -->
+		<echo message="Building Trailblazer ESB archives"/>
+		<jar destfile="${esb.build.dir}/dist/trailblazer-esb.jar"
+        	        basedir="${classes.dir}" 
+               		includes="**/*.class" excludes="**/web/*.class">
+        	</jar>
+        	<!-- ESB Deployment (.esb) -->
+        	<copy todir="${esb.build.dir}/META-INF">
+            		<fileset dir="esb/conf" includes="jboss-esb.xml,deployment.xml" />
+        	</copy>
+	        <jar destfile="${esb.build.dir}/dist/trailblazer.esb">
+        	    <fileset dir="${classes.dir}" excludes="**/web/*.class" />            
+      	    	    <fileset dir="${esb.build.dir}" includes="META-INF/**" />
+	    	    <fileset dir="${basedir}/esb/conf" includes="${jms.service.file}"/>
+       		    <fileset dir="${basedir}/esb/conf" includes="smooks-*.xml,*.xsl" />
+                    <fileset dir="${basedir}/esb/conf" includes="jbossesb-properties.xml" />
+                    <fileset dir="${basedir}" includes="trailblazer.properties,template/**,models/**" />
+        	</jar>
+	</target>
+
+	<target name="war" depends="compile"> 
+
+		<!-- Web side WAR -->
+		<echo message="Building Trailblazer WAR file"/>
+		<delete file="${esb.samples.trailblazer.client.dest}/dist/trailblazer.war" />		
+		<war warfile="${esb.samples.trailblazer.client.dest}/dist/trailblazer.war"
+	       		webxml="${basedir}/client/resources/web.xml">
+			<classes dir="${esb.samples.trailblazer.client.classes.dir}">
+				<include name="**/loanbroker/*.class"/>
+				<include name="**/trailblazer/web/*.class"/>
+				<include name="trailblazer.properties"/>
+			</classes>
+			<webinf dir="${basedir}/client/resources">
+				<include name="wsdl/*"/>
+			</webinf>
+			<lib dir="${esb.dest}/dist">
+                                <include name="trailblazer-esb.jar"/>
+                        </lib>
+			<fileset dir="client/jsp">
+				<include name="**/*.jsp"/>
+			</fileset>
+		</war>
+	</target>
+	
+	<target name="deploy">
+           <copy file="${basedir}/client/java-files/SuccessfulLoanBroker.java" tofile="${basedir}/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java" overwrite="true"/>
+           <antcall target="common-deploy" />
+        </target>
+	
+        <target name="deploy-error-client">
+           <echo message="update the error client file" />
+           <copy file="${basedir}/client/java-files/FailedLoanBroker.java" tofile="${basedir}/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java" overwrite="true"/>
+           <antcall target="common-deploy" />          
+        </target>
+	
+	<target name="common-deploy" depends="jar, war">
+	        <echo message="Deploying Trailblazer EAR and WAR files to target server '${target-server}'."/>
+        	<copy todir="${target-server}/deploy">
+            	<fileset dir="${esb.dest}/dist/" includes="trailblazer.esb" />
+            	<fileset dir="${esb.samples.trailblazer.client.dest}/dist/" includes="trailblazer.war" />
+        	</copy>
+	</target>        
+        
+        <target name="undeploy">
+                <delete file="${target-server}/deploy/trailblazer.esb" />
+                <delete file="${target-server}/deploy/trailblazer.war" />
+        </target>
+        
+	        
+	<!-- Short target names -->
+	<target name="compile" depends="esb.compile,client.compile"/>
+	<target name="jar" depends="esb.jar"/>
+
+	<!-- run the ESB listeners -->
+	<!-- set the first argument to 0 for an indefinite run for the listener launcher -->
+	<!-- arg1 = # of seconds to let the listener threads run -->
+	<!-- arg2 = location of the esb config file which describes the listener configurations for a Message aware listener config -->
+	<!-- arg3 (if any) = location of the esb config file which describes the listener configurations for a NON-Message aware listener config (gateway)-->
+	<target name="runESB" depends="jar">
+		<echo>Running ESB Trailblazer listeners</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">
+			<jvmarg value="-Dorg.jboss.soa.esb.propertyFile=${trailblazer.dir}/esb/jbossesb-properties.xml"/>
+			<arg value="${trailblazer.dir}/esb/conf/jboss-esb.xml"/>
+			<classpath refid="esb.samples.trailblazer.esb.classpath.run"/>
+		</java>
+	</target>
+
+	<!-- javadocs paths -->
+	<path id="esb.samples.trailblazer.esb.javadocs.path">
+		<pathelement path="esb/classes"/>
+	</path>
+</project>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/FailedLoanBroker.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/FailedLoanBroker.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/FailedLoanBroker.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,228 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.samples.trailblazer.util.TrailblazerProperties;
+import org.jboss.soa.esb.samples.trailblazer.web.WebCustomer;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/*
+ * LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
+ * Requests will come from a JSR-181 pojo web service (@org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerWS)
+ * The sequence of events from the LoanBroker are:
+ * 1 - Prepare a request for the CreditAgency (transform the customer into a XML representation)
+ * 2 - Send to CreditAgency and get response (lookup the customer using the SSN (see @CustomerMasterFile)
+ * 3 - Prepare a LoanRequest for each of the banks in their unique data structures and send
+ * 4 - Collect the response(s) from the bank(s) and send an email to the customer with the quote offers
+ */
+
+public class LoanBroker {
+
+    private static Logger logger = Logger.getLogger(LoanBroker.class);
+    //used to locate our entries in the trailblazer-properties
+    private final String CREDIT_AGENCY_SERVICE_NAME = "creditagency.service.epr.name";
+    private final String CREDIT_AGENCY_SERVICE_CAT = "creditagency.service.category";
+    private final String BANK1_SERVICE_NAME = "bank1.service.epr.name";
+    private final String BANK1_SERVICE_CAT = "bank1.service.category";
+    private final String BANK2_SERVICE_NAME = "bank2.service.epr.name";
+    private final String BANK2_SERVICE_CAT = "bank2.service.category";
+    private final String NOTIFIER_SERVICE_NAME = "notifier.service.epr.name";
+    private final String NOTIFIER_SERVICE_CAT = "notifier.service.category";
+    private Properties properties = new TrailblazerProperties();
+    private ServiceInvoker serviceInvoker; 
+    private ServiceInvoker bank1Invoker;
+    private ServiceInvoker bank2Invoker;
+    private ServiceInvoker notifierInvoker;
+
+    public LoanBroker() {
+        String serviceCategoryName = properties.getProperty(CREDIT_AGENCY_SERVICE_CAT);
+        String serviceName = properties.getProperty(CREDIT_AGENCY_SERVICE_NAME);
+        String bank1ServiceCategoryName = properties.getProperty(BANK1_SERVICE_CAT);
+        String bank1ServiceName = properties.getProperty(BANK1_SERVICE_NAME);
+        String bank2ServiceCategoryName = properties.getProperty(BANK2_SERVICE_CAT);
+        String bank2ServiceName = properties.getProperty(BANK2_SERVICE_NAME);
+        String notifierServiceCategoryName = properties.getProperty(NOTIFIER_SERVICE_CAT);
+        String notifierServiceName = properties.getProperty(NOTIFIER_SERVICE_NAME);
+
+        try {
+            serviceInvoker = new ServiceInvoker(serviceCategoryName, serviceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + serviceCategoryName + ":" + serviceName + "'.", e);
+        }
+        
+        try {
+            bank1Invoker = new ServiceInvoker(bank1ServiceCategoryName, bank1ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank1ServiceCategoryName + ":" + bank1ServiceName + "'.", e);
+        }
+        
+        try {
+            bank2Invoker = new ServiceInvoker(bank2ServiceCategoryName, bank2ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank2ServiceCategoryName + ":" + bank2ServiceName + "'.", e);
+        }
+        
+        try {
+            notifierInvoker = new ServiceInvoker(notifierServiceCategoryName, notifierServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + notifierServiceCategoryName + ":" + notifierServiceName + "'.", e);
+        }
+    }
+
+    public void processLoanRequest(WebCustomer wCustomer) {
+
+        Customer customer = getCustomer(wCustomer);
+        //keep the customer in a file someplace for later use, if needed
+        CustomerMasterFile.addCustomer(String.valueOf(customer.ssn), customer);
+
+        //step 1 - send to credit agency for credit score if available
+
+        int score=sendToCreditAgency(customer);
+
+        //added a pause here to give the creditagency some time to reply
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        //step 2 - check if score is acceptable
+        
+        if (score >= 7) {
+	        //step 3a - send to Bank - async
+	        System.out.println("sending to first Bank...");
+	        sendToBank(bank1Invoker, customer, "b1");
+	
+	        System.out.println("sending to second Bank...");
+	        sendToBank(bank2Invoker, customer, "b2");
+        } else {
+        	//step 3b - notify customer that credit is not acceptable
+        	String invalidCredit="<insufficientCredit><customerUID>"+customer.ssn+"</customerUID>" +
+        			"<ref>0</ref>"+
+        			"<customerEmail>"+customer.email+"</customerEmail>" +
+        					"<errorCode>3</errorCode></insufficientCredit>";
+        	
+            Message notifyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+            notifyMessage.getBody().add(invalidCredit);
+    		
+            try {
+            	notifierInvoker.deliverAsync(notifyMessage);
+            } catch (Exception e) {
+                logger.error(e);
+            }
+        }
+    }
+
+    private Customer getCustomer(WebCustomer wCustomer) {
+        Customer customer = new Customer();
+        customer.ssn = wCustomer.getSsn();
+        customer.name = wCustomer.getName();
+        customer.address = wCustomer.getAddress();
+        customer.email = wCustomer.getEmail();
+        customer.salary = wCustomer.getSalary();
+        customer.loanAmount = wCustomer.getLoanAmount();
+        customer.loanDuration = wCustomer.getLoanDuration();
+        customer.creditScore = 0;
+
+        return customer;
+    }
+
+
+    private void sendToBank(ServiceInvoker invoker, Customer customer, String ref) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+        try {
+            //create a Quote Request that the bank expects
+            QuoteRequest quote = new QuoteRequest();
+            quote.ssn = customer.ssn;
+            quote.ref = ref;
+            quote.amount = (int) customer.loanAmount;
+            quote.creditScore = customer.creditScore;
+            quote.creditHistoryLen = 0;    //not sure who added this one
+            quote.term = customer.loanDuration;
+            quote.customerEmail = customer.email;
+
+            message.getBody().add(quote.getXML());
+            invoker.deliverAsync(message);
+            
+        } catch (Exception e) {
+            logger.error(e);
+        }
+    }
+
+    private int sendToCreditAgency(Customer customer) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        Message replyMessage;
+        int score = 0;
+
+        try {
+            logger.debug("sending to credit agency");
+
+            //set the customer details inside the message
+            message.getBody().add(customer.getXML());
+            
+            logger.info("Sending request to creditAgency: " + message.getBody().get());
+
+            replyMessage = serviceInvoker.deliverSync(message, 5000);
+            if (replyMessage != null) {
+                logger.info("received reply from creditAgency action: " + replyMessage.getBody().get());
+
+                String xml =(String)replyMessage.getBody().get();
+                
+    			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+    			fact.setNamespaceAware(true);
+    			
+    			java.io.InputStream xmlstr=
+    				new java.io.ByteArrayInputStream(xml.getBytes());
+
+    			DocumentBuilder builder=fact.newDocumentBuilder();
+    			org.w3c.dom.Document doc=builder.parse(xmlstr);
+    			
+    			org.w3c.dom.Element tree = doc.getDocumentElement();
+        		
+    			score = Integer.parseInt(tree.getAttribute("score"));
+    			
+    			logger.debug("Score from XML is: "+score);
+            } else {
+                logger.debug("reply not received from credit agency - setting a value of 5");
+                score = 5;
+            }
+        } catch (Exception ex2) {
+            logger.error("exception occured: " + ex2);
+        }
+
+        return score;
+    }
+
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/SuccessfulLoanBroker.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/SuccessfulLoanBroker.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/java-files/SuccessfulLoanBroker.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,228 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.samples.trailblazer.util.TrailblazerProperties;
+import org.jboss.soa.esb.samples.trailblazer.web.WebCustomer;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/*
+ * LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
+ * Requests will come from a JSR-181 pojo web service (@org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerWS)
+ * The sequence of events from the LoanBroker are:
+ * 1 - Prepare a request for the CreditAgency (transform the customer into a XML representation)
+ * 2 - Send to CreditAgency and get response (lookup the customer using the SSN (see @CustomerMasterFile)
+ * 3 - Prepare a LoanRequest for each of the banks in their unique data structures and send
+ * 4 - Collect the response(s) from the bank(s) and send an email to the customer with the quote offers
+ */
+
+public class LoanBroker {
+
+    private static Logger logger = Logger.getLogger(LoanBroker.class);
+    //used to locate our entries in the trailblazer-properties
+    private final String CREDIT_AGENCY_SERVICE_NAME = "creditagency.service.epr.name";
+    private final String CREDIT_AGENCY_SERVICE_CAT = "creditagency.service.category";
+    private final String BANK1_SERVICE_NAME = "bank1.service.epr.name";
+    private final String BANK1_SERVICE_CAT = "bank1.service.category";
+    private final String BANK2_SERVICE_NAME = "bank2.service.epr.name";
+    private final String BANK2_SERVICE_CAT = "bank2.service.category";
+    private final String NOTIFIER_SERVICE_NAME = "notifier.service.epr.name";
+    private final String NOTIFIER_SERVICE_CAT = "notifier.service.category";
+    private Properties properties = new TrailblazerProperties();
+    private ServiceInvoker serviceInvoker; 
+    private ServiceInvoker bank1Invoker;
+    private ServiceInvoker bank2Invoker;
+    private ServiceInvoker notifierInvoker;
+
+    public LoanBroker() {
+        String serviceCategoryName = properties.getProperty(CREDIT_AGENCY_SERVICE_CAT);
+        String serviceName = properties.getProperty(CREDIT_AGENCY_SERVICE_NAME);
+        String bank1ServiceCategoryName = properties.getProperty(BANK1_SERVICE_CAT);
+        String bank1ServiceName = properties.getProperty(BANK1_SERVICE_NAME);
+        String bank2ServiceCategoryName = properties.getProperty(BANK2_SERVICE_CAT);
+        String bank2ServiceName = properties.getProperty(BANK2_SERVICE_NAME);
+        String notifierServiceCategoryName = properties.getProperty(NOTIFIER_SERVICE_CAT);
+        String notifierServiceName = properties.getProperty(NOTIFIER_SERVICE_NAME);
+
+        try {
+            serviceInvoker = new ServiceInvoker(serviceCategoryName, serviceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + serviceCategoryName + ":" + serviceName + "'.", e);
+        }
+        
+        try {
+            bank1Invoker = new ServiceInvoker(bank1ServiceCategoryName, bank1ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank1ServiceCategoryName + ":" + bank1ServiceName + "'.", e);
+        }
+        
+        try {
+            bank2Invoker = new ServiceInvoker(bank2ServiceCategoryName, bank2ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank2ServiceCategoryName + ":" + bank2ServiceName + "'.", e);
+        }
+        
+        try {
+            notifierInvoker = new ServiceInvoker(notifierServiceCategoryName, notifierServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + notifierServiceCategoryName + ":" + notifierServiceName + "'.", e);
+        }
+    }
+
+    public void processLoanRequest(WebCustomer wCustomer) {
+
+        Customer customer = getCustomer(wCustomer);
+        //keep the customer in a file someplace for later use, if needed
+        CustomerMasterFile.addCustomer(String.valueOf(customer.ssn), customer);
+
+        //step 1 - send to credit agency for credit score if available
+
+        int score=sendToCreditAgency(customer);
+
+        //added a pause here to give the creditagency some time to reply
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        //step 2 - check if score is acceptable
+        
+        if (score >= 4) {
+	        //step 3a - send to Bank - async
+	        System.out.println("sending to first Bank...");
+	        sendToBank(bank1Invoker, customer, "b1");
+	
+	        System.out.println("sending to second Bank...");
+	        sendToBank(bank2Invoker, customer, "b2");
+        } else {
+        	//step 3b - notify customer that credit is not acceptable
+        	String invalidCredit="<insufficientCredit><customerUID>"+customer.ssn+"</customerUID>" +
+        			"<ref>0</ref>"+
+        			"<customerEmail>"+customer.email+"</customerEmail>" +
+        					"<errorCode>3</errorCode></insufficientCredit>";
+        	
+            Message notifyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+            notifyMessage.getBody().add(invalidCredit);
+    		
+            try {
+            	notifierInvoker.deliverAsync(notifyMessage);
+            } catch (Exception e) {
+                logger.error(e);
+            }
+        }
+    }
+
+    private Customer getCustomer(WebCustomer wCustomer) {
+        Customer customer = new Customer();
+        customer.ssn = wCustomer.getSsn();
+        customer.name = wCustomer.getName();
+        customer.address = wCustomer.getAddress();
+        customer.email = wCustomer.getEmail();
+        customer.salary = wCustomer.getSalary();
+        customer.loanAmount = wCustomer.getLoanAmount();
+        customer.loanDuration = wCustomer.getLoanDuration();
+        customer.creditScore = 0;
+
+        return customer;
+    }
+
+
+    private void sendToBank(ServiceInvoker invoker, Customer customer, String ref) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+        try {
+            //create a Quote Request that the bank expects
+            QuoteRequest quote = new QuoteRequest();
+            quote.ssn = customer.ssn;
+            quote.ref = ref;
+            quote.amount = (int) customer.loanAmount;
+            quote.creditScore = customer.creditScore;
+            quote.creditHistoryLen = 0;    //not sure who added this one
+            quote.term = customer.loanDuration;
+            quote.customerEmail = customer.email;
+
+            message.getBody().add(quote.getXML());
+            invoker.deliverAsync(message);
+            
+        } catch (Exception e) {
+            logger.error(e);
+        }
+    }
+
+    private int sendToCreditAgency(Customer customer) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        Message replyMessage;
+        int score = 0;
+
+        try {
+            logger.debug("sending to credit agency");
+
+            //set the customer details inside the message
+            message.getBody().add(customer.getXML());
+            
+            logger.info("Sending request to creditAgency: " + message.getBody().get());
+
+            replyMessage = serviceInvoker.deliverSync(message, 5000);
+            if (replyMessage != null) {
+                logger.info("received reply from creditAgency action: " + replyMessage.getBody().get());
+
+                String xml =(String)replyMessage.getBody().get();
+                
+    			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+    			fact.setNamespaceAware(true);
+    			
+    			java.io.InputStream xmlstr=
+    				new java.io.ByteArrayInputStream(xml.getBytes());
+
+    			DocumentBuilder builder=fact.newDocumentBuilder();
+    			org.w3c.dom.Document doc=builder.parse(xmlstr);
+    			
+    			org.w3c.dom.Element tree = doc.getDocumentElement();
+        		
+    			score = Integer.parseInt(tree.getAttribute("score"));
+    			
+    			logger.debug("Score from XML is: "+score);
+            } else {
+                logger.debug("reply not received from credit agency - setting a value of 5");
+                score = 5;
+            }
+        } catch (Exception ex2) {
+            logger.error("exception occured: " + ex2);
+        }
+
+        return score;
+    }
+
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/jsp/index.jsp
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/jsp/index.jsp	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/jsp/index.jsp	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,134 @@
+<%@ page import="org.jboss.soa.esb.samples.trailblazer.web.WebCustomer"%>
+<%@ page import="org.jboss.soa.esb.samples.trailblazer.loanbroker.LoanRequester"%>
+<% 
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+ 
+String[] formHeader  = {"Name", "Address", "SSN", "Email", "Salary", "Employer", "LoanAmount", "LoanDuration"};
+String[] formValue   = new String[formHeader.length];
+
+String errors = "";
+int errorCount=0;
+
+for (int i=0; i<formValue.length;i++) {
+	formValue[i]    = String.valueOf(request.getParameter(formHeader[i]));
+	//out.write(formHeader[i] + "=" + formValue[i] + "<br>");
+	if ("null".equals(formValue[i]) || formValue[i]==null || "".equals(formValue[i])) {
+	        formValue[i]="";
+			errorCount++;
+			errors += formHeader[i] + " is a required field<br>";
+	}
+}
+//It's a new form. Let's set some default values.
+if (errorCount==formHeader.length) {
+	formValue[0]="Joe Broke";
+	formValue[1]="1 Spenditall Str., BrokeTown 99999 DC";
+	formValue[2]="1234567890";
+	formValue[3]="joe at iliketospendit.com";
+	formValue[4]="50000.00";
+	formValue[5]="Wesayso & Co";
+	formValue[6]="1000.00";
+	formValue[7]="12";
+}
+
+%>
+<html>
+<head>
+<title>JBossESB Loan Broker</title>
+<link rel="shortcut icon" href="/favicon.ico"/>
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
+
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
+</head>
+<body>
+
+<div id="TopLogo">
+  <a href="http://www.jboss.com"><img src="http://www.jboss.com/themes/jbosstheme/img/logo.gif" alt="JBoss - The Professional Open Source Company" border="0" /></a>
+</div>
+
+<div id="TopMenu">
+  <table cellpadding="0" cellspacing="0">
+  <tr>
+    <td class="menu_JBnetwork"><a href="http://network.jboss.com/">subscription</a></td>
+    <td class="menu_JBcom"><a href="http://www.jboss.com/">jboss.com</a></td>
+
+    <td class="menu_JBorg"><a href="http://labs.jboss.com">jboss.org</a></td>
+    <td class="menu_RH"><a href="http://www.redhat.com">redhat.com</a></td>
+  </tr>
+  </table>
+</div>
+
+
+<% if (errorCount!=0) { %>
+<form id="formLoanBrokerRequest" action="index.jsp" method="post">
+
+<table width="100%" border="0" cellpadding="10" cellspacing="3">
+        <tr><td colspan="2"><br><br><br><br>
+        <tr><td colspan="2"><h1>Loan Broker Request Form</h1></td></tr>
+        <% if (errorCount < formHeader.length) { %> 
+        <tr><td colspan="2"><font color="red"><%=errors %></font></td></tr>
+        <% } %>
+        <% for (int i=0; i<formHeader.length;i++) { %>
+        <tr>
+			<td width="30%" nowrap><%=formHeader[i] %></td>
+			<td width="70%"><input id="<%=formHeader[i] %>" name="<%=formHeader[i] %>" type="text"
+	   		    class="textBox" tabindex="1" size="60" value="<%=formValue[i] %>" /></td>
+	    </tr>
+	    <% } %>
+	
+	<tr>
+	    <td><INPUT TYPE="submit" VALUE="submit loan request">  </td>
+	</tr>
+</table>
+
+</form>
+
+<% } else  {
+    //Setting the values in the request
+    WebCustomer webCustomer = new WebCustomer();
+    webCustomer.setName(formValue[0]);
+    webCustomer.setAddress(formValue[1]);
+    webCustomer.setSsn(Integer.valueOf(formValue[2]).intValue());
+    webCustomer.setEmail(formValue[3]);
+    webCustomer.setSalary(Double.valueOf(formValue[4]).doubleValue());
+    webCustomer.setEmployerName(formValue[5]);
+    webCustomer.setLoanAmount(Double.valueOf(formValue[6]).doubleValue());
+    webCustomer.setLoanDuration(Integer.valueOf(formValue[7]).intValue());
+    LoanRequester.request(webCustomer);
+%>
+    <table width="100%" border="0" cellpadding="10" cellspacing="3">
+        <tr><td><br><br><br><br>
+        <tr><td><h1>Loan Broker</h1></td></tr>
+    	<tr><td><h2>Request was submitted</h2></td></tr>
+        <tr><td><a href="index.jsp">Fill out another request</a></td></tr>
+	
+ <% } %>
+</body>
+</html>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,479 @@
+The jars in this directory are covered by a range of licences, as described
+below.
+
+JBoss jars:
+
+/*
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ */
+ 
+ 
+Apache Jakarta Commons Collections/Commons Logging/Axis/Log4j:
+
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   
+   
+   JUnit
+   
+   Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+    a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+    b) in the case of each subsequent Contributor:
+
+    i) changes to the Program, and
+
+    ii) additions to the Program;
+
+    where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+    c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire that license
+before distributing the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+    a) it complies with the terms and conditions of this Agreement; and
+
+    b) its license agreement:
+
+    i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+    ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+    iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+    iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange. 
+
+When the Program is made available in source code form:
+
+    a) it must be made available under this Agreement; and
+
+    b) a copy of this Agreement must be included with each copy of the Program. 
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
+
+
+XStream, Antlr, Stingtemplate BSD License
+
+Copyright (c) 2003-2005, Joe Walnes
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions and the following disclaimer. Redistributions in binary form must reproduce
+the above copyright notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the distribution.
+
+Neither the name of XStream nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+  <package-type>org.jboss.soa.esb.samples.trailblazer.web</package-type>
+  <namespaceURI>http://org.jboss.ws/samples/rpcstyle/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+  <java-type>org.jboss.soa.esb.samples.trailblazer.web.WebCustomer</java-type>
+  <root-type-qname xmlns:typeNS='http://org.jboss.ws/samples/rpcstyle/types'>typeNS:WebCustomer</root-type-qname>
+  <qname-scope>complexType</qname-scope>
+  <variable-mapping>
+   <java-variable-name>address</java-variable-name>
+   <xml-element-name>address</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>email</java-variable-name>
+   <xml-element-name>email</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>employerName</java-variable-name>
+   <xml-element-name>employerName</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>loanAmount</java-variable-name>
+   <xml-element-name>loanAmount</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>loanDuration</java-variable-name>
+   <xml-element-name>loanDuration</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>name</java-variable-name>
+   <xml-element-name>name</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>salary</java-variable-name>
+   <xml-element-name>salary</xml-element-name>
+  </variable-mapping>
+  <variable-mapping>
+   <java-variable-name>ssn</java-variable-name>
+   <xml-element-name>ssn</xml-element-name>
+  </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+  <service-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerService</service-interface>
+  <wsdl-service-name xmlns:serviceNS='http://org.jboss.ws/samples/rpcstyle'>serviceNS:LoanBrokerService</wsdl-service-name>
+  <port-mapping>
+   <port-name>LoanBrokerInterfacePort</port-name>
+   <java-port-name>LoanBrokerInterfacePort</java-port-name>
+  </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+  <service-endpoint-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface</service-endpoint-interface>
+  <wsdl-port-type xmlns:portTypeNS='http://org.jboss.ws/samples/rpcstyle'>portTypeNS:LoanBrokerInterface</wsdl-port-type>
+  <wsdl-binding xmlns:bindingNS='http://org.jboss.ws/samples/rpcstyle'>bindingNS:LoanBrokerInterfaceBinding</wsdl-binding>
+  <service-endpoint-method-mapping>
+   <java-method-name>RequestLoan</java-method-name>
+   <wsdl-operation>RequestLoan</wsdl-operation>
+   <method-param-parts-mapping>
+    <param-position>0</param-position>
+    <param-type>org.jboss.soa.esb.samples.trailblazer.web.WebCustomer</param-type>
+    <wsdl-message-mapping>
+     <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.ws/samples/rpcstyle'>wsdlMsgNS:LoanBrokerInterface_RequestLoan</wsdl-message>
+     <wsdl-message-part-name>WebCustomer_1</wsdl-message-part-name>
+     <parameter-mode>IN</parameter-mode>
+    </wsdl-message-mapping>
+   </method-param-parts-mapping>
+  </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/web.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/web.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/web.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> 
+	<servlet> 
+		<servlet-name>LoanBroker</servlet-name> 
+		<servlet-class>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerBean</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>LoanBroker</servlet-name>
+		<url-pattern>/LoanBroker</url-pattern>
+	</servlet-mapping>
+</web-app>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/webservices.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/webservices.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/webservices.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+  <webservice-description-name>LoanBrokerService</webservice-description-name>
+  <wsdl-file>WEB-INF/wsdl/LoanBrokerService.wsdl</wsdl-file>
+  <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+  <port-component>
+   <port-component-name>LoanBrokerInterfacePort</port-component-name>
+   <wsdl-port xmlns:portNS='http://org.jboss.ws/samples/rpcstyle'>portNS:LoanBrokerInterfacePort</wsdl-port>
+   <service-endpoint-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface</service-endpoint-interface>
+   <service-impl-bean>
+    <servlet-link>LoanBroker</servlet-link>
+   </service-impl-bean>
+  </port-component>
+ </webservice-description>
+</webservices>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,45 @@
+<definitions name='LoanBrokerService' targetNamespace='http://localhost/trailblazer' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://localhost/trailblazer' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+  <xs:schema targetNamespace='http://localhost/trailblazer' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+   <xs:complexType name='webCustomer'>
+    <xs:sequence>
+     <xs:element minOccurs='0' name='address' type='xs:string'/>
+     <xs:element minOccurs='0' name='email' type='xs:string'/>
+     <xs:element minOccurs='0' name='employerName' type='xs:string'/>
+     <xs:element name='loanAmount' type='xs:double'/>
+     <xs:element name='loanDuration' type='xs:int'/>
+     <xs:element minOccurs='0' name='name' type='xs:string'/>
+     <xs:element name='salary' type='xs:double'/>
+     <xs:element name='ssn' type='xs:int'/>
+    </xs:sequence>
+   </xs:complexType>
+  </xs:schema>
+ </types>
+ <message name='LoanBrokerInterface_RequestLoan'>
+  <part name='webCustomer_1' type='tns:webCustomer'></part>
+ </message>
+ <message name='LoanBrokerInterface_RequestLoanResponse'></message>
+ <portType name='LoanBrokerInterface'>
+  <operation name='RequestLoan' parameterOrder='webCustomer_1'>
+   <input message='tns:LoanBrokerInterface_RequestLoan'></input>
+   <output message='tns:LoanBrokerInterface_RequestLoanResponse'></output>
+  </operation>
+ </portType>
+ <binding name='LoanBrokerInterfaceBinding' type='tns:LoanBrokerInterface'>
+  <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+  <operation name='RequestLoan'>
+   <soap:operation soapAction=''/>
+   <input>
+    <soap:body namespace='http://localhost/trailblazer' use='literal'/>
+   </input>
+   <output>
+    <soap:body namespace='http://localhost/trailblazer' use='literal'/>
+   </output>
+  </operation>
+ </binding>
+ <service name='LoanBrokerService'>
+  <port binding='tns:LoanBrokerInterfaceBinding' name='LoanBrokerInterfacePort'>
+   <soap:address location='http://127.0.0.1:8080/trailblazer/LoanBroker'/>
+  </port>
+ </service>
+</definitions>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wstools-config.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wstools-config.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/resources/wstools-config.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  wstools -cp ../../../output/classes -config wstools-config.xml
+-->
+
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+  
+  <java-wsdl>
+    <service name="LoanBrokerService" style="rpc" endpoint="org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface"/>
+    <namespaces target-namespace="http://org.jboss.ws/samples/rpcstyle" type-namespace="http://org.jboss.ws/samples/rpcstyle/types"/>
+    <mapping file="jaxrpc-mapping.xml"/>
+    <webservices servlet-link="LoanBrokerEndpoint"/>
+  </java-wsdl>
+  
+</configuration>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import java.io.Serializable;
+
+public class Customer implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	public	String	name=""	,address=""	,employerName="";
+	public	double	salary=0.0	,loanAmount=0.0;
+	public	int		loanDuration=0;	
+	public int		ssn=0;
+	public String	email="";
+	public int creditScore=0;
+	public String quoteID, rateOffered, quoteCode;
+	
+	public String getCSV() {
+		String buff = (name+","+ssn+","+address+","+employerName+","+salary+","
+				+loanAmount+","+loanDuration+","+email+","+creditScore);
+				
+		return buff;
+	}
+
+	public String getXML() {
+		StringBuffer ret=new StringBuffer();
+		
+		ret.append("<creditCheck name=\""+name+"\" ");
+		ret.append("ssn=\""+ssn+"\" ");
+		ret.append("address=\""+address+"\" ");
+		ret.append("employerName=\""+employerName+"\" ");
+		ret.append("salary=\""+salary+"\" ");
+		ret.append("loanAmount=\""+loanAmount+"\" ");
+		ret.append("loanDuration=\""+loanDuration+"\" ");
+		ret.append("email=\""+email+"\" ");
+		ret.append("creditScore=\""+creditScore+"\" />");
+		
+		return(ret.toString());
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,88 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/*
+ * Utility class used to persist the customer quote requests to a serialized Hash list on the file system
+ * Key is the customer's SSN #
+ */
+
+public class CustomerMasterFile implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	private static Map<String, Customer> customers;
+	private static final String TMP_DIR	= System.getProperty("java.io.tmpdir","/tmp");
+	private static final File FILE = new File(TMP_DIR, "customers");
+	
+	static {
+		getCustomers();
+	}
+	
+	public static synchronized void writeCustomers() {
+		try {
+			ObjectOutputStream stream = new ObjectOutputStream(new FileOutputStream(FILE));
+			stream.writeObject(customers);
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		
+	}
+	
+	@SuppressWarnings("unchecked")
+	public static synchronized void  getCustomers() {
+		
+		try {
+			ObjectInputStream ois = new ObjectInputStream(new FileInputStream(FILE));
+			customers = (Map<String, Customer>)ois.readObject();
+		} catch (Exception e) {
+			customers = new HashMap<String, Customer>();
+		}	
+		
+	}
+	
+	public static Customer getCustomer(String id) {
+		return customers.get(id);
+	}
+	
+	public static void addCustomer(String id, Customer customer) {
+		customers.put(id, customer);
+		writeCustomers();
+	}
+	
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,228 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.samples.trailblazer.util.TrailblazerProperties;
+import org.jboss.soa.esb.samples.trailblazer.web.WebCustomer;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/*
+ * LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
+ * Requests will come from a JSR-181 pojo web service (@org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerWS)
+ * The sequence of events from the LoanBroker are:
+ * 1 - Prepare a request for the CreditAgency (transform the customer into a XML representation)
+ * 2 - Send to CreditAgency and get response (lookup the customer using the SSN (see @CustomerMasterFile)
+ * 3 - Prepare a LoanRequest for each of the banks in their unique data structures and send
+ * 4 - Collect the response(s) from the bank(s) and send an email to the customer with the quote offers
+ */
+
+public class LoanBroker {
+
+    private static Logger logger = Logger.getLogger(LoanBroker.class);
+    //used to locate our entries in the trailblazer-properties
+    private final String CREDIT_AGENCY_SERVICE_NAME = "creditagency.service.epr.name";
+    private final String CREDIT_AGENCY_SERVICE_CAT = "creditagency.service.category";
+    private final String BANK1_SERVICE_NAME = "bank1.service.epr.name";
+    private final String BANK1_SERVICE_CAT = "bank1.service.category";
+    private final String BANK2_SERVICE_NAME = "bank2.service.epr.name";
+    private final String BANK2_SERVICE_CAT = "bank2.service.category";
+    private final String NOTIFIER_SERVICE_NAME = "notifier.service.epr.name";
+    private final String NOTIFIER_SERVICE_CAT = "notifier.service.category";
+    private Properties properties = new TrailblazerProperties();
+    private ServiceInvoker serviceInvoker; 
+    private ServiceInvoker bank1Invoker;
+    private ServiceInvoker bank2Invoker;
+    private ServiceInvoker notifierInvoker;
+
+    public LoanBroker() {
+        String serviceCategoryName = properties.getProperty(CREDIT_AGENCY_SERVICE_CAT);
+        String serviceName = properties.getProperty(CREDIT_AGENCY_SERVICE_NAME);
+        String bank1ServiceCategoryName = properties.getProperty(BANK1_SERVICE_CAT);
+        String bank1ServiceName = properties.getProperty(BANK1_SERVICE_NAME);
+        String bank2ServiceCategoryName = properties.getProperty(BANK2_SERVICE_CAT);
+        String bank2ServiceName = properties.getProperty(BANK2_SERVICE_NAME);
+        String notifierServiceCategoryName = properties.getProperty(NOTIFIER_SERVICE_CAT);
+        String notifierServiceName = properties.getProperty(NOTIFIER_SERVICE_NAME);
+
+        try {
+            serviceInvoker = new ServiceInvoker(serviceCategoryName, serviceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + serviceCategoryName + ":" + serviceName + "'.", e);
+        }
+        
+        try {
+            bank1Invoker = new ServiceInvoker(bank1ServiceCategoryName, bank1ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank1ServiceCategoryName + ":" + bank1ServiceName + "'.", e);
+        }
+        
+        try {
+            bank2Invoker = new ServiceInvoker(bank2ServiceCategoryName, bank2ServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + bank2ServiceCategoryName + ":" + bank2ServiceName + "'.", e);
+        }
+        
+        try {
+            notifierInvoker = new ServiceInvoker(notifierServiceCategoryName, notifierServiceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + notifierServiceCategoryName + ":" + notifierServiceName + "'.", e);
+        }
+    }
+
+    public void processLoanRequest(WebCustomer wCustomer) {
+
+        Customer customer = getCustomer(wCustomer);
+        //keep the customer in a file someplace for later use, if needed
+        CustomerMasterFile.addCustomer(String.valueOf(customer.ssn), customer);
+
+        //step 1 - send to credit agency for credit score if available
+
+        int score=sendToCreditAgency(customer);
+
+        //added a pause here to give the creditagency some time to reply
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        //step 2 - check if score is acceptable
+        
+        if (score >= 4) {
+	        //step 3a - send to Bank - async
+	        System.out.println("sending to first Bank...");
+	        sendToBank(bank1Invoker, customer, "b1");
+	
+	        System.out.println("sending to second Bank...");
+	        sendToBank(bank2Invoker, customer, "b2");
+        } else {
+        	//step 3b - notify customer that credit is not acceptable
+        	String invalidCredit="<insufficientCredit><customerUID>"+customer.ssn+"</customerUID>" +
+        			"<ref>0</ref>"+
+        			"<customerEmail>"+customer.email+"</customerEmail>" +
+        					"<errorCode>3</errorCode></insufficientCredit>";
+        	
+            Message notifyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+            notifyMessage.getBody().add(invalidCredit);
+    		
+            try {
+            	notifierInvoker.deliverAsync(notifyMessage);
+            } catch (Exception e) {
+                logger.error(e);
+            }
+        }
+    }
+
+    private Customer getCustomer(WebCustomer wCustomer) {
+        Customer customer = new Customer();
+        customer.ssn = wCustomer.getSsn();
+        customer.name = wCustomer.getName();
+        customer.address = wCustomer.getAddress();
+        customer.email = wCustomer.getEmail();
+        customer.salary = wCustomer.getSalary();
+        customer.loanAmount = wCustomer.getLoanAmount();
+        customer.loanDuration = wCustomer.getLoanDuration();
+        customer.creditScore = 0;
+
+        return customer;
+    }
+
+
+    private void sendToBank(ServiceInvoker invoker, Customer customer, String ref) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+        try {
+            //create a Quote Request that the bank expects
+            QuoteRequest quote = new QuoteRequest();
+            quote.ssn = customer.ssn;
+            quote.ref = ref;
+            quote.amount = (int) customer.loanAmount;
+            quote.creditScore = customer.creditScore;
+            quote.creditHistoryLen = 0;    //not sure who added this one
+            quote.term = customer.loanDuration;
+            quote.customerEmail = customer.email;
+
+            message.getBody().add(quote.getXML());
+            invoker.deliverAsync(message);
+            
+        } catch (Exception e) {
+            logger.error(e);
+        }
+    }
+
+    private int sendToCreditAgency(Customer customer) {
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        Message replyMessage;
+        int score = 0;
+
+        try {
+            logger.debug("sending to credit agency");
+
+            //set the customer details inside the message
+            message.getBody().add(customer.getXML());
+            
+            logger.info("Sending request to creditAgency: " + message.getBody().get());
+
+            replyMessage = serviceInvoker.deliverSync(message, 5000);
+            if (replyMessage != null) {
+                logger.info("received reply from creditAgency action: " + replyMessage.getBody().get());
+
+                String xml =(String)replyMessage.getBody().get();
+                
+    			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+    			fact.setNamespaceAware(true);
+    			
+    			java.io.InputStream xmlstr=
+    				new java.io.ByteArrayInputStream(xml.getBytes());
+
+    			DocumentBuilder builder=fact.newDocumentBuilder();
+    			org.w3c.dom.Document doc=builder.parse(xmlstr);
+    			
+    			org.w3c.dom.Element tree = doc.getDocumentElement();
+        		
+    			score = Integer.parseInt(tree.getAttribute("score"));
+    			
+    			logger.debug("Score from XML is: "+score);
+            } else {
+                logger.debug("reply not received from credit agency - setting a value of 5");
+                score = 5;
+            }
+        } catch (Exception ex2) {
+            logger.error("exception occured: " + ex2);
+        }
+
+        return score;
+    }
+
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,34 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import org.jboss.soa.esb.samples.trailblazer.web.*;
+
+/**
+ * LoanRequester is a small class that serves as a web service client.
+ */
+public class LoanRequester {
+	public LoanRequester() {	
+	}
+	
+	/**
+	 * Grab the port and call request loan.
+	 * @return customer customer bean
+	 */
+	public static void request(WebCustomer customer) { 
+		try {
+			InitialContext iniCtx = new InitialContext(); 
+			//Service service = (Service)iniCtx.lookup("java:comp/env/service/LoanBrokerService");
+			//LoanBrokerInterface port = (LoanBrokerInterface)service.getPort(LoanBrokerInterface.class);
+            Service service = Service.create(
+                    new URL("http://localhost:8080/trailblazer/LoanBroker?wsdl"),
+                    new QName("http://localhost/trailblazer","LoanBrokerService") );
+            LoanBrokerInterface port = (LoanBrokerInterface)service.getPort(LoanBrokerInterface.class );
+			port.RequestLoan(customer);
+		} catch (Exception e) {
+			e.printStackTrace();
+		 }
+	} 
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,159 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+import java.io.Serializable;
+
+
+public class QuoteRequest implements Serializable 
+{
+	private static final long serialVersionUID = 1L;
+	public int ssn;
+	public String ref;
+	public int creditScore;
+	public int creditHistoryLen;
+	public int amount;
+	public int term;
+	public String customerUniqueId;
+	public String customerEmail;
+	
+	/**
+	 * Gets for the credit score.
+	 * @return credit score
+	 */
+	public int getCreditScore() {
+		return creditScore;
+	}
+	/**
+	 * Sets the credit score.
+	 * @param creditScore
+	 */
+	public void setCreditScore(int creditScore) {
+		this.creditScore = creditScore;
+	}
+	/**
+	 * Gets the credit history length (in months).
+	 * @return credit history length
+	 */
+	public int getCreditHistoryLen() {
+		return creditHistoryLen;
+	}
+	/**
+	 * Sets the credit history length (in months).
+	 * @param creditHistoryLen
+	 */
+	public void setCreditHistoryLen(int historyLength) {
+		this.creditHistoryLen = historyLength;
+	}
+	/**
+	 * Gets the requested loan amount (in dollar).
+	 * @return the loan amount
+	 */
+	public int getAmount() {
+		return amount;
+	}
+	/** 
+	 * Sets the loan amount.
+	 * @param amount - the loan amount (in dollar).
+	 */
+	public void setAmount(int loanAmount) {
+		this.amount = loanAmount;
+	}
+	/**
+	 * Gets the duration of the loan, the term, (in months).
+	 * @return term
+	 */
+	public int getTerm() {
+		return term;
+	}
+	/**
+	 * Sets the term (duration) of the loan (in months)
+	 * @param term
+	 */
+	public void setTerm(int loanTerm) {
+		this.term = loanTerm;
+	}
+	/** 
+	 * Sets the Social Security Number (SSN).
+	 * @return ssn
+	 */
+	public int getSsn() {
+		return ssn;
+	}
+	/**
+	 * Sets the quote reference.
+	 * @param ref
+	 */
+	public void setRef(String ref) {
+		this.ref = ref;
+	}
+	/** 
+	 * Gets the quote reference.
+	 * @return ref
+	 */
+	public String getRef() {
+		return ref;
+	}
+	/**
+	 * Sets the Social Security Number (SSN).
+	 * @param ssn
+	 */
+	public void setSsn(int ssn) {
+		this.ssn = ssn;
+	}
+	/**
+	 * Returns a human readable string representation of this object.
+	 * @return toString
+	 */
+	public String toString() {
+		return this.getClass().getSimpleName() + "=["
+			+ "ssn=" + ssn
+			+ "ref=" + ref
+		    + ", creditScore=" + creditScore
+			+ ", creditHistoryLen=" + creditHistoryLen
+			+ ", amount=" + amount
+			+ ", term=" + term
+			+ ", customerUniqueId="+ customerUniqueId + "]";	
+	}
+	
+	public String getXML() {
+		StringBuffer ret=new StringBuffer();
+		
+		ret.append("<quoteRequest ssn=\""+ssn+"\" ");
+		ret.append("ref=\""+ref+"\" ");
+		ret.append("creditScore=\""+creditScore+"\" ");
+		ret.append("creditHistoryLen=\""+creditHistoryLen+"\" ");
+		ret.append("amount=\""+amount+"\" ");
+		ret.append("term=\""+term+"\" ");
+		ret.append("customerUID=\""+ssn+"\" ");
+		ret.append("customerEmail=\""+customerEmail+"\" />");
+		
+		return(ret.toString());
+	}
+	
+	public String getCustomerUniqueId() {
+		return customerUniqueId;
+	}
+	public void setCustomerUniqueId(String customerUID) {
+		this.customerUniqueId = customerUID;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,25 @@
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.samples.trailblazer.loanbroker.LoanBroker;
+
+ at WebService(name = "LoanBrokerInterface", targetNamespace = "http://localhost/trailblazer", serviceName = "LoanBrokerService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public class LoanBrokerBean {
+		private static Logger logger = Logger.getLogger(LoanBrokerBean.class);
+		
+	   @WebMethod
+	   public void RequestLoan(@WebParam(name="webCustomer_1") WebCustomer webCustomer_1)
+	   {
+			logger.info("WebCustomer received: \n" + webCustomer_1);
+			
+			LoanBroker broker = new LoanBroker();
+			broker.processLoanRequest(webCustomer_1);
+	   }
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "LoanBrokerInterface", targetNamespace = "http://localhost/trailblazer")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface LoanBrokerInterface {
+    @WebMethod
+    public void RequestLoan(
+        @WebParam(name = "webCustomer_1", partName = "webCustomer_1")
+        WebCustomer webCustomer_1);
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,249 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+/*
+ * a simple web Customer to use in the web services call and not expose the internal esb Customer object
+ */
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import java.io.Serializable;
+
+/*
+ * WebCustomer represents the data captured in the client JSP page
+ */
+
+ at SuppressWarnings("serial")
+public class WebCustomer implements Serializable
+{
+    private java.lang.String address;
+
+    private java.lang.String email;
+
+    private java.lang.String employerName;
+
+    private double loanAmount;
+
+    private int loanDuration;
+
+    private java.lang.String name;
+
+    private double salary;
+
+    private int ssn;
+
+    public WebCustomer() {
+    }
+
+    public WebCustomer(
+           java.lang.String address,
+           java.lang.String email,
+           java.lang.String employerName,
+           double loanAmount,
+           int loanDuration,
+           java.lang.String name,
+           double salary,
+           int ssn) {
+           this.address = address;
+           this.email = email;
+           this.employerName = employerName;
+           this.loanAmount = loanAmount;
+           this.loanDuration = loanDuration;
+           this.name = name;
+           this.salary = salary;
+           this.ssn = ssn;
+    }
+	public String toString() {
+		String ret = "-- WebCustomer details -- \n";
+		ret += "name: " + name + "\n";
+		ret += "address: " + address + "\n";
+		ret += "employerName: " + employerName + "\n";
+		ret += "salary: " + salary + "\n";
+		ret += "loanAmount: " + loanAmount + "\n";
+		ret += "loanDuration: " + loanDuration + "\n";
+		ret += "ssn: " + ssn + "\n";
+		ret += "email: " + email + "\n";
+		ret += "--------------------------";
+		
+		return ret;
+	}
+
+    /**
+     * Gets the address value for this WebCustomer.
+     * 
+     * @return address
+     */
+    public java.lang.String getAddress() {
+        return address;
+    }
+
+
+    /**
+     * Sets the address value for this WebCustomer.
+     * 
+     * @param address
+     */
+    public void setAddress(java.lang.String address) {
+        this.address = address;
+    }
+
+
+    /**
+     * Gets the email value for this WebCustomer.
+     * 
+     * @return email
+     */
+    public java.lang.String getEmail() {
+        return email;
+    }
+
+
+    /**
+     * Sets the email value for this WebCustomer.
+     * 
+     * @param email
+     */
+    public void setEmail(java.lang.String email) {
+        this.email = email;
+    }
+
+
+    /**
+     * Gets the employerName value for this WebCustomer.
+     * 
+     * @return employerName
+     */
+    public java.lang.String getEmployerName() {
+        return employerName;
+    }
+
+
+    /**
+     * Sets the employerName value for this WebCustomer.
+     * 
+     * @param employerName
+     */
+    public void setEmployerName(java.lang.String employerName) {
+        this.employerName = employerName;
+    }
+
+
+    /**
+     * Gets the loanAmount value for this WebCustomer.
+     * 
+     * @return loanAmount
+     */
+    public double getLoanAmount() {
+        return loanAmount;
+    }
+
+
+    /**
+     * Sets the loanAmount value for this WebCustomer.
+     * 
+     * @param loanAmount
+     */
+    public void setLoanAmount(double loanAmount) {
+        this.loanAmount = loanAmount;
+    }
+
+
+    /**
+     * Gets the loanDuration value for this WebCustomer.
+     * 
+     * @return loanDuration
+     */
+    public int getLoanDuration() {
+        return loanDuration;
+    }
+
+
+    /**
+     * Sets the loanDuration value for this WebCustomer.
+     * 
+     * @param loanDuration
+     */
+    public void setLoanDuration(int loanDuration) {
+        this.loanDuration = loanDuration;
+    }
+
+
+    /**
+     * Gets the name value for this WebCustomer.
+     * 
+     * @return name
+     */
+    public java.lang.String getName() {
+        return name;
+    }
+
+
+    /**
+     * Sets the name value for this WebCustomer.
+     * 
+     * @param name
+     */
+    public void setName(java.lang.String name) {
+        this.name = name;
+    }
+
+
+    /**
+     * Gets the salary value for this WebCustomer.
+     * 
+     * @return salary
+     */
+    public double getSalary() {
+        return salary;
+    }
+
+
+    /**
+     * Sets the salary value for this WebCustomer.
+     * 
+     * @param salary
+     */
+    public void setSalary(double salary) {
+        this.salary = salary;
+    }
+
+
+    /**
+     * Gets the ssn value for this WebCustomer.
+     * 
+     * @return ssn
+     */
+    public int getSsn() {
+        return ssn;
+    }
+
+
+    /**
+     * Sets the ssn value for this WebCustomer.
+     * 
+     * @param ssn
+     */
+    public void setSsn(int ssn) {
+        this.ssn = ssn;
+    }
+	
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/build.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/build.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/build.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+<project name="TRAILBLAZER" default="org.jboss.esb.samples.trailblazer.esb.compile" basedir=".">
+
+	<property name="org.jboss.soa.samples.trailblazer.esb_home"	 	value="../../.."/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.dest"        	value="${basedir}/build"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.classes.dir" 	value="${basedir}/build/classes/esb/"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.testclasses.dir"  value="${basedir}/build/classes/tests/"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.src.dir"          value="${basedir}/src"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.test.dir"         value="${basedir}/test"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.lib.dir"      	value="${basedir}/lib"/>
+	<property name="org.jboss.esb.samples.trailblazer.esb.tests.report.dir" value="${basedir}/build/tests"/>
+
+	<!-- UPDATE THIS WITH YOUR JBOSS_HOME -->
+	<property name="org.jboss.soa.samples.trailblazer.jboss_home" 		value="/usr/local/jboss-4.0.4"/>
+
+	<property environment="env" />
+
+        <property name="org.jboss.soa.esb.lib.file" value="jbossesb-rosetta.jar"/>
+        <property name="org.jboss.soa.esb.lib.dist.dir" value="${org.jboss.soa.samples.trailblazer.esb_home}/lib"/>
+        <property name="org.jboss.soa.esb.lib.src.dir" value="../../../build/jbossesb/lib"/>
+
+	<available file="${org.jboss.soa.esb.lib.file}"
+            filepath="${org.jboss.soa.esb.lib.dist.dir}"
+            property="org.jboss.soa.esb.lib.dir"
+            value="${org.jboss.soa.esb.lib.dist.dir}"/>
+
+	<available file="${org.jboss.soa.esb.lib.file}"
+            filepath="${org.jboss.soa.esb.lib.src.dir}"
+            property="org.jboss.soa.esb.lib.dir"
+            value="${org.jboss.soa.esb.lib.src.dir}"/>
+
+
+	<!-- classpath -->
+	<path id="org.jboss.esb.samples.trailblazer.esb.classpath">
+		<fileset dir="${org.jboss.esb.samples.trailblazer.esb.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${org.jboss.soa.esb.lib.dir}/ext" includes="*.jar"/>
+		<fileset dir="${org.jboss.soa.samples.trailblazer.jboss_home}/client" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+		<fileset dir="${org.jboss.soa.esb.lib.dir}" includes="*.jar"/>
+	</path>
+
+	<!-- classpath for running the listener-->
+	<path id="org.jboss.esb.samples.trailblazer.esb.classpath.run">
+		<fileset dir="${org.jboss.esb.samples.trailblazer.esb.dest}/dist" includes="trailblazer-esb.jar"/>
+		<fileset dir="${org.jboss.soa.samples.trailblazer.esb_home}/lib/ext" includes="*.jar"/>
+		<fileset dir="${org.jboss.soa.esb.lib.dir}/ext" includes="*.jar"/>
+		<!-- for finding the jbossesb-properties.xml file -->
+		<fileset dir="${org.jboss.soa.samples.trailblazer.esb_home}/install/conf" includes="*.jar"/>	
+	</path>
+
+	<target name="clean">
+		<delete dir="${org.jboss.esb.samples.trailblazer.esb.dest}" />
+	</target>
+	
+	<!-- =================================================================== -->
+	<!-- Prepares the directory structure                                    -->
+	<!-- =================================================================== -->
+	<target name="org.jboss.esb.samples.trailblazer.esb.prepare">
+		<mkdir dir="${org.jboss.esb.samples.trailblazer.esb.dest}"/>
+		<mkdir dir="${org.jboss.esb.samples.trailblazer.esb.dest}/dist"/>
+		<mkdir dir="${org.jboss.esb.samples.trailblazer.esb.dest}/classes/esb"/>
+	</target>
+
+	<!-- Compilation targets -->
+	<target name="org.jboss.esb.samples.trailblazer.esb.compile" depends="org.jboss.esb.samples.trailblazer.esb.prepare"
+		description="Compile all classes">
+
+		<javac
+		            destdir="${org.jboss.esb.samples.trailblazer.esb.classes.dir}"
+		            classpathref="org.jboss.esb.samples.trailblazer.esb.classpath"
+		        	debug="true"
+		        	>
+			<src path="${org.jboss.esb.samples.trailblazer.esb.src.dir}"/>
+		</javac>
+
+	</target>
+
+	<!-- javadocs paths -->
+	<path id="org.jboss.esb.samples.trailblazer.esb.javadocs.path">
+		<pathelement path="esb/classes"/>
+	</path>
+
+	<!-- Jar targets -->
+	<target name="org.jboss.esb.samples.trailblazer.esb.jar" depends="org.jboss.esb.samples.trailblazer.esb.compile" >
+		<echo message="Building Trailblazer ESB jar file"/>
+		<delete file="${org.jboss.esb.samples.trailblazer.esb.dest}/dist/trailblazer-esb.jar" />
+		<jar    destfile="${org.jboss.esb.samples.trailblazer.esb.dest}/dist/trailblazer-esb.jar" 
+                basedir="${org.jboss.esb.samples.trailblazer.esb.classes.dir}" 
+                includes="**/*.class" excludes="**/web/*.class"
+                />
+	</target>
+
+	<!-- Short target names -->
+	<target name="compile" depends="org.jboss.esb.samples.trailblazer.esb.compile"/>
+	<target name="jar" depends="org.jboss.esb.samples.trailblazer.esb.jar"/>
+
+	<!-- run the listener -->
+	<target name="runESB" depends="org.jboss.esb.samples.trailblazer.esb.jar">
+		<echo>Running ESB Trailblazer listeners</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.trailblazer.util.Launcher" failonerror="true" 
+			args="10 /home/dbrum/dev/jbossesb/product/samples/trailblazer2/conf/jbossesb-trailblazer.xml">
+			<classpath refid="org.jboss.esb.samples.trailblazer.esb.classpath"/>
+			<classpath refid="org.jboss.esb.samples.trailblazer.esb.classpath.run"/>
+		</java>
+	</target>
+
+		
+</project>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/deployment.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/deployment.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/deployment.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue</depends>
+  <depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier</depends>
+</jbossesb-deployment>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	 <depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+</server>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier">
+  <depends optional-attribute-name="DestinationManager">
+  	jboss.mq:service=DestinationManager
+  </depends>
+</mbean>
+
+</server>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,140 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" 
+	parameterReloadSecs="5000">
+
+	<providers>
+		<jms-provider name="JBossMQ" connection-factory="ConnectionFactory" 
+					jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+					jndi-URL="localhost">
+			<jms-bus busid="creditAgencyRequest">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-creditAgencyQueue" selector="function='request'"/>
+			</jms-bus>
+			<jms-bus busid="jmsBankRequest">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-jmsBankRequestQueue"/>
+			</jms-bus>			
+			<jms-bus busid="fileBankRequest">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-fileBankRequestQueue"/>
+			</jms-bus>			
+			<jms-bus busid="jmsBankResponseGateway">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-jmsBankGatewayResponseQueue"/>
+			</jms-bus>			
+			<jms-bus busid="jmsBankResponseListener">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-jmsBankResponseQueue"/>
+			</jms-bus>
+			<jms-bus busid="fileBankResponseListener">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-fileBankResponseQueue"/>
+			</jms-bus>
+			<jms-bus busid="customerNotifier">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/esb-tb-customerNotifier"/>
+			</jms-bus>
+		</jms-provider>
+
+        <fs-provider name="FSprovider1">
+          	<fs-bus busid="fileBankChannel" >
+          		<fs-message-filter
+          			directory="/tmp/output"
+          			input-suffix=".quote"
+          			work-suffix=".esbWorking"
+          			post-delete="true"
+          			error-delete="true" />
+          	</fs-bus>
+        </fs-provider>
+	</providers>
+	<services>    
+		
+		<service category="tbCreditAGency" name="creditagency" description="Credit Agency Service">
+			<listeners>
+				<jms-listener name="trailblazer-jmscreditagency"
+							  busidref="creditAgencyRequest"
+							  maxThreads="1"/>							  
+			</listeners>
+			<actions>
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.CreditCheckXMLToCSVActions"
+					process="handle" name="XMLToCSV">
+				</action>
+                                <!--action name="transform-from-csv" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+                                      <property name="resource-config" value="/smooks-xml2csv.xml" />
+                                </action-->
+
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.CreditAgencyActions"
+					process="processCreditRequest" name="fido">
+				</action>
+                                <action name="transform-from-csv" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+                                       <property name="resource-config" value="/smooks-csv2xml.xml" />
+                                </action>
+				<!--action class="org.jboss.soa.esb.samples.trailblazer.actions.CreditCheckCSVToXMLActions"
+					process="handle" name="CSVToXML">
+				</action-->
+			</actions>
+		</service>
+		<service category="tbBanks" name="jmsBank" description="JMS Bank Service">
+			<listeners>
+				<jms-listener name="trailblazer-jmsbankreq"
+							  busidref="jmsBankRequest"
+							  maxThreads="1"/>							  
+				</listeners>
+			<actions mep="OneWay" >
+				<action class="org.jboss.soa.esb.actions.routing.JMSRouter"
+								name="jmsBankAction" >
+     				<property name="jndiName" value="queue/jms-tb-jmsBankRequestQueue" />
+     				<property name="unwrap" value="true" />
+				</action>
+			</actions>
+		</service>
+		<service category="tbJmsbank" name="jmsbankreplies" description="Trailblazer JMS Bank Reply Service">
+			<listeners>
+				<jms-listener name="trailblazer-jmsbankrespgw"
+					busidref="jmsBankResponseGateway"
+					maxThreads="1"
+					is-gateway="true"/>
+				<jms-listener name="trailblazer-jmsbankreplies"
+							  busidref="jmsBankResponseListener"
+							  maxThreads="1"/> 
+			</listeners>
+			<actions>
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.BankResponseActions"
+						process="processResponseFromJMSBank" name="pepe"/>
+			</actions>
+		</service>
+		<service category="tbBanks" name="fileBank" description="File Bank Service">
+			<listeners>
+				<jms-listener name="trailblazer-filebankreq"
+							  busidref="fileBankRequest"
+							  maxThreads="1"/>							  
+				</listeners>
+			<actions mep="OneWay" >
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.FileBankRequestActions"
+								process="processFileBankRequest" name="fileBankRequestAction" >
+				</action>
+			</actions>
+		</service>
+		<service category="tbFilebank" name="filebankreplies" description="Trailblazer File Bank Reply Service">
+			<listeners>
+            	<fs-listener name="FileGateway"
+            		busidref="fileBankChannel"
+            		maxThreads="1"
+            		is-gateway="true"
+            		schedule-frequency="10" />
+				<jms-listener name="trailblazer-filebankreplies"
+							  busidref="fileBankResponseListener"
+							  maxThreads="1"/> 
+			</listeners>
+			<actions>
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.BankResponseActions"
+						process="processResponseFromFileBank" name="filebankin"/>
+			</actions>
+		</service>
+		<service category="notifiers" name="customer" description="Customer Notification Service">
+			<listeners>
+				<jms-listener name="trailblazer-custnotifier"
+							  busidref="customerNotifier"
+							  maxThreads="1"/>							  
+				</listeners>
+			<actions mep="OneWay" >
+				<action class="org.jboss.soa.esb.samples.trailblazer.actions.NotifyCustomerActions"
+						process="notifyCustomer" name="notify"/>
+			</actions>
+		</service>
+	</services>
+	
+</jbossesb>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., 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.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+    </properties>
+    <properties name="registry">
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/>
+    	<property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+    	<property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+    	<property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+    	
+    	<!--  connection manager type -->
+	    <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" 		value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>	 -->    
+	     <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+	    
+	    <!-- this property is only used if using the j2ee connection manager -->
+	    <property name="org.jboss.soa.esb.persistence.db.datasource.name" 	value="java:/JBossESBDS"/>
+		
+		<!-- standalone connection pooling settings -->
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 				value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 				value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"		value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"		value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+		
+    </properties>
+	    
+    <properties name="filters">
+    	<property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+    	<property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+	<property name="org.jboss.soa.esb.filter.3" value="org.pi4soa.jbossesb.monitor.MonitorFilter" />
+    </properties>
+</esb>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., 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.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+    </properties>
+    <properties name="registry">
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/>
+    	<property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+    	<property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+    	<property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+    	<property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+    	
+    	<!--  connection manager type -->
+	    <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" 		value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>	 -->    
+	     <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+	    
+	    <!-- this property is only used if using the j2ee connection manager -->
+	    <property name="org.jboss.soa.esb.persistence.db.datasource.name" 	value="java:/JBossESBDS"/>
+		
+		<!-- standalone connection pooling settings -->
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 				value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 				value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"		value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"		value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+		
+    </properties>    
+    <properties name="filters">
+    	<property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+    	<property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+    </properties>
+</esb>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/log4j.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/log4j.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/log4j.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A time/date based rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="File" value="./trailblazer.log"/>
+      <param name="Append" value="false"/>
+
+      <!-- Rollover at midnight each day -->
+      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+      <!-- Rollover at the top of each hour
+      <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+      -->
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+         <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+          -->
+      </layout>
+   </appender>
+
+   <!-- A size based file rolling appender
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.log.dir}/server.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>	    
+   </appender>
+   -->
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ====================== -->
+   <!-- More Appender examples -->
+   <!-- ====================== -->
+
+   <!-- Buffer events and log them asynchronously
+   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <appender-ref ref="FILE"/>
+     <appender-ref ref="CONSOLE"/>
+     <appender-ref ref="SMTP"/>
+   </appender>
+   -->
+
+   <!-- EMail events to an administrator
+   <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="To" value="admin at myhost.domain.com"/>
+     <param name="From" value="nobody at myhost.domain.com"/>
+     <param name="Subject" value="JBoss Sever Errors"/>
+     <param name="SMTPHost" value="localhost"/>
+     <param name="BufferSize" value="10"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Syslog events
+   <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Facility" value="LOCAL7"/>
+     <param name="FacilityPrinting" value="true"/>
+     <param name="SyslogHost" value="localhost"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Log events to JMS (requires a topic to be created)
+   <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
+     <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
+   </appender>
+   -->
+
+   <!-- Log events through SNMP
+   <appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+     <param name="ManagementHost" value="127.0.0.1"/>
+     <param name="ManagementHostTrapListenPort" value="162"/>
+     <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+     <param name="LocalIPAddress" value="127.0.0.1"/>
+     <param name="LocalTrapSendPort" value="161"/>
+     <param name="GenericTrapType" value="6"/>
+     <param name="SpecificTrapType" value="12345678"/>
+     <param name="CommunityString" value="public"/>
+     <param name="ForwardStackTraceWithTrap" value="true"/>
+     <param name="Threshold" value="DEBUG"/>
+     <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
+     <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!--  Emit events as JMX notifications
+   <appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      
+      <param name="Threshold" value="WARN"/>
+      <param name="ObjectName" value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+      
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d %-5p [%c] %m"/>
+      </layout>
+   </appender>
+   -->
+   
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+   <category name="org.jboss.serial">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+   <category name="org.jgroups">
+      <priority value="WARN"/>
+   </category>
+
+   <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+   <category name="jacorb">
+      <priority value="WARN"/>
+   </category>
+   
+
+   <!-- Limit the JSR77 categories -->
+   <category name="org.jboss.management">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit Axis based webservice category -->
+   <category name="org.jboss.webservice">
+      <priority value="DEBUG"/>
+   </category>
+   <category name="org.jboss.axis">
+      <priority value="INFO"/>
+   </category>
+
+   <category name="org.milyn">
+      <priority value="INFO"/>
+   </category>
+   <category name="org.milyn.delivery.SmooksXML">
+      <priority value="INFO"/>
+   </category>
+   <category name="org.milyn.delivery.serialize.Serializer">
+      <priority value="INFO"/>
+   </category>
+   <category name="org.milyn.cdr.XMLConfigDigester">
+      <priority value="INFO"/>
+   </category>
+   <category name="org.jboss.soa.esb.samples.trailblazer">
+      <priority value="INFO"/>
+   </category>
+
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+   <!-- Clustering logging -->
+   <!-- Uncomment the following to redirect the org.jgroups and
+      org.jboss.ha categories to a cluster.log file.
+
+   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>
+   </appender>
+   <category name="org.jgroups">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   <category name="org.jboss.ha">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   -->
+
+</log4j:configuration>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+	<resource-config selector="org.xml.sax.driver">
+		<resource>org.milyn.csv.CSVParser</resource>
+		<param name="fields" type="string-list">
+			ssn,score
+	     </param>
+	</resource-config>
+	
+	<resource-config selector="csv-set">
+        <resource type="xsl">
+            <![CDATA[
+                    <creditCheckResult ssn="{csv-record/ssn}" score="{csv-record/score}" />
+            ]]>
+        </resource>
+        <param name="is-xslt-templatelet">true</param>
+    </resource-config>
+		
+</smooks-resource-list>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+	<resource-config selector="creditCheck">
+	<resource>/xml2csv.xsl</resource>
+    <param name="is-xslt-templatelet">false</param>
+	</resource-config>	
+</smooks-resource-list>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+				version="1.0">
+	<xsl:output method="text" encoding="UTF-8" />
+	<xsl:variable name="delimiter">,</xsl:variable>
+	<xsl:template match="creditCheck">
+        <xsl:value-of select="@name"/>
+        <xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@ssn"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@address"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@employerName"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@salary"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@loanAmount"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@loanDuration"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@email"/>
+		<xsl:value-of select="$delimiter"/>
+        <xsl:value-of select="@creditScore"/>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,80 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.samples.trailblazer.util.ProcessEmail;
+
+public class BankResponseActions extends AbstractActionLifecycle {
+	
+	protected ConfigTree	_config;
+	
+    private final String SERVICE_NAME = "customer";
+    private final String SERVICE_CAT = "notifiers";
+    private ServiceInvoker notifierInvoker;
+
+	private static Logger _logger = Logger.getLogger(BankResponseActions.class);
+	
+	public BankResponseActions(ConfigTree config) {
+		_config = config;
+		
+        try {
+        	notifierInvoker = new ServiceInvoker(SERVICE_CAT, SERVICE_NAME);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + SERVICE_CAT + ":" + SERVICE_NAME + "'.", e);
+        }
+  	}
+	
+	public Message processResponseFromJMSBank(Message message) throws Exception {
+		System.out.println("Got the message from the JMS bank: " + message.getBody().get());
+		
+		_logger.debug("JMS bank message received: \n" + message.getBody().get());
+		
+        Message notifyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        notifyMessage.getBody().add(message.getBody().get());
+		
+        notifierInvoker.deliverAsync(notifyMessage);
+
+        return null;
+	}
+	
+	public Message processResponseFromFileBank(Message message) throws Exception {
+		String mesg=new String((byte[])message.getBody().get());
+		
+		System.out.println("Got the message from the File bank: " + mesg);
+		
+		_logger.debug("File bank message received: \n" + mesg);
+		
+        Message notifyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        notifyMessage.getBody().add(mesg);
+		
+        notifierInvoker.deliverAsync(notifyMessage);
+
+        return null;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,79 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @daniel.brum at jboss.com
+ */
+
+import java.util.Random;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditAgencyActions extends AbstractActionLifecycle {
+	protected ConfigTree	_config;
+	
+	private static Logger _logger = Logger.getLogger(CreditAgencyActions.class);
+	
+	public CreditAgencyActions(ConfigTree config) { _config = config; }
+	
+	public Message noOperation(Message message) { return message; }
+	
+	public Message processCreditRequest(Message message) throws Exception{
+		
+		_logger.debug("message received: " + Util.serialize(message) );		
+		
+		String csvData = (String)message.getBody().get();
+		_logger.debug("csv data received: " + csvData);
+		
+		String[] parts=csvData.split(",");
+		
+		//generate a random score between 1 and 10
+		Random rand = new Random();
+		int n = 10;
+		int score = rand.nextInt(n+1);
+		
+		//send back the reply
+        Message replyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);		
+		
+        _logger.info("CreditAgency sending back a credit score of " + score);
+        
+        // Return the unique customer ref (ssn) and the score
+        String resp=parts[1]+","+score;
+        replyMessage.getBody().add(resp);
+		
+		return replyMessage;
+	}
+	
+	public Message debugMessage(Message message) throws Exception{
+		
+		_logger.debug("message received in processCreditRequest with message: " + Util.serialize(message));
+
+		
+		
+		return message;
+	}
+}
+
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @daniel.brum at jboss.com
+ */
+
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditCheckCSVToXMLActions extends AbstractActionLifecycle {
+	protected ConfigTree	_config;
+	
+	private static Logger _logger = Logger.getLogger(CreditCheckCSVToXMLActions.class);
+	
+	public CreditCheckCSVToXMLActions(ConfigTree config) { _config = config; }
+	
+	public Message handle(Message message) throws Exception{
+		
+		_logger.debug("CSV message received: " + Util.serialize(message) );		
+		
+		String csv=(String)message.getBody().get();
+		
+		String[] parts=csv.split(",");
+		
+		String xml="<creditCheckResult ssn=\""+parts[0]+
+					"\" score=\""+parts[1]+"\" />";
+
+		_logger.debug("XML data to return" + xml);
+				
+		//send back the reply
+        Message replyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);		
+		
+        replyMessage.getBody().add(xml);
+		
+		return replyMessage;
+	}
+}
+
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,89 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @daniel.brum at jboss.com
+ */
+
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditCheckXMLToCSVActions extends AbstractActionLifecycle {
+	protected ConfigTree	_config;
+	
+	private static Logger _logger = Logger.getLogger(CreditCheckXMLToCSVActions.class);
+	
+	public CreditCheckXMLToCSVActions(ConfigTree config) { _config = config; }
+	
+	public Message handle(Message message) throws Exception{
+		
+		_logger.debug("XML message received: " + Util.serialize(message) );		
+		
+		String xml=(String)message.getBody().get();
+		String csvData=null;
+		
+		try {
+			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+			fact.setNamespaceAware(true);
+			
+			java.io.InputStream xmlstr=
+				new java.io.ByteArrayInputStream(xml.getBytes());
+
+			DocumentBuilder builder=fact.newDocumentBuilder();
+			org.w3c.dom.Document doc=builder.parse(xmlstr);
+			
+			org.w3c.dom.Element tree = doc.getDocumentElement();
+			
+			csvData = (tree.getAttribute("name")+","+
+					tree.getAttribute("ssn")+","+
+					tree.getAttribute("address")+","+
+					tree.getAttribute("employerName")+","+
+					tree.getAttribute("salary")+","+
+					tree.getAttribute("loanAmount")+","+
+					tree.getAttribute("loanDuration")+","+
+					tree.getAttribute("email")+","+
+					tree.getAttribute("creditScore"));
+
+		} catch(Exception ex) {
+			_logger.error(ex.getMessage(), ex);
+		}
+
+		_logger.debug("CSV data to return" + csvData);
+				
+		//send back the reply
+        Message replyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);		
+		
+        replyMessage.getBody().add(csvData);
+		
+		
+		return replyMessage;
+	}
+}
+
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.samples.trailblazer.util.TrailblazerProperties;
+
+public class FileBankRequestActions extends AbstractActionLifecycle {
+	
+	protected ConfigTree	_config;
+    private Properties properties = new TrailblazerProperties();
+	
+    private static final String BANK_REQUEST_DIR="file.bank.monitored.dir";
+    
+    private String m_bankRequestDir=null;
+    
+	private static Logger _logger = Logger.getLogger(FileBankRequestActions.class);
+	
+	public FileBankRequestActions(ConfigTree config) {
+		_config = config;
+		m_bankRequestDir = properties.getProperty(BANK_REQUEST_DIR);
+  	}
+	
+	public Message processFileBankRequest(Message message) throws Exception {
+		System.out.println("Got the message for the File bank: " + message.getBody().get());
+		
+		_logger.debug("File bank message received: \n" + message.getBody().get());
+		
+		java.io.File dir=new java.io.File(m_bankRequestDir);
+		
+		java.io.File f=java.io.File.createTempFile("FileBank", "tb", dir);
+		
+		java.io.FileOutputStream fos=new java.io.FileOutputStream(f);
+		
+		fos.write(((String)message.getBody().get()).getBytes());
+		
+		fos.flush();
+		fos.close();
+		
+        return null;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,63 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.samples.trailblazer.util.ProcessEmail;
+
+public class NotifyCustomerActions extends AbstractActionLifecycle {
+	
+	protected ConfigTree	_config;
+	
+	private static Logger _logger = Logger.getLogger(NotifyCustomerActions.class);
+	
+	public NotifyCustomerActions(ConfigTree config) { _config = config; }
+	
+	public Message notifyCustomer(Message message) throws Exception {
+		
+		_logger.debug("message received: \n" + message.getBody().get());
+		
+		//get the quote response and send it to the customer
+		ConfigTree tree = ConfigTree.fromXml((String)message.getBody().get());		
+
+		String quoteID = tree.getFirstTextChild("quoteId");
+		String rate = tree.getFirstTextChild("interestRate");
+		String errorCode = tree.getFirstTextChild("errorCode");
+		String ssn = tree.getFirstTextChild("customerUID");
+		String email = tree.getFirstTextChild("customerEmail");
+				
+		_logger.debug("info using for email: " + quoteID +" "+rate+" "+errorCode+" "+ssn+" "+email);
+		
+		
+		_logger.debug("preparing to send the quote response via email to customer");
+		ProcessEmail procEmail = new ProcessEmail(email, quoteID, rate, errorCode, ssn);
+		procEmail.sendEmail();
+		
+		System.out.println("Sent email to: " +email);
+		
+		
+		return null;
+	}
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.sql.DriverManager;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.hsqldb.Server;
+/**
+ * Utility to start and stop a hsql Database.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class HsqldbUtil 
+{
+	final private static String THREAD_NAME = "hypersonic-unittest";
+	
+	private static Logger _logger = Logger.getLogger(HsqldbUtil.class);
+	/**
+	 * Starts the hsql database in it's own thread. 
+	 * Don't forget to shut it down when you're done.
+	 * 
+	 * @param databaseFile - i.e. build/hsqltestdb
+	 * @param databaseName - i.e. jbossesb
+	 * @throws Exception
+	 */
+	public static void startHsqldb(final String databaseFile,
+			final String databaseName) throws Exception 
+	{
+		// Start DB in new thread, or else it will block us
+		Thread serverThread = new Thread(THREAD_NAME) {
+			public void run() {
+				try {
+					// Create startup arguments
+					String[] args = new String[4];
+					args[0] = "-database.0";
+					args[1] = databaseFile;
+					args[2] = "-dbname.0";
+					args[3] = databaseName;
+					
+					_logger.info("creating db from this script: " + databaseFile);
+
+					// Start server
+					Server.main(args);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+//				log.error("Failed to start database", e);
+			}
+		};
+		serverThread.run();
+	}
+	/**
+	 * 
+	 * @param url
+	 * @param username
+	 * @param password
+	 * @throws Exception
+	 */
+	public static void stopHsqldb(String url, String username, String password) throws Exception {
+		java.sql.Connection connection = DriverManager.getConnection(
+				url, username, password);
+		Statement statement = connection.createStatement();
+		String shutdownCommand = "SHUTDOWN COMPACT";
+		statement.executeQuery(shutdownCommand);
+	}
+
+	
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.util.Properties;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.antlr.stringtemplate.StringTemplateGroup;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.Email;
+
+
+public class ProcessEmail {
+	
+	private Logger logger = Logger.getLogger(this.getClass());	
+	private String emailTo, quoteID, rate, code, ssn;
+    private Properties properties = new TrailblazerProperties();
+
+    public ProcessEmail(String email, String quoteID, String rate, String code, String ssn) {
+		this.emailTo=email;
+		this.quoteID=quoteID;
+		this.rate=rate;
+		this.code=code;
+		this.ssn=ssn;
+		logger.debug("creating email helper");
+						
+	}
+	
+	public void sendEmail() {		
+		try {
+			if (null==emailTo) {
+				logger.error("no email found for customer, aborting send");
+				return;
+			}
+			logger.info("customer SSN " + ssn + " - sending email to: " + emailTo);
+			Email emailMessage = new Email();			
+			emailMessage.setSendTo(emailTo);
+			emailMessage.setSubject("TrailBlazer Quote from Bank");
+			String emailFrom = properties.getProperty("email.from");
+			emailMessage.setFrom(emailFrom);
+//			File emailTemplate = new File(LoanBrokerConstants.EMAIL_TEMPLATE);
+//			String quoteMsg=FileUtil.readTextFile(emailTemplate);
+			emailMessage.setMessage(fillTemplate());
+			emailMessage.sendMessage();			
+		}catch (Exception e) {			
+			logger.error("error sending email - " + e);	
+			e.printStackTrace();		
+		}		
+	}
+	
+	private String fillTemplate() throws Exception{
+		String templatePath = properties.getProperty("email.template.path", "template");
+		String templateFile = properties.getProperty("email.template.file", "quote");
+		                 
+		logger.info("loading StringTemplate from path: "+templatePath);
+		logger.info("loading StringTemplate from file: "+templateFile);
+		
+		StringTemplateGroup group =  new StringTemplateGroup("loan");
+		StringTemplate email = group.getInstanceOf(templatePath + "/" + templateFile);
+		
+		//String email, String quoteID, String rate, String code, String ssn
+		email.setAttribute("quote", quoteID);
+		email.setAttribute("rate", rate);
+		email.setAttribute("ssn", ssn);
+		email.setAttribute("code", code);
+		email.setAttribute("email", emailTo);
+		
+		return email.toString();
+		
+	}
+	
+	public static void main(String[] args) {
+		ProcessEmail email = new ProcessEmail("dbrum101 at gmail.com", "111", ".65", "0", "123456");
+		email.sendEmail();
+		
+	}
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.jboss.soa.esb.persistence.manager.ConnectionManager;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.listeners.StandAloneBootStrapper;
+import org.jboss.soa.esb.persistence.manager.ConnectionManagerFactory;
+import org.jboss.soa.esb.testutils.FileUtil;
+//import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+public class TbBootStrapper extends StandAloneBootStrapper {
+	
+	protected static Logger _logger = Logger.getLogger(TbBootStrapper.class);
+	
+	public static void main(String[] args) throws Exception
+	{
+		Exception eT = null;
+		if (args.length < 1)
+		{
+			eT = new Exception ("No configuration file specified - Ending immediately");
+			_logger.fatal(eT);
+			throw eT;
+		} else {
+			_logger.info("Starting the trailblazer with arg=" + args[0]);
+		}
+		TbBootStrapper boot = null;
+
+		String configName = args[0];
+		long lSecondsToRun = 365 * 24 * 3600;   // run for 1 year (is it enough ?)
+		if (args.length > 1)
+			try 
+		{ 
+			lSecondsToRun = Long.parseLong(args[1]);
+		}
+		catch (Exception e)
+		{
+			_logger.fatal(e);
+			throw e;
+		}
+		try
+		{
+			boot = new TbBootStrapper(configName);
+			if (lSecondsToRun < 5)
+				lSecondsToRun = 5;
+			long lRunTo = System.currentTimeMillis()+1000*lSecondsToRun;
+
+			while (System.currentTimeMillis() < lRunTo)
+				try { Thread.sleep(1000); }
+				catch (InterruptedException e) { break; }
+		}
+		finally
+		{
+			if (null!=boot)
+				boot.requestEnd();
+		}
+	}
+	
+	private TbBootStrapper() throws Exception {super(null);}
+	
+	public TbBootStrapper (String configName) throws Exception
+	{
+		super(configName, null);
+	}
+	
+	public TbBootStrapper (String configName, String validationFileName) throws Exception 
+	{
+		super(configName, validationFileName);		
+	}
+
+	/*
+	 * Setup HSQLDB for the Registry and the MessageStore
+	 */
+	protected void runBefore(){	
+		//System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "on");
+		String baseDir="";
+		String productDir = "../../";
+		if (TestEnvironmentUtil.getUserDir("trailblazer").equals("trailblazer/")) {
+			baseDir = "product/samples/trailblazer/";
+			productDir = "product/";
+		}
+		DOMConfigurator.configure(baseDir + "log4j.xml");
+		String driver = Configuration.getStoreDriver();
+		System.out.println("Driver=" + driver);
+		if ("org.hsqldb.jdbcDriver".equals(driver)) {
+			
+			//start hsqldb
+			try {
+			HsqldbUtil.startHsqldb(productDir + "build/hsqldb", "jbossesb");
+			String database = "hsqldb";	
+			
+			//message store db
+			String sqlDir = productDir + "install/message-store/sql/" + database + "/";
+			String sqlCreateCmd    = TestEnvironmentUtil.readTextFile(new File(sqlDir + "create_database.sql"));
+			String sqlDropCmd      = TestEnvironmentUtil.readTextFile(new File(sqlDir + "drop_database.sql"));		
+			
+			ConnectionManager mgr = ConnectionManagerFactory.getConnectionManager();
+			Connection con = mgr.getConnection();
+			
+			Statement stmnt = con.createStatement();
+			System.out.println("Dropping the message store schema if exists...");
+			stmnt.execute(sqlDropCmd);
+			System.out.println("Creating the message store schema...");
+			stmnt.execute(sqlCreateCmd);
+			
+			//registry DB
+			sqlDir = productDir + "install/jUDDI-registry/sql/" + database + "/";
+			System.out.println("Dropping the registry schema if exists...");
+			sqlDropCmd      = TestEnvironmentUtil.readTextFile(new File(sqlDir + "drop_database.sql")).replaceAll("\\$\\{prefix}", "");
+			stmnt.execute(sqlDropCmd);
+			System.out.println("creating the registry schema...");
+            String resource = "juddi-sql/" + database + "/create_database.sql";
+            InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+            sqlCreateCmd    = FileUtil.readStream(is).trim().replaceAll("\\$\\{prefix}", "");
+			stmnt.execute(sqlCreateCmd);
+			System.out.println("inserting registry publishers...");
+			String sqlInsertPubCmd = TestEnvironmentUtil.readTextFile(new File(sqlDir + "import.sql")).trim().replaceAll("\\$\\{prefix}", "");
+			stmnt.execute(sqlInsertPubCmd);
+			stmnt.close();
+			con.close();
+			}catch(Exception e) {
+				e.printStackTrace();
+			}
+		}
+		}
+		
+	/*
+	 * Shuts down the HSQLDB instance
+	 */
+		protected void runAfter()
+		{
+			try { Thread.sleep(5000); }
+			catch (InterruptedException e) {}
+			
+			//shutdown message store if using hsqldb
+			if ("org.hsqldb.jdbcDriver".equals(Configuration.getStoreDriver())) {
+				try {
+					HsqldbUtil.stopHsqldb(Configuration.getStoreUrl(),
+							Configuration.getStoreUser(),Configuration.getStorePwd() );
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				}
+		}
+
+	
+
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Trilablazer Properties.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class TrailblazerProperties extends Properties {
+
+    private static final long serialVersionUID = 1L;
+    public static final String CONFIG_FILE = "trailblazer.properties";
+    private static Logger logger = Logger.getLogger(TrailblazerProperties.class);
+
+    public TrailblazerProperties() {
+        InputStream config = ClassUtil.getResourceAsStream("/" + CONFIG_FILE, TrailblazerProperties.class);
+
+        if(config == null) {
+            logger.error("Failed to locate '" + CONFIG_FILE + "' in the root of the classpath.");
+            return;
+        }
+
+        try {
+            load(config);
+        } catch (IOException e) {
+            logger.error("Error reading '" + CONFIG_FILE + "'.", e);
+        } finally {
+            try {
+                config.close();
+            } catch (IOException e) {
+                logger.warn("Failed to close stream to '" + CONFIG_FILE + "'.");
+            }
+        }
+    }
+}

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/juddi.properties
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/juddi.properties	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/juddi.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,70 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=org.hsqldb.jdbcDriver
+#juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/jbossesb
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost:9001/jbossesb
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/log4j.xml
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/log4j.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/log4j.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A time/date based rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="File" value="./trailblazer.log"/>
+      <param name="Append" value="false"/>
+
+      <!-- Rollover at midnight each day -->
+      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+      <!-- Rollover at the top of each hour
+      <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+      -->
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+         <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+          -->
+      </layout>
+   </appender>
+
+   <!-- A size based file rolling appender
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.log.dir}/server.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>	    
+   </appender>
+   -->
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="DEBUG"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ====================== -->
+   <!-- More Appender examples -->
+   <!-- ====================== -->
+
+   <!-- Buffer events and log them asynchronously
+   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <appender-ref ref="FILE"/>
+     <appender-ref ref="CONSOLE"/>
+     <appender-ref ref="SMTP"/>
+   </appender>
+   -->
+
+   <!-- EMail events to an administrator
+   <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="To" value="admin at myhost.domain.com"/>
+     <param name="From" value="nobody at myhost.domain.com"/>
+     <param name="Subject" value="JBoss Sever Errors"/>
+     <param name="SMTPHost" value="localhost"/>
+     <param name="BufferSize" value="10"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Syslog events
+   <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Facility" value="LOCAL7"/>
+     <param name="FacilityPrinting" value="true"/>
+     <param name="SyslogHost" value="localhost"/>
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!-- Log events to JMS (requires a topic to be created)
+   <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="Threshold" value="ERROR"/>
+     <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
+     <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
+   </appender>
+   -->
+
+   <!-- Log events through SNMP
+   <appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+     <param name="ManagementHost" value="127.0.0.1"/>
+     <param name="ManagementHostTrapListenPort" value="162"/>
+     <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+     <param name="LocalIPAddress" value="127.0.0.1"/>
+     <param name="LocalTrapSendPort" value="161"/>
+     <param name="GenericTrapType" value="6"/>
+     <param name="SpecificTrapType" value="12345678"/>
+     <param name="CommunityString" value="public"/>
+     <param name="ForwardStackTraceWithTrap" value="true"/>
+     <param name="Threshold" value="DEBUG"/>
+     <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
+     <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
+     </layout>
+   </appender>
+   -->
+
+   <!--  Emit events as JMX notifications
+   <appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      
+      <param name="Threshold" value="WARN"/>
+      <param name="ObjectName" value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+      
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d %-5p [%c] %m"/>
+      </layout>
+   </appender>
+   -->
+   
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+   <category name="org.jboss.serial">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+   <category name="org.jgroups">
+      <priority value="WARN"/>
+   </category>
+
+   <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+   <category name="jacorb">
+      <priority value="WARN"/>
+   </category>
+
+   <!-- Limit JBoss categories
+   <category name="org.jboss">
+      <priority value="INFO"/>
+   </category>
+   -->
+
+   <!-- Limit the JSR77 categories -->
+   <category name="org.jboss.management">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit Axis based webservice category -->
+   <category name="org.jboss.webservice">
+      <priority value="DEBUG"/>
+   </category>
+   <category name="org.jboss.axis">
+      <priority value="INFO"/>
+   </category>
+
+   <!-- Limit JBossWS webservice category
+   <category name="org.jboss.ws">
+      <priority value="DEBUG"/>
+   </category>
+   -->
+
+   <!-- Decrease the priority threshold for the org.jboss.varia category
+   <category name="org.jboss.varia">
+     <priority value="DEBUG"/>
+   </category>
+   -->
+
+   <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]
+   <category name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   -->
+
+   <!--
+      | An example of enabling the custom TRACE level priority that is used
+      | by the JBoss internals to diagnose low level details. This example
+      | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+      | subpackages. This will produce A LOT of logging output.
+   <category name="org.jboss.system">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   <category name="org.jboss.ejb.plugins">
+     <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+   </category>
+   -->
+  
+   <!--
+       | Logs these events to SNMP:
+           - server starts/stops
+           - cluster evolution (node death/startup)
+           - When an EJB archive is deployed (and associated verified messages)
+           - When an EAR archive is deployed
+      	 
+   <category name="org.jboss.system.server.Server">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+  
+   <category name="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+
+   <category name="org.jboss.deployment.MainDeployer">
+     <priority value="ERROR" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+   
+   <category name="org.jboss.ejb.EJBDeployer">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+   
+   <category name="org.jboss.deployment.EARDeployer">
+     <priority value="INFO" />
+     <appender-ref ref="TRAP_LOG"/>
+   </category>
+  
+   -->
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+   <!-- Clustering logging -->
+   <!-- Uncomment the following to redirect the org.jgroups and
+      org.jboss.ha categories to a cluster.log file.
+
+   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>
+   </appender>
+   <category name="org.jgroups">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   <category name="org.jboss.ha">
+     <priority value="DEBUG" />
+     <appender-ref ref="CLUSTER"/>
+   </category>
+   -->
+
+</log4j:configuration>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/LoanRequest.scn
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/LoanRequest.scn	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/LoanRequest.scn	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="Cp1252"?>
+<scn:Scenario xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:scn="http://www.pi4soa.org/scenario" name="LoanRequest" description="Valid loan request" author="gary" choreographyDescriptionURL="TrailBlazer.cdm">
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="checkCredit" value="&lt;creditCheck name=&quot;Joe Broke&quot; ssn=&quot;1234567890&quot; address=&quot;1 Spenditall Str., BrokeTown 99999 DC&quot; employerName=&quot;&quot; salary=&quot;50000.0&quot; loanAmount=&quot;1000.0&quot; loanDuration=&quot;12&quot; email=&quot;gary at pi4tech.com&quot; creditScore=&quot;0&quot; />" serviceType="{http://www.pi4soa.org/TrailBlazer}creditAgency" messageType="creditCheck"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" value="&lt;creditCheck name=&quot;Joe Broke&quot; ssn=&quot;1234567890&quot; address=&quot;1 Spenditall Str., BrokeTown 99999 DC&quot; employerName=&quot;&quot; salary=&quot;50000.0&quot; loanAmount=&quot;1000.0&quot; loanDuration=&quot;12&quot; email=&quot;gary at pi4tech.com&quot; creditScore=&quot;0&quot; />" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}creditAgency" messageType="creditCheck"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" isRequest="false" value="&lt;creditCheckResult ssn=&quot;1234567890&quot; score=&quot;4&quot; />" serviceType="{http://www.pi4soa.org/TrailBlazer}creditAgency" messageType="creditCheckResult"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="checkCredit" isRequest="false" value="&lt;creditCheckResult ssn=&quot;1234567890&quot; score=&quot;4&quot; />" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}creditAgency" messageType="creditCheckResult"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="requestQuote" value="&lt;quoteRequest ssn=&quot;1234567890&quot; creditScore=&quot;0&quot; creditHistoryLen=&quot;0&quot; amount=&quot;1000&quot; term=&quot;12&quot; ref=&quot;1&quot; customerUID=&quot;1234567890&quot; customerEmail=&quot;gary at scribble.org&quot; />" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quoteRequest"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="requestQuote" value="&lt;quoteRequest ssn=&quot;1234567890&quot; creditScore=&quot;0&quot; creditHistoryLen=&quot;0&quot; amount=&quot;1000&quot; term=&quot;12&quot; ref=&quot;1&quot; customerUID=&quot;1234567890&quot; customerEmail=&quot;gary at scribble.org&quot; />" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quoteRequest"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="requestQuote" isRequest="false" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>JMSBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>1&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>&#xD;&#xA;" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="requestQuote" isRequest="false" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>JMSBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>1&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>&#xD;&#xA;" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="notify" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>JMSBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>1&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>" serviceType="{http://www.pi4soa.org/TrailBlazer}notifier" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.4" operationName="notify" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>JMSBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>1&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}notifier" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="requestQuote" value="&lt;quoteRequest ssn=&quot;1234567890&quot; creditScore=&quot;0&quot; creditHistoryLen=&quot;0&quot; amount=&quot;1000&quot; term=&quot;12&quot; ref=&quot;2&quot; customerUID=&quot;1234567890&quot; customerEmail=&quot;gary at scribble.org&quot; />" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quoteRequest"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.3" operationName="requestQuote" value="&lt;quoteRequest ssn=&quot;1234567890&quot; creditScore=&quot;0&quot; creditHistoryLen=&quot;0&quot; amount=&quot;1000&quot; term=&quot;12&quot; ref=&quot;2&quot; customerUID=&quot;1234567890&quot; customerEmail=&quot;gary at scribble.org&quot; />" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quoteRequest"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.3" operationName="requestQuote" isRequest="false" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>FileBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>2&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>&#xD;&#xA;" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="requestQuote" isRequest="false" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>FileBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>2&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>&#xD;&#xA;" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}bank" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="notify" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>FileBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>2&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>" serviceType="{http://www.pi4soa.org/TrailBlazer}notifier" messageType="quote"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.4" operationName="notify" value="&lt;quote>&#xD;&#xA;  &lt;interestRate>8.60&lt;/interestRate>&#xD;&#xA;  &lt;quoteId>FileBasedBank-0&lt;/quoteId>&#xD;&#xA;  &lt;ref>2&lt;/ref>&#xD;&#xA;  &lt;errorCode>0&lt;/errorCode>&#xD;&#xA;  &lt;customerUID>1234567890&lt;/customerUID>&#xD;&#xA;  &lt;customerEmail>gary at scribble.org&lt;/customerEmail>&#xD;&#xA;&lt;/quote>" direction="receive" serviceType="{http://www.pi4soa.org/TrailBlazer}notifier" messageType="quote"/>
+  <messageLinks source="//@scenarioObjects.0" target="//@scenarioObjects.1"/>
+  <messageLinks source="//@scenarioObjects.2" target="//@scenarioObjects.3"/>
+  <messageLinks source="//@scenarioObjects.4" target="//@scenarioObjects.5"/>
+  <messageLinks source="//@scenarioObjects.6" target="//@scenarioObjects.7"/>
+  <messageLinks source="//@scenarioObjects.8" target="//@scenarioObjects.9"/>
+  <messageLinks source="//@scenarioObjects.10" target="//@scenarioObjects.11"/>
+  <messageLinks source="//@scenarioObjects.12" target="//@scenarioObjects.13"/>
+  <messageLinks source="//@scenarioObjects.14" target="//@scenarioObjects.15"/>
+  <participants type="LoanBrokerParticipant"/>
+  <participants type="CreditAgencyParticipant"/>
+  <participants type="BankParticipant" instance="JMSBank"/>
+  <participants type="BankParticipant" instance="FileBank"/>
+  <participants type="NotifierParticipant"/>
+</scn:Scenario>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/TrailBlazer.cdm
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/TrailBlazer.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/models/TrailBlazer.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for TrailBlazer" name="TrailBlazer" author="gary" version="0.1" targetNamespace="http://www.pi4soa.org/TrailBlazer">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for TrailBlazer" prefix="tns" uRI="http://www.pi4soa.org/TrailBlazer"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <informationTypes description="This is the information type CreditCheckReq" name="CreditCheckReq" elementName="creditCheck"/>
+    <informationTypes description="This is the information type CreditCheckResp" name="CreditCheckResp" elementName="creditCheckResult"/>
+    <informationTypes description="This is the information type InsufficientCredit" name="InsufficientCredit" elementName="insufficientCredit"/>
+    <informationTypes description="This is the information type Quote" name="Quote" elementName="quote"/>
+    <informationTypes description="This is the information type QuoteRefType" name="QuoteRefType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type QuoteReq" name="QuoteReq" elementName="quoteRequest"/>
+    <informationTypes description="This is the information type SSNType" name="SSNType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URIType" name="URIType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token QuoteRef" name="QuoteRef" informationType="//@typeDefinitions/@informationTypes.4"/>
+    <tokens description="This is the token SSN" name="SSN" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URI" name="URI" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator QuoteRef4InsufficientCredit" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//ref/text()" name="QuoteRef4InsufficientCredit"/>
+    <tokenLocators description="This is the token locator QuoteRef4Quote" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//ref/text()" name="QuoteRef4Quote"/>
+    <tokenLocators description="This is the token locator QuoteRef4QuoteReq" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@ref" name="QuoteRef4QuoteReq"/>
+    <tokenLocators description="This is the token locator SSN4CreditCheckReq" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.0" query="//@ssn" name="SSN4CreditCheckReq"/>
+    <tokenLocators description="This is the token locator SSN4CreditCheckResp" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.1" query="//@ssn" name="SSN4CreditCheckResp"/>
+    <tokenLocators description="This is the token locator SSN4InsufficientCredit" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.2" query="//customerUID/text()" name="SSN4InsufficientCredit"/>
+    <tokenLocators description="This is the token locator SSN4Quote" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.3" query="//customerUID/text()" name="SSN4Quote"/>
+    <tokenLocators description="This is the token locator SSN4QuoteReq" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.5" query="//@ssn" name="SSN4QuoteReq"/>
+    <roleTypes description="This is the role type Bank" name="Bank">
+      <behaviors description="This is the behavior BankBehavior" name="BankBehavior" interface="bank"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="creditAgency"/>
+    </roleTypes>
+    <roleTypes description="This is the role type LoanBroker" name="LoanBroker">
+      <behaviors description="This is the behavior LoanBrokerBehavior" name="LoanBrokerBehavior" interface="loanBroker"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Notifier" name="Notifier">
+      <behaviors description="This is the behavior NotifierBehavior" name="NotifierBehavior" interface="notifier"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between LoanBroker and Bank" name="LoanBrokerToBankRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.0"/>
+    <relationshipTypes description="Relationship between LoanBroker and CreditAgency" name="LoanBrokerToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <relationshipTypes description="Relationship between LoanBroker and Notifier" name="LoanBrokerToNotifierRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.3"/>
+    <participantTypes description="This is the participant type BankParticipant" name="BankParticipant" roleTypes="//@typeDefinitions/@roleTypes.0"/>
+    <participantTypes description="This is the participant type CreditAgencyParticipant" name="CreditAgencyParticipant" roleTypes="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type LoanBrokerParticipant" name="LoanBrokerParticipant" roleTypes="//@typeDefinitions/@roleTypes.2"/>
+    <participantTypes description="This is the participant type NotifierParticipant" name="NotifierParticipant" roleTypes="//@typeDefinitions/@roleTypes.3"/>
+    <channelTypes description="This is the channel type BankChannelType" name="BankChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.0">
+      <identities description="SSN Id and Quote Ref" tokens="//@typeDefinitions/@tokens.1 //@typeDefinitions/@tokens.0"/>
+      <identities description="SSN Id" type="Association" tokens="//@typeDefinitions/@tokens.1"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="SSN Id" tokens="//@typeDefinitions/@tokens.1"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type NotifierChannelType" name="NotifierChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.3">
+      <identities description="SSN Id" type="Association" tokens="//@typeDefinitions/@tokens.1"/>
+      <identities description="SSN Id and Quote Ref" tokens="//@typeDefinitions/@tokens.1 //@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the TrailBlazer process" name="TrailBlazerProcess" root="true">
+    <enclosedChoreographies name="RequestQuote">
+      <variableDefinitions description="Channel to facilitate interaction to Bank" name="BankChannel" type="//@typeDefinitions/@channelTypes.0" roleTypes="//@typeDefinitions/@roleTypes.0 //@typeDefinitions/@roleTypes.2"/>
+      <variableDefinitions description="Channel to facilitate interaction to Notifier" name="NotifierChannel" type="//@typeDefinitions/@channelTypes.2" roleTypes="//@typeDefinitions/@roleTypes.2 //@typeDefinitions/@roleTypes.3"/>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="QuoteRequest" operation="requestQuote" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.0">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction QuoteRequest" name="QuoteRequestRequestExchange" type="//@typeDefinitions/@informationTypes.5">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-jmsBankRequestQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-fileBankRequestQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+        <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction QuoteRequest" name="QuoteRequestRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-jmsBankResponseQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-fileBankResponseQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="NotifyCustomer" operation="notify" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.2">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction NotifyCustomer" name="NotifyCustomerRequestExchange" type="//@typeDefinitions/@informationTypes.3">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-customerNotifier}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+      </activities>
+    </enclosedChoreographies>
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.1" roleTypes="//@typeDefinitions/@roleTypes.1 //@typeDefinitions/@roleTypes.2"/>
+    <variableDefinitions description="This is the variable NotifierChannel" name="NotifierChannel" type="//@typeDefinitions/@channelTypes.2" roleTypes="//@typeDefinitions/@roleTypes.2 //@typeDefinitions/@roleTypes.3"/>
+    <variableDefinitions description="This is the variable creditCheckResult" name="creditCheckResult" type="//@typeDefinitions/@informationTypes.1" roleTypes="//@typeDefinitions/@roleTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.0">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-creditAgencyQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheck" name="CreditCheckRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" receiveVariable="//@choreographies.0/@variableDefinitions.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-creditAgencyQueue_reply}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" description="Sufficient credit to request quotes" name="ValidCredit" expression="cdl:getVariable('creditCheckResult','','//@score') >= 4">
+        <activities xsi:type="org.pi4soa.cdl:Parallel">
+          <activities xsi:type="org.pi4soa.cdl:Sequence" description="First quote">
+            <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.0"/>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Sequence" description="Second quote">
+            <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.0"/>
+          </activities>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Insufficient credit">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="NotifyCustomer" operation="notify" channelVariable="//@choreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.2">
+          <exchangeDetails description="This is the exchange details for the request exchange associated with interaction NotifyCustomer" name="NotifyCustomerRequestExchange" type="//@typeDefinitions/@informationTypes.2">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-customerNotifier}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/readme.txt
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/readme.txt	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/readme.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,45 @@
+
+The trailblazer is a small application that uses several of the services provided by the JBoss ESB.
+
+
+Required to run the Trailblazer:
+- ANT
+- A mail server to send email notifications
+- JBoss AS 4.2.1 or higher with EJB3 and JBossWS support.  You can install the latest JBoss AS JEMS installer and select the "EJB3" install config to get the right one installed.
+- JBoss AS 4.2.1 or higher with the JBoss ESB SAR deployment (jbossesb.sar). 
+- JBossESB 4.3 or higher
+
+Settings required to edit before running:
+
+File: jbossesb-properties.xml (jbossesb.sar/jbossesb-properties.xml)
+- Update the section titled "transports" and specify all of the SMTP mail server settings for your environment.
+
+File : deployment.properties (install/deployment.properties)
+- Update the JBossAS and JBossESB location settings.
+
+File : trailblazer.properties (TB_ROOT/trailblazer.properties)
+- Update the file.bank.monitored.directory and file.output.directory properties' value properly. 
+  These are input and output folder needs to be specified, they are set to /tmp/input /tmp/output by default.
+
+File : jboss-esb.xml (TB_ROOT/esb/conf/jboss-esb.xml)
+- there is a "<fs-provider>..</fs-provider>" block, update the "directory" attribute value as same as file.output.directory value in trailblazer.properties file.
+
+Basic Trailblazer example running instructions:
+------------------------------------------------
+To run the Trailblazer, follow these steps:
+
+1 - run your JBoss AS - you will need to have the 4.2.1 or higher with the EJB3 support installed.  This is required because the TB uses the JSR-181 pojo style web service.
+
+2 - from the TB_ROOT, execute the command to start the ESB: "ant deploy"
+* this should deploy the ESB and WAR files to your JBoss AS server/default.
+
+3 - from the TB_ROOT/banks execute the command to start the JMS Bank service: "ant runJMSBank".
+
+4 - start another window/shell, from the TB_ROOT/banks execute the command to start the File bank service: "ant runFileBank".
+
+5 - from the jsp: localhost:8080/trailblazer.
+
+That's it.  Now you can submit quotes, You will see either a loan request rejected (single email)
+because the score is less than 4, or two emails (one from JMS bank and one from FileBased
+bank) with valid quotes.
+

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/template/quote.st
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/template/quote.st	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/template/quote.st	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+JBossESB - TrailBlazer Quote Response Notification
+
+Customer SSN:           $ssn$
+Customer Email:         $email$
+
+-- BANK QUOTES RECEIVED --
+
+QUOTE ID:	$quote$
+RATE:		$rate$
+BANK CODE:	$code$
+
+-- BANK CODES --
+0 - success
+1 - loan term exceeds the maximum available loan term
+2 - invalid SSN
+3 - invalid credit score
+4 - invalid credit history length
+5 - invalid loan term
+6 - invalid message
+7 - invalid customer ID

Added: branches/experimental/2.0.x/samples/jbossesb/trailblazer/trailblazer.properties
===================================================================
--- branches/experimental/2.0.x/samples/jbossesb/trailblazer/trailblazer.properties	                        (rev 0)
+++ branches/experimental/2.0.x/samples/jbossesb/trailblazer/trailblazer.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,30 @@
+
+# Credit Agency configs
+creditagency.service.category=tbCreditAGency
+creditagency.service.epr.name=creditagency
+
+# Bank configs
+bank1.service.category=tbBanks
+bank1.service.epr.name=jmsBank
+bank2.service.category=tbBanks
+bank2.service.epr.name=fileBank
+
+# FileBank config
+
+file.bank.monitored.dir=/tmp/input
+file.output.directory=/tmp/output
+
+#JMS Bank config
+jms.provider.url=localhost 
+jms.queue.in=queue/jms-tb-jmsBankRequestQueue
+jms.queue.out=queue/esb-tb-jmsBankGatewayResponseQueue
+
+
+# Notifier configs
+notifier.service.category=notifiers
+notifier.service.epr.name=customer
+
+# Customer email notification configs
+email.from=email at jboss.com
+email.template.path=template
+email.template.file=quote

Added: branches/experimental/2.0.x/samples/purchasing/.project
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/.project	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>purchasing</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/samples/purchasing/BuyConfirmed.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/BuyConfirmed.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/BuyConfirmed.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+<tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/store" 
+			xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+			id="1" />
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/BuyRequest.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/BuyRequest.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/BuyRequest.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+<tns:BuyRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/store" 
+			xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+			id="1" />
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/CreditCheckInvalid.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/CreditCheckInvalid.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/CreditCheckInvalid.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+<tns:CreditCheckInvalid xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+			xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd " 
+			id="1" />
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/CreditCheckOk.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/CreditCheckOk.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/CreditCheckOk.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+<tns:CreditCheckOk xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+			xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd " 
+			id="1" />
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/CreditCheckRequest.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/CreditCheckRequest.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/CreditCheckRequest.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+<tns:CreditCheckRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+			xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+			xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd " 
+			id="1" amount="200" />
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/InvalidPurchase.scn
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/InvalidPurchase.scn	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/InvalidPurchase.scn	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scn:Scenario xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:scn="http://www.pi4soa.org/scenario" name="InvalidPurchase" description="Invalid purchase goods" author="" choreographyDescriptionURL="PurchaseGoods.cdm">
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="buy" messageType="{http://www.jboss.org/examples/store}BuyRequest" valueURL="BuyRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="buy" direction="receive" messageType="{http://www.jboss.org/examples/store}BuyRequest" valueURL="BuyRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" valueURL="CreditCheckRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="checkCredit" direction="receive" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" valueURL="CreditCheckRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="checkCredit" faultName="{http://www.jboss.org/savara/examples}CreditCheckFailed" isRequest="false" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckInvalid" valueURL="CreditCheckInvalid.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" faultName="{http://www.jboss.org/savara/examples}CreditCheckFailed" isRequest="false" direction="receive" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckInvalid" valueURL="CreditCheckInvalid.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="buy" isRequest="false" messageType="{http://www.jboss.org/examples/store}BuyConfirmed" valueURL="BuyConfirmed.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="buy" isRequest="false" direction="receive" messageType="{http://www.jboss.org/examples/store}BuyConfirmed" valueURL="BuyConfirmed.xml"/>
+  <messageLinks source="//@scenarioObjects.0" target="//@scenarioObjects.1"/>
+  <messageLinks source="//@scenarioObjects.2" target="//@scenarioObjects.3"/>
+  <messageLinks source="//@scenarioObjects.4" target="//@scenarioObjects.5"/>
+  <messageLinks source="//@scenarioObjects.6" target="//@scenarioObjects.7"/>
+  <participants type="Buyer"/>
+  <participants type="sto:Store"/>
+  <participants type="ca:CreditAgency"/>
+</scn:Scenario>

Added: branches/experimental/2.0.x/samples/purchasing/PurchaseGoods.cdm
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/PurchaseGoods.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/PurchaseGoods.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PurchaseGoods" name="PurchaseGoods" author="gary" version="0.1" targetNamespace="http://www.jboss.org/savara/examples">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+    <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+    <informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="" elementName="sto:BuyConfirmed"/>
+    <informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="" elementName="sto:BuyFailed"/>
+    <informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="" elementName="sto:BuyRequest"/>
+    <informationTypes description="This is the information type CreditCheckInvalid" name="CreditCheckInvalid" typeName="" elementName="ca:CreditCheckInvalid"/>
+    <informationTypes description="This is the information type CreditCheckOk" name="CreditCheckOk" typeName="" elementName="ca:CreditCheckOk"/>
+    <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" typeName="" elementName="ca:CreditCheckRequest"/>
+    <informationTypes description="This is the information type IDType" name="IDType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URITokenType" name="URITokenType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token ID" name="ID" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator BuyFailedIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.1" query="//@id" name="BuyFailedIDLocator"/>
+    <tokenLocators description="This is the token locator BuyRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//@id" name="BuyRequestIDLocator"/>
+    <tokenLocators description="This is the token locator BuyResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.0" query="//@id" name="BuyResponseIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckInvalidIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//@id" name="CreditCheckInvalidIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@id" name="CreditCheckRequestIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.4" query="//@id" name="CreditCheckResponseIDLocator"/>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="ca:CreditAgencyInterface"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Store" name="Store">
+      <behaviors description="This is the behavior StoreBehavior" name="StoreBehavior" interface="sto:StoreInterface"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Buyer and Store" name="BuyerToStoreRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between Store and CreditAgency" name="StoreToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type Buyer" name="Buyer" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type ca:CreditAgency" name="ca:CreditAgency" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="savara.samples.Common at CreditAgency" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type sto:Store" name="sto:Store" roleTypes="//@typeDefinitions/@roleTypes.2">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Store" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type StoreChannelType" name="StoreChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.2">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the PurchaseGoods process" name="PurchaseGoodsProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.0"/>
+    <variableDefinitions name="CreditCheckVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.1"/>
+    <variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/@informationTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/@informationTypes.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.5" receiveVariable="//@choreographies.0/@variableDefinitions.1">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" name="CreditValid" expression="cdl:getVariable('CreditCheckVar','','//@amount','CreditAgency') &lt; 250">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/@informationTypes.4" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond" faultName="CreditCheckFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" faultName="BuyFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/samples/purchasing/SuccessfulPurchase.scn
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/SuccessfulPurchase.scn	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/SuccessfulPurchase.scn	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scn:Scenario xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:scn="http://www.pi4soa.org/scenario" name="SuccessfulPurchase" description="Successfully purchase goods" author="" choreographyDescriptionURL="PurchaseGoods.cdm">
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="buy" messageType="{http://www.jboss.org/examples/store}BuyRequest" valueURL="BuyRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="buy" direction="receive" messageType="{http://www.jboss.org/examples/store}BuyRequest" valueURL="BuyRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" valueURL="CreditCheckRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="checkCredit" direction="receive" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckRequest" valueURL="CreditCheckRequest.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.2" operationName="checkCredit" isRequest="false" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckOk" valueURL="CreditCheckOk.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="checkCredit" isRequest="false" direction="receive" messageType="{http://www.jboss.org/examples/creditAgency}CreditCheckOk" valueURL="CreditCheckOk.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.1" operationName="buy" isRequest="false" messageType="{http://www.jboss.org/examples/store}BuyConfirmed" valueURL="BuyConfirmed.xml"/>
+  <scenarioObjects xsi:type="scn:MessageEvent" participant="//@participants.0" operationName="buy" isRequest="false" direction="receive" messageType="{http://www.jboss.org/examples/store}BuyConfirmed" valueURL="BuyConfirmed.xml"/>
+  <messageLinks source="//@scenarioObjects.0" target="//@scenarioObjects.1"/>
+  <messageLinks source="//@scenarioObjects.2" target="//@scenarioObjects.3"/>
+  <messageLinks source="//@scenarioObjects.4" target="//@scenarioObjects.5"/>
+  <messageLinks source="//@scenarioObjects.6" target="//@scenarioObjects.7"/>
+  <participants type="Buyer"/>
+  <participants type="sto:Store"/>
+  <participants type="ca:CreditAgency"/>
+</scn:Scenario>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,65 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Common at CreditAgency" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <partnerLinks>
+        <partnerLink myRole="CreditAgencyService" name="StoreToCreditAgency" partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+        <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+        <variable messageType="ca:CreditCheckFailedFault" name="creditCheckInvalidVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckRequestVar"/>
+        <if>
+			<bpel:condition><![CDATA[
+				$creditCheckRequestVar.content/@amount <= 500
+			]]></bpel:condition>
+            <sequence>
+				<assign name="CopyPurchaseDetails">
+                    <bpel:copy>
+                        <bpel:from>
+                            <bpel:literal xml:space="preserve">
+                            	<tns:CreditCheckOk xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+                            				id="" amount="" >
+                            	</tns:CreditCheckOk>
+                            </bpel:literal>
+                        </bpel:from>
+                        <bpel:to variable="creditCheckOkVar" part="content"></bpel:to>
+                    </bpel:copy>
+				    <copy>
+				        <from>$creditCheckRequestVar.content/@id</from>
+				        <to>$creditCheckOkVar.content/@id</to>
+				    </copy>
+				</assign>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckOkVar"/>
+            </sequence>
+            <else>
+                <sequence>
+					<assign name="CopyPurchaseDetails">
+	                    <bpel:copy>
+	                        <bpel:from>
+	                            <bpel:literal xml:space="preserve">
+	                            	<tns:CreditCheckInvalid xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+	                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+	                            				id="" amount="" >
+	                            	</tns:CreditCheckInvalid>
+	                            </bpel:literal>
+	                        </bpel:from>
+	                        <bpel:to variable="creditCheckInvalidVar" part="content"></bpel:to>
+	                    </bpel:copy>
+					    <copy>
+					        <from>$creditCheckRequestVar.content/@id</from>
+					        <to>$creditCheckInvalidVar.content/@id</to>
+					    </copy>
+					</assign>
+                    <reply faultName="ca:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckInvalidVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/creditAgency">
+    <process name="ns1:PurchaseGoodsProcess_CreditAgency">
+        <active>
+            true
+        </active>
+        <provide partnerLink="StoreToCreditAgency">
+            <service name="ns1:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+        </provide>
+    </process>
+</deploy>

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,94 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:pur="http://www.jboss.org/examples/purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Store" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <partnerLinks>
+        <partnerLink myRole="StoreService" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+        <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+    </partnerLinks>
+    <bpel:messageExchanges>
+        <bpel:messageExchange name="messageExchange"></bpel:messageExchange>
+        <bpel:messageExchange name="messageExchange1"></bpel:messageExchange>
+    </bpel:messageExchanges>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+        <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+        <variable messageType="sto:buyResponse" name="buyConfirmedVar"/>
+        <variable messageType="sto:BuyFailedFault" name="buyFailedVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyRequestVar"/>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="ca:CreditCheckFailedFault" faultName="ca:CreditCheckFailed" faultVariable="creditCheckInvalidVar">
+                    <sequence>
+						<assign name="CopyPurchaseDetails">
+		                    <bpel:copy>
+		                        <bpel:from>
+		                            <bpel:literal xml:space="preserve">
+										<tns:BuyFailed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+													xmlns:tns="http://www.jboss.org/examples/store" 
+													xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+													id="" />
+		                            </bpel:literal>
+		                        </bpel:from>
+		                        <bpel:to variable="buyFailedVar" part="content"></bpel:to>
+		                    </bpel:copy>
+						    <copy>
+						        <from>$creditCheckInvalidVar.content/@id</from>
+						        <to>$buyFailedVar.content/@id</to>
+						    </copy>
+						</assign>
+                        <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyFailedVar"/>
+                    </sequence>
+                </catch>
+            </faultHandlers>
+            <sequence>
+				<assign name="CopyPurchaseDetails">
+                    <bpel:copy>
+                        <bpel:from>
+                            <bpel:literal xml:space="preserve">
+                            	<tns:CreditCheckRequest xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+                            				id="" amount="" >
+                            	</tns:CreditCheckRequest>
+                            </bpel:literal>
+                        </bpel:from>
+                        <bpel:to variable="creditCheckRequestVar" part="content"></bpel:to>
+                    </bpel:copy>
+				    <copy>
+				        <from>$buyRequestVar.content/@id</from>
+				        <to>$creditCheckRequestVar.content/@id</to>
+				    </copy>
+				    <copy>
+				        <from>$buyRequestVar.content/@amount</from>
+				        <to>$creditCheckRequestVar.content/@amount</to>
+				    </copy>
+                </assign>
+                
+                <invoke inputVariable="creditCheckRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="creditCheckOkVar" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"/>
+
+				<assign name="CopyPurchaseDetails">
+                    <bpel:copy>
+                        <bpel:from>
+                            <bpel:literal xml:space="preserve">
+								<tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+											xmlns:tns="http://www.jboss.org/examples/store" 
+											xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+											id="" />
+                            </bpel:literal>
+                        </bpel:from>
+                        <bpel:to variable="buyConfirmedVar" part="content"></bpel:to>
+                    </bpel:copy>
+				    <copy>
+				        <from>$creditCheckOkVar.content/@id</from>
+				        <to>$buyConfirmedVar.content/@id</to>
+				    </copy>
+				</assign>
+                <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyConfirmedVar"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/store"
+						xmlns:ns2="http://www.jboss.org/examples/creditAgency">
+    <process name="ns1:PurchaseGoodsProcess_Store">
+        <active>
+            true
+        </active>
+        <provide partnerLink="BuyerToStore">
+            <service name="ns1:StoreService" port="StoreInterfacePort"/>
+        </provide>
+        <invoke partnerLink="StoreToCreditAgency">
+            <service name="ns2:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+        </invoke>
+    </process>
+</deploy>

Added: branches/experimental/2.0.x/samples/purchasing/creditAgency.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/creditAgency.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/creditAgency.xsd	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns:tns="http://www.jboss.org/examples/creditAgency" elementFormDefault="qualified">
+
+    <element name="CreditCheckRequest" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckOk" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckInvalid" type="tns:CreditCheckType"></element>
+
+    <complexType name="CreditCheckType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/purchasing.tap
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/purchasing.tap	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/purchasing.tap	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.savara.org/ta/project" xmlns:xsi="http://www.w3.org/2001/XMLSchema"
+			xsi:schemaLocation="http://www.savara.org/ta/project tap.xsd"
+			name="Purchasing" version="1.0.0">
+			
+	<phase name="requirements">
+		<resource id="SuccessfulPurchase.scn">
+			<uri type="eclipse" context="purchasing" locator="/SuccessfulPurchase.scn" />
+		</resource>
+		<resource id="InvalidPurchase.scn">
+			<uri type="eclipse" context="purchasing" locator="/InvalidPurchase.scn" />
+		</resource>
+	</phase>
+	
+	<phase name="architecture">
+		<resource id="PurchaseGoods.cdm">
+			<uri type="eclipse" context="purchasing" locator="/PurchaseGoods.cdm" />
+			<relationship type="depends" ref="SuccessfulPurchase.scn" />
+			<relationship type="depends" ref="InvalidPurchase.scn" />
+		</resource>
+	</phase>
+	
+	<phase name="implementation">
+		<resource id="PurchaseGoodsProcess_Store.bpel">
+			<uri type="eclipse" context="PurchaseGoodsProcess-Store" locator="/bpelContent/PurchaseGoodsProcess_Store.bpel" />
+			<relationship type="depends" ref="PurchaseGoods.cdm" >
+				<description>Link from the BPEL process to the 'Store' participant within the choreography</description>
+				<link type="role" to="Store" />
+			</relationship>
+		</resource>
+		<resource id="PurchaseGoodsProcess_CreditAgency.bpel">
+			<uri type="eclipse" context="PurchaseGoodsProcess-CreditAgency" locator="/bpelContent/PurchaseGoodsProcess_CreditAgency.bpel" />
+			<relationship type="depends" ref="PurchaseGoods.cdm" >
+				<description>Link from the BPEL process to the 'CreditAgency' participant within the choreography</description>
+				<link type="role" to="CreditAgency" />
+			</relationship>
+		</resource>
+	</phase>
+</project>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/store.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/store.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/store.xsd	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" elementFormDefault="qualified">
+
+    <element name="BuyRequest" type="tns:StoreType"></element>
+    <element name="BuyConfirmed" type="tns:StoreType"></element>
+    <element name="BuyFailed" type="tns:StoreType"></element>
+
+    <complexType name="StoreType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+bin.includes = feature.xml,\
+               Copyright.txt
+src.includes = pom.xml,\
+               Copyright.txt,\
+               build.properties,\
+               feature.xml

Added: branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/feature.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/feature.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/feature.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.jboss.savara.tools.feature"
+      label="JBoss SAVARA Tools Feature"
+      version="1.2.0.qualifier"
+      provider-name="www.jboss.org">
+
+   <description>
+      The JBoss Tools for Savara.
+   </description>
+
+   <copyright>
+      /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.
+ */
+   </copyright>
+
+   <license url="http://www.gnu.org/licenses/lgpl-2.1.html">
+      GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author&apos;s reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the &quot;Lesser&quot; General Public License because it does Less to protect the user&apos;s freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users&apos; freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a &quot;work based on the library&quot; and a &quot;work that uses the library&quot;. The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called &quot;this License&quot;). Each licensee is addressed as &quot;you&quot;.
+
+A &quot;library&quot; means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The &quot;Library&quot;, below, refers to any such software library or work which has been distributed under these terms. A &quot;work based on the Library&quot; means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term &quot;modification&quot;.)
+
+&quot;Source code&quot; for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library&apos;s complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+    * a) The modified work must itself be a software library.
+    * b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+    * c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+    * d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+      (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) 
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a &quot;work that uses the Library&quot;. Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a &quot;work that uses the Library&quot; with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a &quot;work that uses the library&quot;. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a &quot;work that uses the Library&quot; uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a &quot;work that uses the Library&quot; with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer&apos;s own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+    * a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable &quot;work that uses the Library&quot;, as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+    * b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user&apos;s computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+    * c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+    * d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+    * e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. 
+
+For an executable, the required form of the &quot;work that uses the Library&quot; must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+    * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+    * b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients&apos; exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and &quot;any later version&quot;, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+   </license>
+
+   <includes
+         id="org.savara.tools.feature"
+         version="0.0.0"/>
+
+</feature>

Added: branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.jboss.savara.tools.feature/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,74 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion> 
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.jboss.savara.tools.feature</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-feature</packaging>
+	<name>Savara::Tools::Features::JBossSavaraTools</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>features</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.core</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.comparator</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.projector</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.export.text</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.validation</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.tools</groupId>
+			<artifactId>org.savara.tools.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.tools</groupId>
+			<artifactId>org.savara.tools.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+</project>
+

Added: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+bin.includes = feature.xml,\
+               Copyright.txt
+src.includes = pom.xml,\
+               Copyright.txt,\
+               build.properties,\
+               feature.xml

Added: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.savara.tools.feature"
+      label="SAVARA Tools Feature"
+      version="1.2.0.qualifier"
+      provider-name="www.savara.org">
+
+   <description>
+      The Tools for Savara.
+   </description>
+
+   <copyright>
+      /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.
+ */
+   </copyright>
+
+   <license url="http://www.gnu.org/licenses/lgpl-2.1.html">
+      GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author&apos;s reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the &quot;Lesser&quot; General Public License because it does Less to protect the user&apos;s freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users&apos; freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a &quot;work based on the library&quot; and a &quot;work that uses the library&quot;. The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called &quot;this License&quot;). Each licensee is addressed as &quot;you&quot;.
+
+A &quot;library&quot; means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The &quot;Library&quot;, below, refers to any such software library or work which has been distributed under these terms. A &quot;work based on the Library&quot; means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term &quot;modification&quot;.)
+
+&quot;Source code&quot; for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library&apos;s complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+    * a) The modified work must itself be a software library.
+    * b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+    * c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+    * d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+      (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) 
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a &quot;work that uses the Library&quot;. Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a &quot;work that uses the Library&quot; with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a &quot;work that uses the library&quot;. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a &quot;work that uses the Library&quot; uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a &quot;work that uses the Library&quot; with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer&apos;s own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+    * a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable &quot;work that uses the Library&quot;, as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+    * b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user&apos;s computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+    * c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+    * d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+    * e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. 
+
+For an executable, the required form of the &quot;work that uses the Library&quot; must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+    * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+    * b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients&apos; exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and &quot;any later version&quot;, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+   </license>
+
+   <requires>
+      <import feature="org.scribble.protocol.feature"/>
+      <import feature="org.pi4soa.core.feature"/>
+   </requires>
+
+   <plugin
+         id="org.savara.contract.model"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.protocol.contract"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tools.bpel"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.bpel"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tools.validator"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tools.wsdl"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.wsdl"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tools.bpmn"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tools.monitor"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.pi4soa.cdm"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tap.eclipse"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tap.model"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.savara.tap.validation"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conformance"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conversation.comparator"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

Added: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,74 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion> 
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.feature</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-feature</packaging>
+	<name>Savara::Tools::Features::SavaraTools</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>features</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.core</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.conformance</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.comparator</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.projector</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.export.text</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.validation</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.tools</groupId>
+			<artifactId>org.savara.tools.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.tools</groupId>
+			<artifactId>org.savara.tools.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+</project>
+

Added: branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/LICENSE.txt
===================================================================
--- branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/LICENSE.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/LICENSE.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+bin.includes = feature.xml,\
+               Copyright.txt
+src.includes = pom.xml,\
+               Copyright.txt,\
+               build.properties,\
+               feature.xml

Added: branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/feature.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/feature.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/feature.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.scribble.protocol.feature"
+      label="Scribble Protocol Feature"
+      version="1.2.0.qualifier"
+      provider-name="www.jboss.org">
+
+   <description>
+      Scribble Protocol Features.
+   </description>
+
+   <copyright>
+ *
+ * Copyright 2010 www.scribble.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+   </copyright>
+
+   <license url="http://www.apache.org/licenses/LICENSE-2.0">
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+   </license>
+
+   <plugin
+         id="org.scribble.conversation.export.text"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conversation.model"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conversation.parser"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conversation.projector"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.conversation.validation"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.eclipse"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.expression.xpath"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.scribble.lang.model"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

Added: branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,49 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion> 
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.scribble.protocol.feature</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-feature</packaging>
+	<name>Savara::Tools::Features::ScribbleProtocol</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>features</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.projector</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.validation</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.export.text</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 	</dependencies>
+</project>
+

Added: branches/experimental/2.0.x/tools/features/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/features/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>features</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>pom</packaging>
+	<name>Savara::Tools::Features</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>tools</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+	<modules>
+		<module>org.scribble.protocol.feature</module>
+		<module>org.savara.tools.feature</module>
+		<module>org.jboss.savara.tools.feature</module>
+	</modules>
+</project>
+	
+

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.protocol.contract</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Protocol Contract Plugin
+Bundle-SymbolicName: org.savara.protocol.contract
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.protocol.contract.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.common,
+ org.scribble.protocol,
+ org.savara.contract.model
+Export-Package: org.savara.protocol.contract,
+ org.savara.protocol.contract.impl;x-friends:="org.savara.protocol.contract.tests"

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.protocol.contract</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ProtocolContract</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+ </project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+/*
+ * 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.protocol.contract;
+
+import org.savara.contract.model.Contract;
+import org.scribble.conversation.model.Conversation;
+
+/**
+ * This interface represents the capability that generates a contract
+ * from a protocol associated with a particular interacting role.
+ * 
+ */
+public interface ContractGenerator {
+
+	/**
+	 * This method generates a contract associated with a supplied located
+	 * protocol.
+	 * 
+	 * @param cm The protocol
+	 * @return The contract
+	 */
+	public Contract generate(Conversation cm) throws IllegalArgumentException;
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGeneratorFactory.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGeneratorFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGeneratorFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,38 @@
+/*
+ * 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.protocol.contract;
+
+import org.savara.protocol.contract.impl.ContractGeneratorImpl;
+
+/**
+ * This class provides access to a contract generator.
+ * 
+ */
+public class ContractGeneratorFactory {
+
+	/**
+	 * This method returns an instance of the ContractGenerator
+	 * interface.
+	 * 
+	 * @return The contract generator
+	 */
+	public static ContractGenerator getContractGenerator() {
+		return(new ContractGeneratorImpl());
+	}
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/Messages.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/Messages.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/Messages.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+#/*
+# * 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.
+# */
+
+SAVARAPC-00001=Protocol must be supplied
+SAVARAPC-00002=Contract generation requires a protocol that represents the local behaviour associated with a particular role

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,63 @@
+/*
+ * 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.protocol.contract.impl;
+
+import java.text.MessageFormat;
+
+import org.savara.contract.model.Contract;
+import org.savara.protocol.contract.ContractGenerator;
+import org.scribble.conversation.model.Conversation;
+
+/**
+ * This class generates a contract from a protocol defining the behaviour of
+ * multiple interacting roles.
+ * 
+ */
+public class ContractGeneratorImpl implements ContractGenerator {
+
+	/**
+	 * This method generates a contract associated with a supplied located
+	 * protocol.
+	 * 
+	 * @param cm The protocol
+	 * @return The contract
+	 */
+	public Contract generate(Conversation cm) throws IllegalArgumentException {
+		
+		// Check parameters
+		if (cm == null) {
+			throw new IllegalArgumentException(MessageFormat.format(
+					java.util.PropertyResourceBundle.getBundle(
+						"org.savara.protocol.contract.Messages").
+							getString("SAVARAPC-00001"), (Object)null));
+			
+		} else if (cm.getLocatedName() == null || cm.getLocatedName().getRole() == null) {
+			throw new IllegalArgumentException(MessageFormat.format(
+					java.util.PropertyResourceBundle.getBundle(
+						"org.savara.protocol.contract.Messages").
+							getString("SAVARAPC-00002"), (Object)null));
+		}
+		
+		ContractIntrospector introspector=new ContractIntrospector(cm);
+		
+		introspector.process();
+		
+		return(introspector.getContract());
+	}
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,248 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.protocol.contract.impl;
+
+import java.text.MessageFormat;
+import java.util.logging.Logger;
+
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.contract.model.MessageExchangePattern;
+import org.savara.contract.model.OneWayRequestMEP;
+import org.savara.contract.model.RequestResponseMEP;
+import org.savara.contract.model.Type;
+import org.savara.contract.model.TypeDefinition;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.conversation.model.ConversationInteraction;
+import org.scribble.conversation.model.Run;
+import org.scribble.model.ModelObject;
+import org.scribble.model.Role;
+import org.scribble.model.TypeReference;
+
+/**
+ * This class examines a protocol to determine the contract that represents
+ * the static functional interface to the role's behaviour.
+ *
+ */
+public class ContractIntrospector implements org.scribble.model.Visitor {
+
+	private Contract m_contract=new Contract();
+	private java.util.Set<Conversation> m_processedProtocols=null;
+	private Role m_role=null;
+	private Conversation m_protocol=null;
+	
+	private static Logger logger = Logger.getLogger(ContractIntrospector.class.getName());	
+	
+	/**
+	 * Constructor for the contract introspector.
+	 * 
+	 * @param protocol The protocol to introspect
+	 */
+	public ContractIntrospector(Conversation protocol) {
+		this(protocol, null, null);
+	}
+	
+	/**
+	 * Constructor for the contract introspector.
+	 * 
+	 * @param protocol The protocol being introspected
+	 * @param contract The optional contract being derived
+	 * @param processed The optional set of protocols currently processed
+	 */
+	public ContractIntrospector(Conversation protocol, Contract contract,
+						java.util.Set<Conversation> processed) {
+		m_contract = contract;
+		
+		if (m_contract == null) {
+			m_contract = new Contract();
+		}
+		
+		if (processed != null) {
+			m_processedProtocols = processed;
+		} else {
+			m_processedProtocols = new java.util.HashSet<Conversation>();
+		}
+		
+		m_protocol = protocol;
+		
+		if (protocol != null) {
+			m_role = protocol.getLocatedName().getRole();
+		}
+	}
+	
+	/**
+	 * This method returns the contract being derived.
+	 * 
+	 * @return The contract
+	 */
+	public Contract getContract() {
+		return(m_contract);
+	}
+	
+	/**
+	 * This method returns the interface.
+	 * 
+	 * @return The interface
+	 */
+	public Interface getInterface() {
+		Interface ret=getContract().getInterface(m_role.getName());
+		
+		if (ret == null) {
+			// Create interface for the role
+			ret = new Interface();
+			ret.setName(m_role.getName());
+			
+			getContract().getInterfaces().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the set of processed protocols.
+	 * 
+	 * @return The processed protocols
+	 */
+	public java.util.Set<Conversation> getProcessedProtocols() {
+		return(m_processedProtocols);
+	}
+	
+	/**
+	 * This method introspects the supplied protocol to derive information
+	 * that can be used to define the functional contract for the role
+	 * associated with the protocol.
+	 * 
+	 * @param conv The located protocol
+	 */
+	public void process() throws IllegalStateException {
+		
+		if (m_protocol == null) {
+			throw new IllegalStateException(MessageFormat.format(
+					java.util.PropertyResourceBundle.getBundle(
+						"org.savara.protocol.contract.Messages").
+							getString("SAVARAPC-00001"), (Object)null));
+		}
+		
+		m_protocol.visit(this);
+	}
+	
+	public boolean visit(ModelObject obj) {
+		boolean f_visitChildren=true;
+		
+		if (obj.getClass() == Conversation.class) {
+			
+			// Only visit children if same protocol that is being visited
+			f_visitChildren = (obj == m_protocol);
+			
+		} else if (obj.getClass() == Run.class) {
+			Run run=(Run)obj;
+			
+			Conversation toProtocol=run.getDefinition();
+			
+			// Check if protocol already processed to avoid stack overflow
+			if (m_processedProtocols.contains(toProtocol) == false) {
+				m_processedProtocols.add(toProtocol);
+
+				ContractIntrospector ci=new ContractIntrospector(toProtocol,
+							getContract(), getProcessedProtocols());
+					
+				ci.process();
+			} else {
+				logger.fine("Invoked definition not found for "+run.getReference());
+			}
+		} else if (obj.getClass() == ConversationInteraction.class) {
+			visitInteraction((ConversationInteraction)obj);
+		}
+		
+		return(f_visitChildren);
+	}
+
+	/**
+	 * This method introspects the supplied interaction to generate Message Exchange
+	 * Patterns on the contract interface.
+	 * 
+	 * @param interaction The interaction
+	 */
+	public void visitInteraction(ConversationInteraction interaction) {
+		
+		// Check if the interacton is being received
+		if (interaction.getFromRole() != null &&
+				interaction.getFromRole().equals(m_role) == false) {
+			
+			// Received by the role, but need to check if its replyTo
+			// has been set, indicating it is receiving a response
+			if (interaction.getReplyToLabel() == null ||
+					interaction.getReplyToLabel().trim().length() == 0) {
+				
+				// Receiving a request - so record this in the contract
+				Interface intf=getInterface();
+				
+				if (interaction.getMessageSignature().getOperation() != null) {
+					
+					// Check if message exchange pattern exists for operation
+					MessageExchangePattern mep=intf.getMessageExchangePatternForOperation(
+								interaction.getMessageSignature().getOperation());
+					
+					if (mep == null) {
+						// Create new MEP
+						if (interaction.getRequestLabel() != null) {
+							mep = new RequestResponseMEP();
+						} else {
+							mep = new OneWayRequestMEP();
+						}
+						
+						mep.setOperation(interaction.getMessageSignature().getOperation());
+						
+						for (int i=0; i < interaction.getMessageSignature().getTypes().size(); i++) {
+							mep.getTypes().add(convertType(interaction.getMessageSignature().getTypes().get(i)));
+						}
+						
+						intf.getMessageExchangePatterns().add(mep);
+					}
+				}
+
+			} else {
+				
+			}
+		}
+	}
+	
+	/**
+	 * This method converts a protocol type reference into a contract model type.
+	 * 
+	 * @param tref The protocol type reference
+	 * @return The type
+	 */
+	public Type convertType(TypeReference tref) {
+		Type ret=new Type();
+		
+		TypeDefinition td=new TypeDefinition();
+		td.setName(tref.getLocalpart());
+		td.setNamespace(tref.getNamespace());
+		//td.setTypeSystem(typeSystem);
+		
+		ret.getTypeDefinitions().add(td);
+		ret.setName(td.getName());
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+/*
+ * 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.protocol.contract.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tap.eclipse</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA TAP Eclipse integration
+Bundle-SymbolicName: org.savara.tap.eclipse; singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tap.eclipse.Activator
+Bundle-Vendor: www.savara.org
+Service-Component: OSGI-INF/eclipse-resource-loader.xml
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.savara.tap.model,
+ org.savara.tap.validation,
+ org.scribble.common
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/OSGI-INF/eclipse-resource-loader.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/OSGI-INF/eclipse-resource-loader.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/OSGI-INF/eclipse-resource-loader.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="eclipse-resource-loader">
+	<implementation class="org.savara.tap.eclipse.EclipseResourceLoader"/>
+	<service>
+		<provide interface="org.savara.tap.model.admin.ResourceLoader"/>
+	</service>
+</component>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               OSGI-INF/,\
+               build.properties,\
+               pom.xml
+src.includes = .project,\
+               .classpath,\
+               META-INF/,\
+               OSGI-INF/,\
+               build.properties,\
+               plugin.xml,\
+               pom.xml,\
+               src/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.popupMenus">
+      <objectContribution
+            objectClass="org.eclipse.core.resources.IFile"
+            id="org.savara.tap.eclipse.contribution1"
+            nameFilter="*.tap" >
+         <menu
+               label="Savara"
+               path="additions"
+               id="org.savara.tools.menu">
+            <separator
+                  name="group1">
+            </separator>
+         </menu>
+         <action
+               label="Validate"
+               class="org.savara.tap.eclipse.actions.ValidateAction"
+               menubarPath="org.savara.tools.menu/group1"
+               enablesFor="1"
+               id="org.savara.tap.validation.ValidateAction">
+         </action>
+      </objectContribution>
+   </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tap.eclipse</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsTAPEclipse</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 	</dependencies>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,61 @@
+package org.savara.tap.eclipse;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tap.eclipse"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/EclipseResourceLoader.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/EclipseResourceLoader.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/EclipseResourceLoader.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,290 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.eclipse;
+
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Path;
+import org.savara.tap.model.Resource;
+import org.savara.tap.model.URI;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.scribble.eclipse.model.admin.OSGIModelListener;
+import org.scribble.eclipse.model.admin.OSGIModelRepository;
+import org.scribble.model.ModelReference;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This class providers the Eclipse resource loader implementation.
+ *
+ */
+public class EclipseResourceLoader implements ResourceLoader {
+
+	private static Logger logger = Logger.getLogger(EclipseResourceLoader.class.getName());	
+
+	/**
+	 * This method determines whether the resource loader can
+	 * retrieve the contents associated with the supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return Whether the contents can be retrieved
+	 */
+	public boolean isSupported(Resource resource) {
+		boolean ret=false;
+		
+		for (URI uri : resource.getUri()) {
+			if (uri.getType().equalsIgnoreCase("eclipse")) {
+				ret = true;
+				break;
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method determines if the supplied resource exists.
+	 * 
+	 * @param resource The resource
+	 * @return Whether the resource exists
+	 */
+	public boolean exists(Resource resource) {
+		IFile res=getFile(resource);
+		return(res == null ? false : res.exists());
+	}
+	
+	/**
+	 * This method retrieves the contents associated with the
+	 * supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The contents, or null if not found
+	 */
+	public InputStream getContents(Resource resource) {
+		java.io.InputStream ret=null;
+		IFile res=getFile(resource);
+		
+		if (res != null) {
+			try {
+				ret = res.getContents();
+			} catch(Exception e) {
+				logger.log(Level.SEVERE, 
+						"Failed to get contents for resource '"+res+"'", e);
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method retrieves the URI associated with the
+	 * supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The URI, or null if not found
+	 */
+	public java.net.URI getURI(Resource resource) {
+		IFile res=getFile(resource);
+		java.net.URI ret=null;
+		
+		if (res != null) {
+			ret = res.getRawLocationURI();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method retrieves the contents associated with the
+	 * supplied URI. If the URI is a relative path, then the resource will
+	 * be located relative to the supplied model reference.
+	 * 
+	 * @param ref The model reference
+	 * @param uri The URI
+	 * @return The contents, or null if not found
+	 */
+	public java.io.InputStream getContents(ModelReference ref, String uri) {
+		java.io.InputStream ret=null;
+		
+		if (uri != null) {
+			
+			if (uri.startsWith("http:")) {
+				// TODO: Implement
+				
+			} else {
+				// Try to locate as relative path from supplied model reference
+				IFile file=OSGIModelRepository.getFile(ref);
+				
+				// Find folder
+				IFolder folder = (IFolder)file.getParent();
+				
+				IFile refFile=folder.getFile(new Path(uri));
+				
+				if (refFile != null) {
+					try {
+						ret = refFile.getContents();
+					} catch(Exception e) {
+						logger.log(Level.SEVERE, 
+								"Failed to load content from referenced resource '"+uri+"'", e);
+					}
+				} else if (logger.isLoggable(Level.FINE)) {
+					logger.fine("Unable to locate resource '"+uri+"'");
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method retrieves the URI associated with the
+	 * supplied URI string. If the supplied URI is a relative path,
+	 * then the resource will be located relative to the supplied 
+	 * model reference.
+	 * 
+	 * @param ref The model reference
+	 * @param uri The URI
+	 * @return The resolved URI, or null if not found
+	 */
+	public java.net.URI getURI(ModelReference ref, String uri) {
+		java.net.URI ret=null;
+		
+		if (uri != null) {
+			
+			if (uri.startsWith("http:")) {
+				try {
+					ret = new java.net.URI(uri);
+				} catch(Exception e) {
+					logger.log(Level.SEVERE, "Invalid URI '"+uri+"'", e);
+				}
+			} else {
+				// Try to locate as relative path from supplied model reference
+				IFile file=OSGIModelRepository.getFile(ref);
+				
+				// Find folder
+				IFolder folder = (IFolder)file.getParent();
+				
+				IFile refFile=folder.getFile(new Path(uri));
+				
+				if (refFile != null) {
+					ret = refFile.getRawLocationURI();
+				} else if (logger.isLoggable(Level.FINE)) {
+					logger.fine("Unable to locate resource '"+uri+"'");
+				}
+			}
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method retrieves the contents associated with the
+	 * supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The contents, or null if not found
+	 */
+	protected IFile getFile(Resource resource) {
+		String projectName=null;
+		String location=null;
+		IFile ret=null;
+		
+		for (URI uri : resource.getUri()) {
+			if (uri.getType().equalsIgnoreCase("eclipse")) {
+				projectName = uri.getContext();
+				location = uri.getLocator();
+				break;
+			}
+		}
+		
+		if (projectName != null) {
+			IProject project=org.eclipse.core.resources.ResourcesPlugin.getWorkspace().
+								getRoot().getProject(projectName);
+			
+			if (project == null) {
+				logger.severe("Eclipse context (project) '"+projectName+
+						"' does not exist for resource: "+resource.getId());				
+			} else if (location == null) {
+				logger.severe("Eclipse locator has not been defined for resource: "+resource.getId());
+			} else {
+				ret = project.getFile(new Path(location));
+				
+				if (ret == null) {
+					logger.severe("Eclipse locator '"+location+"' for project '"+projectName+
+						"' does not exist for resource: "+resource.getId());
+				}
+			}
+		} else {
+			logger.severe("Unable to determine Eclipse context (project) for resource: "+
+					resource.getId());
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method returns a model listener associated with the supplied resource.
+	 * 
+	 * @param res The resource
+	 * @return The model listener associated with the resource
+	 */
+	public ModelListener getResourceModelListener(Resource res) {
+		IFile file=getFile(res);
+		ModelListener ret=null;
+		
+		if (file != null) {
+			ret = new OSGIModelListener(file);
+		} else {
+			logger.severe("Failed to get model listener for resource '"+res+"'");
+			
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method frees a model listener associated with the supplied resource.
+	 * 
+	 * @param res The resource
+	 * @param l The model listener associated with the resource
+	 */
+	public void freeResourceModelListener(Resource res, ModelListener l) {
+		if (l instanceof OSGIModelListener) {
+			((OSGIModelListener)l).finished();
+		}
+	}
+	
+	/**
+	 * This method returns the model reference associated with the supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The model reference
+	 */
+	public ModelReference getModelReference(Resource resource) {
+		return(OSGIModelRepository.createReference(getFile(resource)));
+	}
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/actions/ValidateAction.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/actions/ValidateAction.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/src/java/org/savara/tap/eclipse/actions/ValidateAction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,154 @@
+package org.savara.tap.eclipse.actions;
+
+import java.io.IOException;
+import java.util.logging.Logger;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.savara.tap.model.Project;
+import org.savara.tap.model.admin.TAPModelUtil;
+import org.savara.tap.validation.TAPValidator;
+import org.scribble.eclipse.model.admin.OSGIModelListener;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.common.logging.Journal;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+public class ValidateAction implements IObjectActionDelegate {
+
+	private static Logger logger = Logger.getLogger(ValidateAction.class.getName());
+
+	private ISelection m_selection=null;
+    private IWorkbenchPart m_targetPart=null;
+    private static TAPValidator m_validator=TAPValidator.getInstance();
+
+    public ValidateAction() {
+    }
+
+    /**
+     * This method returns the validator.
+     * 
+     * @return The validator
+     */
+    public static TAPValidator getValidator() {
+    	return(m_validator);
+    }
+    
+	/**
+	 * This method implements the action's run method.
+	 * 
+	 * @param action The action
+	 */
+	public void run(IAction action) {
+		
+		if (m_selection instanceof StructuredSelection) {
+			StructuredSelection sel=(StructuredSelection)m_selection;
+			
+			IResource res=(IResource)sel.getFirstElement();
+			
+			// Obtain the TAP model from the resource
+			if (res instanceof IFile) {
+				Project project=null;
+				OSGIModelListener l=new OSGIModelListener(res);
+				java.io.InputStream is=null;
+				
+				try {
+					is = ((IFile)res).getContents();
+				
+					// Check the XML document is valid
+					if (TAPValidator.getInstance().isValidTAPDocument(is, l)) {
+					
+						is.close();
+						
+						// Re-acquire contents to deserialize into project object model
+						is = ((IFile)res).getContents();
+						
+						project = TAPModelUtil.deserialize(is);
+						
+						is.close();
+						
+						if (project != null) {			
+							m_validator.validate(project, l);
+						}
+					}
+				} catch(Exception e) {
+					if (is != null) {
+						try {
+							is.close();
+						} catch(Exception ex) {
+						}
+					}
+					
+					e.printStackTrace();
+					
+					error(e.getMessage());
+				}
+				
+				l.finished();
+			}
+		}
+	}
+	
+	/**
+	 * This method is used to report an error.
+	 * 
+	 * @param mesg The error message
+	 */
+	public void error(String mesg) {
+		
+		logger.severe("Error occurred: "+mesg);
+		
+		MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+				SWT.ICON_ERROR|SWT.OK);
+		
+		if (mesg == null) {
+			mesg = "Null pointer exception has occurred";
+		}
+
+		mbox.setMessage(mesg);
+		mbox.open();
+	}
+	
+	/**
+	 * This method indicates that the selection has changed.
+	 * 
+	 * @param action The action
+	 * @param selection The selection
+	 */
+	public void selectionChanged(IAction action,
+            ISelection selection) {
+		m_selection = selection;
+	}
+
+	/**
+	 * This method sets the currently active workbench part.
+	 * 
+	 * @param action The action
+	 * @param targetPart The active workbench part
+	 */
+	public void setActivePart(IAction action,
+            IWorkbenchPart targetPart) {
+		m_targetPart = targetPart;
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="var" path="M2_REPO/javax/xml/jaxb-impl/2.1/jaxb-impl-2.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tap.model</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA TAP Model
+Bundle-SymbolicName: org.savara.tap.model
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tap.model.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Export-Package: org.savara.tap.model,
+ org.savara.tap.model.admin
+Require-Bundle: org.scribble.common

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               schema/,\
+               Copyright.txt
+src.includes = schema/,\
+               pom.xml,\
+               src/,\
+               Copyright.txt,\
+               META-INF/,\
+               build.properties,\
+               .classpath,\
+               .project,\
+               .settings/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,40 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tap.model</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsTAPModel</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+ 	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>javax.xml</groupId>
+ 			<artifactId>jaxb-api</artifactId>
+ 			<version>${jaxb.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>javax.xml</groupId>
+ 			<artifactId>jaxb-impl</artifactId>
+ 			<version>${jaxb.version}</version>
+ 		</dependency>
+ 		<!--
+ 		<dependency>
+ 			<groupId>javax.xml</groupId>
+ 			<artifactId>jaxb-xjc</artifactId>
+ 			<version>${jaxb.version}</version>
+ 		</dependency>
+ 		-->
+ 	</dependencies>
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/schema/tap.xsd
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/schema/tap.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/schema/tap.xsd	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.savara.org/ta/project" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.savara.org/ta/project">
+
+
+    <complexType name="Project">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="phase" type="tns:Phase"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    			</sequence>
+    			<attribute name="name" type="string" use="required"></attribute>
+    			<attribute name="version" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Phase">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="resource" type="tns:Resource" maxOccurs="unbounded" minOccurs="0"></element>
+    			</sequence>
+    			<attribute name="name" type="string" use="required"></attribute>
+
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Resource">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="uri" type="tns:URI"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    				<element name="relationship" type="tns:Relationship" maxOccurs="unbounded" minOccurs="0"></element>
+    			</sequence>
+    			<attribute name="id" type="ID" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Relationship">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="link" type="tns:Link"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    			</sequence>
+    			<attribute name="ref" type="IDREF" use="required"></attribute>
+    			<attribute name="type" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Link">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<attribute name="from" type="string"></attribute>
+
+    			<attribute name="to" type="string"></attribute>
+
+    			<attribute name="type" type="string" use="required"></attribute>
+
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+
+    <complexType name="Root">
+    	<sequence>
+    		<element name="description" type="string" maxOccurs="1"
+    			minOccurs="0">
+    		</element>
+    		<any namespace="##other" processContents="lax" maxOccurs="100"
+    			minOccurs="0" />
+    	</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+    </complexType>
+
+    <complexType name="URI">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<attribute name="type" type="string" use="required"></attribute>
+    			<attribute name="context" type="string" use="required"></attribute>
+    			<attribute name="locator" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <element name="project" type="tns:Project"></element>
+</schema>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Link.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Link.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Link.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,122 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Link complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Link">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;attribute name="from" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="to" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Link")
+public class Link
+    extends Root
+{
+
+    @XmlAttribute
+    protected String from;
+    @XmlAttribute
+    protected String to;
+    @XmlAttribute(required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the from property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFrom() {
+        return from;
+    }
+
+    /**
+     * Sets the value of the from property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFrom(String value) {
+        this.from = value;
+    }
+
+    /**
+     * Gets the value of the to property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTo() {
+        return to;
+    }
+
+    /**
+     * Sets the value of the to property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTo(String value) {
+        this.to = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/ObjectFactory.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/ObjectFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/ObjectFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,108 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.savara.tap.model package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Project_QNAME = new QName("http://www.savara.org/ta/project", "project");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.savara.tap.model
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link Resource }
+     * 
+     */
+    public Resource createResource() {
+        return new Resource();
+    }
+
+    /**
+     * Create an instance of {@link Phase }
+     * 
+     */
+    public Phase createPhase() {
+        return new Phase();
+    }
+
+    /**
+     * Create an instance of {@link URI }
+     * 
+     */
+    public URI createURI() {
+        return new URI();
+    }
+
+    /**
+     * Create an instance of {@link Link }
+     * 
+     */
+    public Link createLink() {
+        return new Link();
+    }
+
+    /**
+     * Create an instance of {@link Root }
+     * 
+     */
+    public Root createRoot() {
+        return new Root();
+    }
+
+    /**
+     * Create an instance of {@link Relationship }
+     * 
+     */
+    public Relationship createRelationship() {
+        return new Relationship();
+    }
+
+    /**
+     * Create an instance of {@link Project }
+     * 
+     */
+    public Project createProject() {
+        return new Project();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Project }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://www.savara.org/ta/project", name = "project")
+    public JAXBElement<Project> createProject(Project value) {
+        return new JAXBElement<Project>(_Project_QNAME, Project.class, null, value);
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Phase.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Phase.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Phase.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,105 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Phase complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Phase">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;sequence>
+ *         &lt;element name="resource" type="{http://www.savara.org/ta/project}Resource" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Phase", propOrder = {
+    "resource"
+})
+public class Phase
+    extends Root
+{
+
+    protected List<Resource> resource;
+    @XmlAttribute(required = true)
+    protected String name;
+
+    /**
+     * Gets the value of the resource property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the resource property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getResource().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Resource }
+     * 
+     * 
+     */
+    public List<Resource> getResource() {
+        if (resource == null) {
+            resource = new ArrayList<Resource>();
+        }
+        return this.resource;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Project.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Project.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Project.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,132 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Project complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Project">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;sequence>
+ *         &lt;element name="phase" type="{http://www.savara.org/ta/project}Phase" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Project", propOrder = {
+    "phase"
+})
+public class Project
+    extends Root
+{
+
+    protected List<Phase> phase;
+    @XmlAttribute(required = true)
+    protected String name;
+    @XmlAttribute(required = true)
+    protected String version;
+
+    /**
+     * Gets the value of the phase property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the phase property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getPhase().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Phase }
+     * 
+     * 
+     */
+    public List<Phase> getPhase() {
+        if (phase == null) {
+            phase = new ArrayList<Phase>();
+        }
+        return this.phase;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Relationship.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Relationship.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Relationship.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,136 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlIDREF;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Relationship complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Relationship">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;sequence>
+ *         &lt;element name="link" type="{http://www.savara.org/ta/project}Link" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Relationship", propOrder = {
+    "link"
+})
+public class Relationship
+    extends Root
+{
+
+    protected List<Link> link;
+    @XmlAttribute(required = true)
+    @XmlIDREF
+    @XmlSchemaType(name = "IDREF")
+    protected Object ref;
+    @XmlAttribute(required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the link property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the link property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLink().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Link }
+     * 
+     * 
+     */
+    public List<Link> getLink() {
+        if (link == null) {
+            link = new ArrayList<Link>();
+        }
+        return this.link;
+    }
+
+    /**
+     * Gets the value of the ref property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Object }
+     *     
+     */
+    public Object getRef() {
+        return ref;
+    }
+
+    /**
+     * Sets the value of the ref property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Object }
+     *     
+     */
+    public void setRef(Object value) {
+        this.ref = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Resource.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Resource.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Resource.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,144 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for Resource complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Resource">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;sequence>
+ *         &lt;element name="uri" type="{http://www.savara.org/ta/project}URI" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="relationship" type="{http://www.savara.org/ta/project}Relationship" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Resource", propOrder = {
+    "uri",
+    "relationship"
+})
+public class Resource
+    extends Root
+{
+
+    protected List<URI> uri;
+    protected List<Relationship> relationship;
+    @XmlAttribute(required = true)
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    @XmlSchemaType(name = "ID")
+    protected String id;
+
+    /**
+     * Gets the value of the uri property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the uri property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getUri().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link URI }
+     * 
+     * 
+     */
+    public List<URI> getUri() {
+        if (uri == null) {
+            uri = new ArrayList<URI>();
+        }
+        return this.uri;
+    }
+
+    /**
+     * Gets the value of the relationship property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the relationship property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getRelationship().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Relationship }
+     * 
+     * 
+     */
+    public List<Relationship> getRelationship() {
+        if (relationship == null) {
+            relationship = new ArrayList<Relationship>();
+        }
+        return this.relationship;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Root.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Root.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/Root.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,139 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for Root complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Root">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;any processContents='lax' namespace='##other' maxOccurs="100" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Root", propOrder = {
+    "description",
+    "any"
+})
+ at XmlSeeAlso({
+    Project.class,
+    Resource.class,
+    Link.class,
+    Relationship.class,
+    Phase.class,
+    URI.class
+})
+public class Root {
+
+    protected String description;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Object }
+     * {@link Element }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/URI.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/URI.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/URI.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,122 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+
+package org.savara.tap.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for URI complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="URI">
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://www.savara.org/ta/project}Root">
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="context" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="locator" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "URI")
+public class URI
+    extends Root
+{
+
+    @XmlAttribute(required = true)
+    protected String type;
+    @XmlAttribute(required = true)
+    protected String context;
+    @XmlAttribute(required = true)
+    protected String locator;
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the context property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getContext() {
+        return context;
+    }
+
+    /**
+     * Sets the value of the context property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setContext(String value) {
+        this.context = value;
+    }
+
+    /**
+     * Gets the value of the locator property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLocator() {
+        return locator;
+    }
+
+    /**
+     * Sets the value of the locator property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLocator(String value) {
+        this.locator = value;
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/ResourceLoader.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/ResourceLoader.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/ResourceLoader.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.model.admin;
+
+import org.savara.tap.model.Resource;
+import org.scribble.model.ModelReference;
+import org.scribble.common.logging.Journal;
+
+public interface ResourceLoader {
+
+	/**
+	 * This method determines whether the resource loader can
+	 * retrieve the contents associated with the supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return Whether the contents can be retrieved
+	 */
+	public boolean isSupported(Resource resource);
+	
+	/**
+	 * This method determines if the supplied resource exists.
+	 * 
+	 * @param resource The resource
+	 * @return Whether the resource exists
+	 */
+	public boolean exists(Resource resource);
+	
+	/**
+	 * This method retrieves the contents associated with the
+	 * supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The contents, or null if not found
+	 */
+	public java.io.InputStream getContents(Resource resource);
+	
+	/**
+	 * This method retrieves the URI associated with the
+	 * supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The URI, or null if not found
+	 */
+	public java.net.URI getURI(Resource resource);
+	
+	/**
+	 * This method retrieves the contents associated with the
+	 * supplied URI. If the URI is a relative path, then the resource will
+	 * be located relative to the supplied model reference.
+	 * 
+	 * @param ref The model reference
+	 * @param uri The URI
+	 * @return The contents, or null if not found
+	 */
+	public java.io.InputStream getContents(ModelReference ref, String uri);
+	
+	/**
+	 * This method retrieves the URI associated with the
+	 * supplied URI string. If the supplied URI is a relative path,
+	 * then the resource will be located relative to the supplied 
+	 * model reference.
+	 * 
+	 * @param ref The model reference
+	 * @param uri The URI
+	 * @return The resolved URI, or null if not found
+	 */
+	public java.net.URI getURI(ModelReference ref, String uri);
+	
+	/**
+	 * This method returns a model listener associated with the supplied resource.
+	 * 
+	 * @param res The resource
+	 * @return The model listener associated with the resource
+	 */
+	public ModelListener getResourceModelListener(Resource res);
+
+	/**
+	 * This method frees a model listener associated with the supplied resource.
+	 * 
+	 * @param res The resource
+	 * @param l The model listener associated with the resource
+	 */
+	public void freeResourceModelListener(Resource res, ModelListener l);
+
+	/**
+	 * This method returns the model reference associated with the supplied resource.
+	 * 
+	 * @param resource The resource
+	 * @return The model reference
+	 */
+	public ModelReference getModelReference(Resource resource);
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/TAPModelUtil.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/TAPModelUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/admin/TAPModelUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.model.admin;
+
+import java.io.IOException;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.savara.tap.model.ObjectFactory;
+import org.savara.tap.model.Project;
+
+/**
+ * This class contains utility methods associated with the Testable Architecture Project (TAP)
+ * model.
+ *
+ */
+public class TAPModelUtil {
+
+	/**
+	 * This method deserializes a TAP project model from an XML document provided in
+	 * the supplied input stream.
+	 * 
+	 * @param is The input stream containing the XML document
+	 * @return The TAP project
+	 * @throws IOException Failed to deserialize the project
+	 */
+	public static Project deserialize(java.io.InputStream is) throws IOException {
+		Project ret=null;
+		
+		try {
+			JAXBContext context = JAXBContext.newInstance("org.savara.tap.model");
+			Unmarshaller unmarshaller = context.createUnmarshaller();
+			
+			//note: setting schema to null will turn validator off
+			//unmarshaller.setSchema(null);
+			Object xmlObject = unmarshaller.unmarshal(is);
+			
+			if (xmlObject instanceof JAXBElement) {
+				ret = (Project)((JAXBElement<?>)xmlObject).getValue();
+			}
+			
+		} catch(Exception e) {
+			throw new IOException("Failed to deserialize 'testable architecture project'", e);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method serializes a TAP project model into an XML representation, stored
+	 * in the supplied output stream.
+	 * 
+	 * @param project The project to be serialized
+	 * @param os The output stream on which to record the serialized project
+	 * @throws IOException Failed to serialize the project
+	 */
+	public static void serialize(Project project, java.io.OutputStream os) throws IOException {
+		
+		try {
+			org.savara.tap.model.ObjectFactory factory=
+						new org.savara.tap.model.ObjectFactory();
+			
+			JAXBContext context = JAXBContext.newInstance(Project.class);
+			Marshaller marshaller = context.createMarshaller();
+			marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+			
+			marshaller.marshal(factory.createProject(project), os);
+		} catch(Exception e) {
+			throw new IOException("Failed to serialize 'testable architecture project'", e);
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tap.model.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext context;
+
+	static BundleContext getContext() {
+		return context;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		Activator.context = bundleContext;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		Activator.context = null;
+	}
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/package-info.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/package-info.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/src/java/org/savara/tap/model/package-info.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2010.09.14 at 02:07:43 PM BST 
+//
+
+ at javax.xml.bind.annotation.XmlSchema(namespace = "http://www.savara.org/ta/project", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.savara.tap.model;

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="src" path="src/resources"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tap.validation</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA TAP Validation
+Bundle-SymbolicName: org.savara.tap.validation;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tap.validation.osgi.Activator
+Bundle-Vendor: www.savara.org
+Service-Component: OSGI-INF/bpel-cdm-relationship-validator.xml,
+ OSGI-INF/cdm-scenario-relationship-validator.xml
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.savara.tap.model,
+ org.scribble.common,
+ org.pi4soa.scenario,
+ org.pi4soa.cdl
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.savara.tap.validation

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/bpel-cdm-relationship-validator.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/bpel-cdm-relationship-validator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/bpel-cdm-relationship-validator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="bpel-cdm-relationship-validator">
+	<implementation class="org.savara.tap.validation.ws.BPELCDMRelationshipValidator"/>
+	<service>
+		<provide interface="org.savara.tap.validation.RelationshipValidator"/>
+	</service>
+</component>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/cdm-scenario-relationship-validator.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/cdm-scenario-relationship-validator.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/OSGI-INF/cdm-scenario-relationship-validator.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="cdm-scenario-relationship-validator">
+	<implementation class="org.savara.tap.validation.cdl.CDMScenarioRelationshipValidator"/>
+	<service>
+		<provide interface="org.savara.tap.validation.RelationshipValidator"/>
+	</service>
+</component>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+source.. = src/java/,\
+           src/resources/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               build.properties,\
+               OSGI-INF/,\
+               Copyright.txt
+src.includes = .classpath,\
+               .project,\
+               Copyright.txt,\
+               META-INF/,\
+               OSGI-INF/,\
+               plugin.xml,\
+               pom.xml,\
+               build.properties,\
+               src/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!--
+  <extension point="org.eclipse.ui.popupMenus"> 
+	<objectContribution 
+      id="org.savara.tap.validation.contribution1"
+   			objectClass="org.eclipse.core.resources.IFile"
+   				nameFilter="*.tap">
+	  <menu
+         id="org.savara.tools.menu"
+         label="Savara"
+         path="additions">
+      	<separator name="group1"/>
+      </menu>
+      <action
+           label="Validate"
+           class="org.savara.tap.validation.action.ValidateAction"
+           menubarPath="org.savara.tools.menu/group1"
+           enablesFor="1"
+           id="org.savara.tap.validation.ValidateAction">
+     </action> 
+    </objectContribution> 
+  </extension>
+-->
+  
+  <extension
+        point="org.eclipse.ui.startup">
+     <startup
+           class="org.savara.tap.validation.osgi.Activator">
+     </startup>
+  </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tap.validation</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsTAPValidation</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+ 	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 	</dependencies>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/Messages.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/Messages.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/Messages.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+#/*
+# * 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.
+# */
+
+SAVARATAPV-00001=Unable to load resource type for resource with id "{0}"
+SAVARATAPV-00002=Unable to locate resource with id "{0}"

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/RelationshipValidator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/RelationshipValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/RelationshipValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.validation;
+
+import org.savara.tap.model.Relationship;
+import org.savara.tap.model.Resource;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This interface provides validation for relationships defined within a Testable
+ * Architecture Project (TAP) model.
+ *
+ */
+public interface RelationshipValidator {
+
+	/**
+	 * This method determines whether the validator supports the
+	 * supplied resource and relationship types.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param toResource The 'to' resource to be validated
+	 * @return Whether the validator supports the resource types
+	 */
+	public boolean isSupported(Relationship rel, Resource fromResource, Resource toResource);
+	
+	/**
+	 * This method validates the supplied resources and relationship,
+	 *  and reports any issues to the supplied model listener.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param fromRL The 'from' resource loader
+	 * @param toResource The 'to' resource to be validated
+	 * @param toRL The 'to' resource loader
+	 * @param l The model listener
+	 */
+	public void validate(Relationship rel, Resource fromResource, ResourceLoader fromRL, 
+			Resource toResource, ResourceLoader toRL, ModelListener l);
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ResourceValidator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ResourceValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ResourceValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.validation;
+
+import org.savara.tap.model.Resource;
+import org.scribble.common.logging.Journal;
+
+/**
+ * This interface provides validation for resources within a Testable
+ * Architecture Project (TAP) model.
+ *
+ */
+public interface ResourceValidator {
+
+	/**
+	 * This method determines whether the validator supports the
+	 * supplied resource type.
+	 * 
+	 * @param resource The resource to be validated
+	 * @return Whether the validator supports the resource type
+	 */
+	public boolean isSupported(Resource resource);
+	
+	/**
+	 * This method validates the supplied resource and reports
+	 * any issues to the supplied model listener.
+	 * 
+	 * @param resource The resource
+	 * @param is The resource input stream
+	 * @param l The model listener
+	 */
+	public void validate(Resource resource, java.io.InputStream is, ModelListener l);
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/TAPValidator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/TAPValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/TAPValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,360 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.validation;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.savara.tap.model.Phase;
+import org.savara.tap.model.Project;
+import org.savara.tap.model.Relationship;
+import org.savara.tap.model.Resource;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.scribble.model.ModelReference;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.common.logging.Journal;
+import org.scribble.model.resolutions.ShowReferencedDescription;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * This class provides the validation control mechanism for a TAP
+ * project file.
+ *
+ */
+public class TAPValidator {
+	
+	private static Logger logger = Logger.getLogger(TAPValidator.class.getName());	
+
+	private static java.util.List<ResourceLoader> m_resourceLoaders=
+						new java.util.Vector<ResourceLoader>();
+	private static java.util.List<ResourceValidator> m_resourceValidators=
+						new java.util.Vector<ResourceValidator>();
+	private static java.util.List<RelationshipValidator> m_relationshipValidators=
+						new java.util.Vector<RelationshipValidator>();
+
+	private static TAPValidator m_instance=new TAPValidator();
+	
+	protected TAPValidator() {
+	}
+	
+	public static TAPValidator getInstance() {
+		return(m_instance);
+	}
+	
+	/**
+	 * This method adds a resource loader.
+	 * 
+	 * @param rl The resource loader
+	 */
+	public void addResourceLoader(ResourceLoader rl) {
+		m_resourceLoaders.add(rl);
+	}
+	
+	/**
+	 * This method removes a resource loader.
+	 * 
+	 * @param rl The resource loader
+	 */
+	public void removeResourceLoader(ResourceLoader rl) {
+		m_resourceLoaders.remove(rl);
+	}
+	
+	/**
+	 * This method adds a resource validator.
+	 * 
+	 * @param rv The resource validator
+	 */
+	public void addResourceValidator(ResourceValidator rv) {
+		m_resourceValidators.add(rv);
+	}
+	
+	/**
+	 * This method removes a resource validator.
+	 * 
+	 * @param rv The resource validator
+	 */
+	public void removeResourceValidator(ResourceValidator rv) {
+		m_resourceValidators.remove(rv);
+	}
+	
+	/**
+	 * This method adds a relationship validator.
+	 * 
+	 * @param rv The relationship validator
+	 */
+	public void addRelationshipValidator(RelationshipValidator rv) {
+		m_relationshipValidators.add(rv);
+	}
+	
+	/**
+	 * This method removes a relationship validator.
+	 * 
+	 * @param rv The relationship validator
+	 */
+	public void removeRelationshipValidator(RelationshipValidator rv) {
+		m_relationshipValidators.remove(rv);
+	}
+	
+	/**
+	 * This method validates a TAP project.
+	 * 
+	 * @param project The TAP project
+	 * @param l The model listener
+	 */
+	public void validate(Project project, ModelListener l) {
+		
+		// Load and validate the individual resources
+		for (Phase phase : project.getPhase()) {
+			for (Resource resource : phase.getResource()) {
+				ModelListener ml=getResourceModelListener(resource);
+				
+				// Validate resource
+				for (ResourceValidator rv : m_resourceValidators) {
+					if (rv.isSupported(resource)) {
+						// Obtain input stream for resource
+						ResourceLoader rl=getResourceLoader(resource);
+						java.io.InputStream is=rl.getContents(resource);
+						
+						if (is != null) {
+							rv.validate(resource, is, ml);
+						
+							try {
+								is.close();
+							} catch(Exception e) {
+								logger.log(Level.SEVERE, "Failed to close resource '"+
+										resource.getId()+"' input stream", e);
+							}
+						} else {
+							// TODO: Log error - resource validator supports resource
+							// but cannot be loaded (or possibly a warning)?
+						}
+						break;
+					}
+				}
+				
+				for (Relationship rel : resource.getRelationship()) {
+					Resource toResource=(Resource)rel.getRef();
+					
+					if (toResource !=null) {
+						// Obtain input stream for resource
+						ResourceLoader fromRL=getResourceLoader(resource);
+						ResourceLoader toRL=getResourceLoader(toResource);
+						
+						if (fromRL == null) {
+							l.error(new ModelIssue(null,
+									MessageFormat.format(
+											java.util.PropertyResourceBundle.getBundle(
+												"org.savara.tap.validation.Messages").
+													getString("SAVARATAPV-00001"), resource.getId())));
+						} else if (toRL == null) {
+							l.error(new ModelIssue(null,
+									MessageFormat.format(
+											java.util.PropertyResourceBundle.getBundle(
+												"org.savara.tap.validation.Messages").
+													getString("SAVARATAPV-00001"), toResource.getId())));
+						} else if (!fromRL.exists(resource)) {
+							l.error(new ModelIssue(null,
+									MessageFormat.format(
+											java.util.PropertyResourceBundle.getBundle(
+												"org.savara.tap.validation.Messages").
+													getString("SAVARATAPV-00002"), resource.getId())));
+						} else if (!toRL.exists(toResource)) {
+							l.error(new ModelIssue(null,
+									MessageFormat.format(
+											java.util.PropertyResourceBundle.getBundle(
+												"org.savara.tap.validation.Messages").
+													getString("SAVARATAPV-00002"), toResource.getId())));
+						} else {
+							ModelReference ref=toRL.getModelReference(toResource);
+							
+							ModelListener proxyml=new InnerModelListener(ref, ml);
+							
+							for (RelationshipValidator rv : m_relationshipValidators) {
+								
+								if (rv.isSupported(rel, resource, toResource)) {
+									rv.validate(rel, resource, fromRL, toResource, toRL, proxyml);
+								
+									break;
+								}
+							}
+						}
+					} else {
+						logger.severe("Linked resource with id '"+rel.getRef()+
+								"' not found for resource '"+resource.getId()+"'");
+					}
+				}
+				
+				freeResourceModelListener(resource, ml);
+			}
+		}
+	}
+	
+	/**
+	 * This method can be used to determine whether the supplied input stream
+	 * contains a valid TAP document.
+	 * 
+	 * @param is The TAP content
+	 * @param l
+	 * @return
+	 */
+	public boolean isValidTAPDocument(java.io.InputStream is, ModelListener l) {
+		boolean ret=false;
+		
+        try {
+
+            // Parse an XML document into a DOM tree.
+        	DocumentBuilderFactory f=DocumentBuilderFactory.newInstance();
+        	f.setNamespaceAware(true);
+        	
+            DocumentBuilder parser=f.newDocumentBuilder();
+            
+            Document document = parser.parse(is);
+
+            // Create a SchemaFactory capable of understanding WXS schemas.
+            SchemaFactory factory =
+                SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+            // Load a WXS schema, represented by a Schema instance.
+            java.io.InputStream schemais=TAPValidator.class.getResourceAsStream("/tap.xsd");
+            
+            Source schemaFile = new StreamSource(schemais);
+            Schema schema = factory.newSchema(schemaFile);
+            
+            schemais.close();
+
+            // Create a Validator object, which can be used to validate
+            // an instance document.
+            Validator validator = schema.newValidator();
+
+            // Validate the DOM tree.
+            validator.validate(new DOMSource(document));
+            
+            ret = true;
+
+        } catch (ParserConfigurationException e) {
+			l.error(new ModelIssue(null, "Failed to parse TAP document: "+e.getMessage()));
+        } catch (SAXException e) {
+			l.error(new ModelIssue(null, "Invalid TAP document: "+e.getMessage()));
+        } catch (IOException e) {
+			l.error(new ModelIssue(null, "Failed to load TAP document: "+e.getMessage()));
+		}
+        
+        return(ret);
+	}
+	
+	protected ResourceLoader getResourceLoader(Resource resource) {
+		ResourceLoader ret=null;
+		
+		try {
+			for (ResourceLoader rl : m_resourceLoaders) {
+				if (rl.isSupported(resource)) {
+					ret = rl;
+					
+					if (ret != null) {
+						break;
+					}
+				}
+			}
+		} catch(Exception e) {
+			logger.log(Level.SEVERE, "Failed to get resource loader for resource '"+
+						resource.getId()+"'", e);
+		}
+		
+		return(ret);
+	}
+	
+	protected ModelListener getResourceModelListener(Resource resource) {
+		ModelListener ret=null;
+		
+		for (ResourceLoader rl : m_resourceLoaders) {
+			if (rl.isSupported(resource)) {
+				ret = rl.getResourceModelListener(resource);
+				
+				if (ret != null) {
+					break;
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	protected void freeResourceModelListener(Resource resource, ModelListener l) {
+		
+		for (ResourceLoader rl : m_resourceLoaders) {
+			if (rl.isSupported(resource)) {
+				rl.freeResourceModelListener(resource, l);
+				break;
+			}
+		}
+	}
+	
+	public class InnerModelListener implements ModelListener {
+		
+		private ModelListener m_listener=null;
+		private ModelReference m_reference=null;
+		
+		public InnerModelListener(ModelReference ref, ModelListener l) {
+			m_reference = ref;
+			m_listener = l;
+		}
+		
+		public void error(ModelIssue issue) {
+						
+			ShowReferencedDescription res=new ShowReferencedDescription();
+			res.setModel(m_reference);
+			
+			if (issue.getModelObject() != null) {
+				res.setSourceReference(issue.getModelObject().getSource());
+			}
+			
+			issue.getResolutions().add(res);
+			
+			m_listener.error(issue);
+		}
+
+		public void warning(ModelIssue issue) {
+			ShowReferencedDescription res=new ShowReferencedDescription();
+			res.setModel(m_reference);
+			res.setSourceReference(issue.getModelObject().getSource());
+						
+			issue.getResolutions().add(res);
+
+			m_listener.warning(issue);
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/cdl/CDMScenarioRelationshipValidator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/cdl/CDMScenarioRelationshipValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/cdl/CDMScenarioRelationshipValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.validation.cdl;
+
+import org.pi4soa.cdl.CDLManager;
+import org.savara.tap.model.Relationship;
+import org.savara.tap.model.Resource;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.savara.tap.validation.RelationshipValidator;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.common.logging.Journal;
+
+public class CDMScenarioRelationshipValidator implements RelationshipValidator {
+
+	/**
+	 * This method determines whether the validator supports the
+	 * supplied resource and relationship types.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param toResource The 'to' resource to be validated
+	 * @return Whether the validator supports the resource types
+	 */
+	public boolean isSupported(Relationship rel, Resource fromResource, Resource toResource) {
+		boolean ret=false;
+		
+		if (fromResource.getId().endsWith(".cdm") && toResource.getId().endsWith(".scn")) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method validates the supplied resources and relationship,
+	 *  and reports any issues to the supplied model listener.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param fromRL The 'from' resource loader
+	 * @param toResource The 'to' resource to be validated
+	 * @param toRL The 'to' resource loader
+	 * @param l The model listener
+	 */
+	public void validate(Relationship rel, Resource fromResource, final ResourceLoader fromRL, 
+				Resource toResource, final ResourceLoader toRL, ModelListener l) {
+		java.net.URI cdmURI=fromRL.getURI(fromResource);
+		java.net.URI scnURI=toRL.getURI(toResource);
+		
+		Simulator simulator=new Simulator(scnURI.getPath(), cdmURI.getPath());
+		
+		simulator.run();
+		
+		if (simulator.isFailed()) {
+			l.error(new ModelIssue(null, "Choreography does not satisfy scenario with id '"+
+					toResource.getId()+"'"));
+		}
+	}
+
+	public class Simulator extends org.pi4soa.scenario.simulation.ScenarioSimulator {
+		
+		private String m_cdmPath=null;
+		private boolean m_failed=false;
+		
+		public Simulator(String scenarioPath, String cdmPath) {
+			super(scenarioPath, null);
+		
+			m_cdmPath = cdmPath;
+		}
+		
+		@Override
+		protected org.pi4soa.cdl.Package loadCDL(String cdlurl,
+				String scenarioFile) {
+			// Ignore the parameters and use the TAP configured file
+			org.pi4soa.cdl.Package ret=null;
+			
+			try {
+				ret = CDLManager.load(m_cdmPath);
+			} catch(Exception e) {
+				e.printStackTrace();
+			}
+			
+			return(ret);
+		}
+		
+		@Override
+		protected void failed(String id, String text) {
+			m_failed = true;
+		}
+		
+		public boolean isFailed() {
+			return(m_failed);
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+package org.savara.tap.validation.osgi;
+
+import java.util.logging.Logger;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.savara.tap.validation.RelationshipValidator;
+import org.savara.tap.validation.ResourceValidator;
+import org.savara.tap.validation.TAPValidator;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin implements org.eclipse.ui.IStartup {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tap.validation"; //$NON-NLS-1$
+
+	private static Logger logger=Logger.getLogger(Activator.class.getName());
+	
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+		
+		// Get resource loaders
+		ServiceReference[] srefs=context.getServiceReferences(ResourceLoader.class.getName(), null);
+	
+		if (srefs != null) {
+			for (ServiceReference sr : srefs) {
+				ResourceLoader rl=(ResourceLoader)context.getService(sr);
+				
+				if (rl != null) {
+					TAPValidator.getInstance().addResourceLoader(rl);
+				} else {
+					logger.severe("ResourceLoader does not exist for service ref: "+sr);
+				}
+			}
+		}
+
+		// Get resource validators
+		srefs = context.getServiceReferences(ResourceValidator.class.getName(), null);
+	
+		if (srefs != null) {
+			for (ServiceReference sr : srefs) {
+				ResourceValidator rv=(ResourceValidator)context.getService(sr);
+				
+				if (rv != null) {
+					TAPValidator.getInstance().addResourceValidator(rv);
+				} else {
+					logger.severe("ResourceValidator does not exist for service ref: "+sr);
+				}
+			}
+		}
+
+		// Get relationship validators
+		srefs = context.getServiceReferences(RelationshipValidator.class.getName(), null);
+	
+		if (srefs != null) {
+			for (ServiceReference sr : srefs) {
+				RelationshipValidator rv=(RelationshipValidator)context.getService(sr);
+				
+				if (rv != null) {
+					TAPValidator.getInstance().addRelationshipValidator(rv);
+				} else {
+					logger.severe("RelationshipValidator does not exist for service ref: "+sr);
+				}
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	public void earlyStartup() {
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ws/BPELCDMRelationshipValidator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ws/BPELCDMRelationshipValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/java/org/savara/tap/validation/ws/BPELCDMRelationshipValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tap.validation.ws;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+
+import org.savara.tap.model.Link;
+import org.savara.tap.model.Relationship;
+import org.savara.tap.model.Resource;
+import org.savara.tap.model.admin.ResourceLoader;
+import org.savara.tap.validation.RelationshipValidator;
+import org.scribble.model.Model;
+import org.scribble.model.ModelReference;
+import org.scribble.model.Role;
+import org.scribble.model.admin.Context;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.common.logging.Journal;
+
+public class BPELCDMRelationshipValidator implements RelationshipValidator {
+
+	/**
+	 * This method determines whether the validator supports the
+	 * supplied resource and relationship types.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param toResource The 'to' resource to be validated
+	 * @return Whether the validator supports the resource types
+	 */
+	public boolean isSupported(Relationship rel, Resource fromResource, Resource toResource) {
+		boolean ret=false;
+		
+		// NOTE: When more than one choreography model is available, we may need to just find
+		// a way to identify whether a parser exists to convert the 'toResource' into a
+		// global protocol model
+		if (fromResource.getId().endsWith(".bpel") && toResource.getId().endsWith(".cdm")) {
+			
+			// Check that a link exists with type 'role' and a 'to' field containing the target
+			// role (or participant in CDL case)
+			for (Link link : rel.getLink()) {
+				if (link.getType().equals("role") && link.getTo() != null) {
+					ret = true;
+					break;
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method validates the supplied resources and relationship,
+	 *  and reports any issues to the supplied model listener.
+	 * 
+	 * @param rel The relationship details
+	 * @param fromResource The 'from' resource to be validated
+	 * @param fromRL The 'from' resource loader
+	 * @param toResource The 'to' resource to be validated
+	 * @param toRL The 'to' resource loader
+	 * @param l The model listener
+	 */
+	public void validate(Relationship rel, Resource fromResource, final ResourceLoader fromRL, 
+				Resource toResource, final ResourceLoader toRL, ModelListener l) {
+		String roleName=null;
+		
+		// Get the 'to' role associated with the link
+		for (Link link : rel.getLink()) {
+			if (link.getType().equals("role") && link.getTo() != null) {
+				roleName = link.getTo();
+				break;
+			}
+		}
+		
+		if (roleName == null) {
+			ModelIssue issue=new ModelIssue();
+			issue.setMessage("Role not defined on relationship link");
+			l.error(issue);
+		} else {
+			org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
+			
+			org.scribble.model.ModelReference fromRef=fromRL.getModelReference(fromResource);
+					//new org.scribble.model.ModelReference("bpel");
+			
+			java.io.InputStream fromIS=fromRL.getContents(fromResource);
+			
+			org.scribble.model.Model fromModel=p.parse(fromRef, fromIS, l,
+							new ResourceLoaderContext(fromRL));
+			
+			if (fromModel == null) {
+				ModelIssue issue=new ModelIssue();
+				issue.setMessage("Failed to parse '"+fromResource.getId()+"'");
+				l.error(issue);
+			} else {
+			
+				org.scribble.model.ModelReference toRef=toRL.getModelReference(toResource);
+					//new org.scribble.model.ModelReference("cdm");
+			
+				java.io.InputStream toIS=fromRL.getContents(toResource);
+
+				org.scribble.model.Model toModel=p.parse(toRef, toIS, l,
+								new ResourceLoaderContext(toRL));
+				
+				if (toModel == null) {
+					ModelIssue issue=new ModelIssue();
+					issue.setMessage("Failed to parse related resource '"+toResource.getId()+
+								"' for resource '"+fromResource.getId()+"'");
+					l.error(issue);
+					
+				} else {
+					org.scribble.projector.Projector projector=new org.scribble.projector.DefaultProjector();
+					
+					Role role=new Role(roleName);
+					
+					org.scribble.model.Model toLocalModel=projector.project(toRef, toModel, role, l);
+			
+					if (toLocalModel == null) {
+						ModelIssue issue=new ModelIssue();
+						issue.setMessage("Failed to project related resource '"+toResource.getId()+
+									"', role '"+roleName+"', for resource '"+fromResource.getId()+"'");
+						l.error(issue);
+					} else {
+						org.scribble.comparator.Comparator comparator=new org.scribble.comparator.DefaultComparator();
+						
+						if (comparator.compare((Model)fromModel, fromRef, (Model)toLocalModel, toRef, l)) {
+							//System.out.println("COMPARE OK");
+						} else {
+							//System.out.println("COMPARE NOT OK");
+						}
+					}
+				}
+			}
+		}
+	}
+
+	public class ResourceLoaderContext implements Context {
+
+		private ResourceLoader m_resourceLoader=null;
+		
+		public ResourceLoaderContext(ResourceLoader rl) {
+			m_resourceLoader = rl;
+		}
+		
+		@Override
+		public InputStream getResource(ModelReference ref, String uri) {
+			return(m_resourceLoader.getContents(ref, uri));
+		}
+
+		@Override
+		public java.net.URI getResourceURI(ModelReference ref, String uri) {
+			return(m_resourceLoader.getURI(ref, uri));
+		}
+		
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/resources/tap.xsd
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/resources/tap.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/src/resources/tap.xsd	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.savara.org/ta/project" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.savara.org/ta/project">
+
+
+    <complexType name="Project">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="phase" type="tns:Phase"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    			</sequence>
+    			<attribute name="name" type="string" use="required"></attribute>
+    			<attribute name="version" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Phase">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="resource" type="tns:Resource" maxOccurs="unbounded" minOccurs="0"></element>
+    			</sequence>
+    			<attribute name="name" type="string" use="required"></attribute>
+
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Resource">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="uri" type="tns:URI"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    				<element name="relationship" type="tns:Relationship" maxOccurs="unbounded" minOccurs="0"></element>
+    			</sequence>
+    			<attribute name="id" type="ID" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Relationship">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<sequence>
+    				<element name="link" type="tns:Link"
+    					maxOccurs="unbounded" minOccurs="0">
+    				</element>
+    			</sequence>
+    			<attribute name="ref" type="IDREF" use="required"></attribute>
+    			<attribute name="type" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <complexType name="Link">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<attribute name="from" type="string"></attribute>
+
+    			<attribute name="to" type="string"></attribute>
+
+    			<attribute name="type" type="string" use="required"></attribute>
+
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+
+    <complexType name="Root">
+    	<sequence>
+    		<element name="description" type="string" maxOccurs="1"
+    			minOccurs="0">
+    		</element>
+    		<any namespace="##other" processContents="lax" maxOccurs="100"
+    			minOccurs="0" />
+    	</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+    </complexType>
+
+    <complexType name="URI">
+    	<complexContent>
+    		<extension base="tns:Root">
+    			<attribute name="type" type="string" use="required"></attribute>
+    			<attribute name="context" type="string" use="required"></attribute>
+    			<attribute name="locator" type="string" use="required"></attribute>
+    		</extension>
+    	</complexContent>
+    </complexType>
+
+    <element name="project" type="tns:Project"></element>
+</schema>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.bpel</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Tools BPEL Plug-in
+Bundle-SymbolicName: org.savara.tools.bpel;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.bpel.osgi.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.scribble.protocol,
+ org.scribble.common,
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.junit,
+ org.scribble.protocol.parser,
+ org.apache.commons.logging,
+ org.savara.pi4soa.cdm;resolution:=optional,
+ org.savara.contract.model,
+ org.savara.tools.wsdl,
+ org.eclipse.ui.ide,
+ org.eclipse.jst.common.frameworks,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.project.facet.core,
+ org.savara.wsdl,
+ org.savara.bpel,
+ org.savara.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: www.savara.org
+Scribble-Extensions: org.savara.tools.bpel.editor.BPELEditorManager

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,13 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               Copyright.txt
+src.includes = src/,\
+               plugin.xml,\
+               build.properties,\
+               META-INF/,\
+               Copyright.txt,\
+               .project,\
+               .classpath

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+  <extension point="org.eclipse.ui.popupMenus"> 
+	<objectContribution 
+      id="org.jboss.tools.overlord.cdl.bpel.object.contribution"
+   			objectClass="org.eclipse.core.resources.IFile"
+   				nameFilter="*.cdm">
+	  <menu
+         id="org.savara.tools.menu"
+         label="Savara"
+         path="additions">
+      	<separator name="group1"/>
+      </menu>
+	  <menu
+         id="generate.menu"
+         label="Generate"
+         path="org.savara.tools.menu/additions">
+      	<separator name="group2"/>
+      </menu>
+      <action
+           label="WS-BPEL"
+           class="org.savara.tools.bpel.actions.GenerateAction"
+           menubarPath="org.savara.tools.menu/generate.menu/group2"
+           enablesFor="1"
+           id="org.savara.tools.bpel.actions.GenerateAction">
+     </action> 
+    </objectContribution>
+  </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,44 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.bpel</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsBPEL</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.scribble.protocol.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/actions/GenerateAction.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/actions/GenerateAction.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/actions/GenerateAction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,115 @@
+/*
+ * 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.tools.bpel.actions;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.savara.tools.bpel.dialogs.*;
+import org.scribble.eclipse.util.*;
+
+
+/**
+ * This class implements the action to generate the choreography
+ * as a BPEL process.
+ */
+public class GenerateAction implements IObjectActionDelegate {
+
+	private static final String CANNOT_GENERATE = "Choreography has errors, so cannot generate";
+
+	public GenerateAction() {
+	}
+
+	/**
+	 * This method implements the action's run method.
+	 * 
+	 * @param action The action
+	 */
+	public void run(IAction action) {
+		if (m_selection instanceof StructuredSelection) {
+			StructuredSelection sel=(StructuredSelection)m_selection;
+			
+			IResource res=(IResource)sel.getFirstElement();
+			
+			if (res instanceof IFile) {
+				
+				if (ResourceUtil.hasErrors(res) == false) {
+					GenerateDialog dialog=
+						new GenerateDialog(m_targetPart.getSite().getShell(),
+									(IFile)res);
+					
+					try {
+						dialog.open();
+					} catch(Throwable e) {
+						logger.error("Failed to open generate dialog", e);
+					}
+				} else {
+					warn(CANNOT_GENERATE);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * This method indicates that the selection has changed.
+	 * 
+	 * @param action The action
+	 * @param selection The selection
+	 */
+	public void selectionChanged(IAction action,
+            ISelection selection) {
+		m_selection = selection;
+	}
+
+	/**
+	 * This method sets the currently active workbench part.
+	 * 
+	 * @param action The action
+	 * @param targetPart The active workbench part
+	 */
+	public void setActivePart(IAction action,
+            IWorkbenchPart targetPart) {
+		m_targetPart = targetPart;
+	}
+	
+	/**
+	 * This method is used to report a warning.
+	 * 
+	 * @param mesg The warning message
+	 */
+	public void warn(String mesg) {
+		
+		MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+				SWT.ICON_WARNING|SWT.OK);
+		mbox.setMessage(mesg);
+		mbox.open();
+	}
+
+	private static Log logger = LogFactory.getLog(GenerateAction.class);
+	
+	private ISelection m_selection=null;
+    private IWorkbenchPart m_targetPart=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/dialogs/GenerateDialog.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/dialogs/GenerateDialog.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/dialogs/GenerateDialog.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,344 @@
+/*
+ * 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.tools.bpel.dialogs;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.savara.tools.bpel.generator.*;
+import org.scribble.conversation.model.ConversationModel;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.protocol.model.*;
+import org.scribble.model.admin.DefaultModelListener;
+import org.scribble.model.admin.ModelRepository;
+
+/**
+ * This class provides the dialog for generating BPEL
+ * artefacts.
+ */
+public class GenerateDialog extends org.eclipse.jface.dialogs.Dialog {
+
+	/**
+	 * This is the constructor for the generate dialog.
+	 * 
+	 * @param shell The shell
+	 */
+	public GenerateDialog(Shell shell, IFile file) {
+		super(shell);
+		
+		m_file = file;
+		
+		initialize(m_file);
+	}
+	
+	/**
+	 * This method initializes the conversation model associated
+	 * with the supplied file resource.
+	 * 
+	 * @param res The file
+	 */
+	protected void initialize(IFile res) {
+		ModelReference ref=
+			org.scribble.eclipse.model.admin.OSGIModelRepository.createReference(res);
+		
+		if (ref != null) {
+			ModelRepository mrep=(ModelRepository)
+					RegistryFactory.getRegistry().getExtension(
+						ModelRepository.class, null);
+
+			if (mrep != null) {
+				Model model=mrep.getModel(ref,
+						new DefaultModelListener());
+		
+				if (model instanceof ConversationModel) {
+					m_conversationModel = (ConversationModel)model;
+						
+					m_localModelRefs = m_conversationModel.getLocalModels(ref);
+				}
+			}
+		}
+		
+		if (m_conversationModel == null) {
+			error("Unable to load model used to generate " +
+					"the BPEL artefacts", null);
+		}
+	}
+	
+	/**
+	 * This method creates the dialog details.
+	 * 
+	 * @param parent The parent control
+	 * @return The control containing the dialog components
+	 */
+	protected Control createDialogArea(Composite parent) {
+		
+		Composite composite=(Composite)super.createDialogArea(parent);
+		
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 1;
+		composite.setLayout(layout);		
+	
+		GridData gd=null;
+
+		Group group=new Group(composite, SWT.H_SCROLL|SWT.V_SCROLL);
+		
+		gd=new GridData();
+		gd.horizontalAlignment = SWT.FILL;
+		gd.horizontalSpan = 1;
+		gd.widthHint = 530;
+		gd.grabExcessHorizontalSpace = true;
+		group.setLayoutData(gd);
+		
+		layout = new GridLayout();
+		layout.numColumns = 4;
+		group.setLayout(layout);
+
+		// Labels
+		Label label=new Label(group, SWT.NONE);
+		label.setText("Service Role");
+		
+		gd = new GridData();
+		gd.horizontalSpan = 2;
+		gd.widthHint = 150;
+		label.setLayoutData(gd);
+
+		label = new Label(group, SWT.NONE);
+		label.setText("Project Name");
+		
+		gd = new GridData();
+		gd.horizontalSpan = 2;
+		gd.widthHint = 300;
+		label.setLayoutData(gd);
+
+		if (m_conversationModel != null) {
+
+			for (int i=0; i < m_localModelRefs.size(); i++) {
+				
+				Button button=new Button(group, SWT.CHECK);
+				button.setText(m_localModelRefs.get(i).getLocatedRole());
+				button.setSelection(true);
+				
+				gd = new GridData();
+				gd.horizontalSpan = 2;
+				gd.widthHint = 150;
+				button.setLayoutData(gd);
+				
+				m_roleButtons.add(button);
+				
+				button.addSelectionListener(new SelectionListener() {
+					public void widgetDefaultSelected(SelectionEvent e) {
+						widgetSelected(e);
+					}
+
+					public void widgetSelected(SelectionEvent e) {
+						checkStatus();
+					}
+				});
+				
+				Text projectName=new Text(group, SWT.NONE);
+				
+				String prjName=m_localModelRefs.get(i).getLocatedRole();
+				
+				if (m_conversationModel.getModelName() != null) {
+					prjName = m_conversationModel.getModelName().getName()+"-"+prjName;
+				}
+				
+				projectName.setText(prjName);
+				
+				gd = new GridData();
+				gd.horizontalSpan = 2;
+				gd.widthHint = 300;
+				projectName.setLayoutData(gd);
+				
+				m_projectNames.add(projectName);
+
+				projectName.addModifyListener(new ModifyListener() {					
+					public void modifyText(ModifyEvent e) {
+						checkStatus();
+					}
+				});
+				
+			}
+		}
+
+		Button button=new Button(group, SWT.NONE);
+		button.setText("Check All");
+		
+		gd = new GridData();
+		gd.horizontalSpan = 1;
+		gd.widthHint = 100;
+		button.setLayoutData(gd);
+		
+		button.addSelectionListener(new SelectionListener() {
+
+			public void widgetDefaultSelected(SelectionEvent e) {
+				widgetSelected(e);	
+			}
+			
+			public void widgetSelected(SelectionEvent e) {
+				for (int i=0; i < m_roleButtons.size(); i++) {
+					m_roleButtons.get(i).setSelection(true);
+				}
+				checkStatus();
+			}			
+		});
+
+		button=new Button(group, SWT.NONE);
+		button.setText("Clear All");
+		
+		gd = new GridData();
+		gd.horizontalSpan = 1;
+		gd.widthHint = 100;
+		button.setLayoutData(gd);
+		
+		button.addSelectionListener(new SelectionListener() {
+
+			public void widgetDefaultSelected(SelectionEvent e) {
+				widgetSelected(e);	
+			}
+			
+			public void widgetSelected(SelectionEvent e) {
+				for (int i=0; i < m_roleButtons.size(); i++) {
+					m_roleButtons.get(i).setSelection(false);
+				}
+				checkStatus();
+			}			
+		});
+		
+		return(composite);
+	}
+
+	@Override
+	protected Control createButtonBar(Composite parent) {
+		Control ret=super.createButtonBar(parent);
+		
+		checkStatus();
+		
+		return(ret);
+	}
+	
+	protected void checkStatus() {
+		int selected=0;
+		boolean f_error=false;
+		
+		for (int i=0; i < m_roleButtons.size(); i++) {
+			if (m_roleButtons.get(i).getSelection()) {
+				selected++;
+				
+				m_projectNames.get(i).setEnabled(true);
+				
+				// Check project name
+				String projectName=m_projectNames.get(i).getText();
+				
+				if (isProjectNameValid(projectName) == false) {
+					f_error = true;
+					
+					m_projectNames.get(i).setBackground(
+							Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+				} else {
+					m_projectNames.get(i).setBackground(
+							Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+				}
+			} else {
+				m_projectNames.get(i).setEnabled(false);
+				m_projectNames.get(i).setBackground(
+						Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+			}
+		}
+		
+		if (f_error || selected == 0) {
+			getButton(IDialogConstants.OK_ID).setEnabled(false);
+		} else {
+			getButton(IDialogConstants.OK_ID).setEnabled(true);
+		}
+	}
+	
+	protected boolean isProjectNameValid(String name) {
+		boolean ret=true;
+		
+		if (name == null || name.trim().length() == 0) {
+			ret = false;
+		} else if (m_file.getWorkspace().getRoot().getProject(name).exists()) {
+			ret = false;
+		} else {
+			for (int i=0; ret && i < name.length(); i++) {
+				if (i == 0) {
+					ret = Character.isJavaIdentifierStart(name.charAt(i));
+				} else if ("-.".indexOf(name.charAt(i)) != -1) {
+					ret = true;
+				} else {
+					ret = Character.isJavaIdentifierPart(name.charAt(i));
+				}
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * The ok button has been pressed.
+	 */
+	public void okPressed() {
+		
+		try {
+			Generator generator=new Generator(m_file);
+			
+			for (int i=0; i < m_localModelRefs.size(); i++) {
+				
+				if (m_roleButtons.get(i).getSelection()) {
+					generator.generateRole(m_localModelRefs.get(i),
+							m_projectNames.get(i).getText(), m_file);
+				}
+			}
+			
+			super.okPressed();
+		} catch(Exception e) {
+			error("Failed to generate BPEL artefacts", e);
+		}
+	}
+	
+	/**
+	 * This method is used to report an error.
+	 * 
+	 * @param mesg The error message
+	 * @param ex The exception 
+	 */
+	public void error(String mesg, Exception ex) {
+		
+		org.savara.tools.bpel.osgi.Activator.logError(mesg, ex);
+		
+		MessageBox mbox=new MessageBox(getShell(),
+				SWT.ICON_ERROR|SWT.OK);
+		mbox.setMessage(mesg);
+		mbox.open();
+		
+		logger.error(mesg, ex);
+	}
+
+	private static Log logger = LogFactory.getLog(GenerateDialog.class);
+
+	private IFile m_file=null;
+	private ConversationModel m_conversationModel=null;
+	private java.util.List<ModelReference> m_localModelRefs=null;
+	private java.util.List<Button> m_roleButtons=new java.util.Vector<Button>();
+	private java.util.List<Text> m_projectNames=new java.util.Vector<Text>();
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/editor/BPELEditorManager.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/editor/BPELEditorManager.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+/*
+ * 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.tools.bpel.editor;
+
+//import org.eclipse.emf.ecore.EValidator;
+import org.savara.bpel.model.BPELNotation;
+import org.savara.bpel.model.component.BPELElement;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.ModelReference;
+import org.scribble.model.SourceRef;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.editor.*;
+
+/**
+ * This is the BPEL editor implementation of the EditorManager
+ * interface.
+ */
+ at RegistryInfo(extension=EditorManager.class,notation=BPELNotation.NOTATION_CODE)
+public class BPELEditorManager extends AbstractEditorManager {
+
+	/**
+	 * This method focuses the editor on the specified source,
+	 * identified by the model reference and source reference.
+	 * 
+	 * @param mref The model reference
+	 * @param sref The component source reference
+	 * @param prop Additional properties
+	 */
+	public void focus(ModelReference mref, SourceRef sref,
+					java.util.Map<String,Object> props) {
+		String uri=null;
+		org.eclipse.core.resources.IFile file=
+			org.scribble.eclipse.model.admin.OSGIModelRepository.getFile(mref);
+	
+		if (file == null || file.exists() == false) {
+			file = org.scribble.eclipse.model.admin.OSGIModelRepository.getGlobalFile(mref);
+		}
+	
+		if (file != null && file.exists()) {
+			uri = file.getFullPath().toPortableString();
+		}
+		
+		if (uri != null) {
+			org.eclipse.ui.IWorkbenchPage page=
+						org.eclipse.ui.PlatformUI.getWorkbench().
+							getActiveWorkbenchWindow().getActivePage();
+			
+			org.eclipse.core.resources.IResource res=
+				org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().findMember(uri);
+			
+			if (res instanceof org.eclipse.core.resources.IFile) {
+				org.eclipse.ui.part.FileEditorInput input=
+						new org.eclipse.ui.part.FileEditorInput(
+								(org.eclipse.core.resources.IFile)res);
+			
+				try {
+//					org.eclipse.ui.IEditorPart part=page.openEditor(input,
+//								"org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditorID");
+					
+//					if (part instanceof org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor) {
+//						org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor editor=
+//							(org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor)part;
+
+						System.out.println("FOCUS ON: "+sref.getComponentURI());
+						//editor.showComponent(sref.getComponentURI());
+//					}
+					
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+	
+	/**
+	 * This method enriches the set of properties required
+	 * by the editor, using the properties associated with
+	 * the model issue.
+	 * 
+	 * @param issue The model issue
+	 */
+	@Override
+	public void enrich(ModelIssue issue) {
+		
+		if (issue != null && issue.getModelObject() != null) {
+			String uri=issue.getModelObject().getSource().getComponentURI();
+		
+			issue.getProperties().put("address.model", uri);
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,865 @@
+/*
+ * 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.tools.bpel.generator;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.savara.bpel.model.*;
+import org.savara.bpel.model.component.PartnerLink;
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.contract.model.Namespace;
+import org.savara.util.XMLUtils;
+import org.savara.wsdl.generator.WSDLGeneratorFactory;
+import org.savara.wsdl.generator.soap.SOAPDocLitWSDLBinding;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.protocol.model.*;
+import org.scribble.model.admin.DefaultModelListener;
+import org.scribble.model.admin.ModelRepository;
+import org.scribble.model.change.ModelGenerator;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jst.common.project.facet.WtpUtils;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+/**
+ * This class provides the mechanism for generating JBossESB
+ * service artefacts.
+ */
+public class Generator {
+
+	private static final String SCHEMA_LOCATION_ATTR = "schemaLocation";
+
+	private static final String INCLUDE_ELEMENT = "include";
+
+	private static final String XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
+
+	private static final String WSDL_IMPORT = "wsdl:import";
+
+	private static final String BPEL_DEPLOY_DESCRIPTOR_FILENAME = "bpel-deploy.xml";
+
+	private static final String XMLNS_PREFIX = "xmlns:";
+
+	private static final String SERVICE_LABEL = "service";
+
+	private static final String PROVIDE_LABEL = "provide";
+
+	private static final String PARTNER_LINK_LABEL = "partnerLink";
+
+	private static final String INVOKE_LABEL = "invoke";
+
+	private static final String ACTIVE_LABEL = "active";
+
+	private static final String PROCESS_LABEL = "process";
+
+	private static final String DEPLOY_LABEL = "deploy";
+
+	private static final String APACHE_ODE_NAMESPACE = "http://www.apache.org/ode/schemas/dd/2007/03";
+
+	private static final String PORT_TYPE_LABEL = "portType";
+
+	private static final String TARGET_NAMESPACE_LABEL = "targetNamespace";
+
+	private static final String PLNK_ROLE = "plnk:role";
+
+	private static final String NAME_LABEL = "name";
+
+	private static final String PLNK_PARTNER_LINK_TYPE = "plnk:partnerLinkType";
+
+	private static final String WSDL_DEFINITIONS = "wsdl:definitions";
+
+	private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
+
+	private static final String PLNKTYPE_NS = "http://docs.oasis-open.org/wsbpel/2.0/plnktype";
+
+	private static final String XMLNS_WSDL = "xmlns:wsdl";
+
+	private static final String XMLNS_PLNK = "xmlns:plnk";
+	
+	private static final String BPEL_PATH = "bpelContent";
+
+	/**
+	 * This is the constructor for the generator.
+	 * 
+	 */
+	public Generator(IFile file) {
+		m_file = file;
+		
+		initialize(m_file);
+	}
+	
+	/**
+	 * This method initializes the conversation model associated
+	 * with the supplied file resource.
+	 * 
+	 * @param res The file
+	 */
+	protected void initialize(IFile res) {
+		
+		// Initialize the model
+		ModelReference ref=
+			org.scribble.eclipse.model.admin.OSGIModelRepository.createReference(res);
+		
+		if (ref != null) {
+			ModelRepository mrep=(ModelRepository)
+					RegistryFactory.getRegistry().getExtension(
+						ModelRepository.class, null);
+
+			if (mrep != null) {
+				Model model=mrep.getModel(ref,
+						new DefaultModelListener());
+		
+				if (model instanceof ConversationModel) {
+					m_conversationModel = (ConversationModel)model;
+						
+					m_localModelRefs = m_conversationModel.getLocalModels(ref);
+				}
+			}
+		}
+		
+		if (m_conversationModel == null) {
+			logger.error("Unable to load model used to generate " +
+					"the ESB artefacts");
+		}
+	}
+	
+	/**
+	 * This method returns the local model references that
+	 * can be generated.
+	 * 
+	 * @return The local model references
+	 */
+	public java.util.List<ModelReference> getLocalModels() {
+		return(m_localModelRefs);
+	}
+	
+	/**
+	 * This method generates the project associated with the
+	 * supplied role (and optional sub-definition path) contained
+	 * in the local model reference.
+	 * 
+	 * @param localModelRef The local model reference
+	 * @param projectName The project name
+	 * @param cdmResource The original choreography file
+	 * @throws Exception Failed to generate role
+	 */
+	public void generateRole(ModelReference localModelRef, String projectName, IFile cdmResource)
+						throws Exception {
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Generate local model '"+localModelRef+"' for: "+
+						m_conversationModel);
+		}
+		
+		// Project to role
+		org.scribble.projector.Projector projector=
+			(org.scribble.projector.Projector)
+			RegistryFactory.getRegistry().getExtension(
+					org.scribble.projector.Projector.class, null);
+
+		if (projector != null) {
+			Role role=new Role(localModelRef.getLocatedRole());
+			
+			// Transfer contract details (if defined) from local model
+			// reference to role
+			if (localModelRef.getAnnotations().containsKey(org.savara.contract.model.Contract.class.getName())) {
+				role.getAnnotations().put(org.savara.contract.model.Contract.class.getName(),
+								localModelRef.getAnnotations().get(org.savara.contract.model.Contract.class.getName()));
+			}
+			
+			ModelReference srcRef=
+				new ModelReference(ConversationNotation.NOTATION_CODE);
+			
+			Model localModel=projector.project(srcRef, m_conversationModel,
+					localModelRef.getSubDefinitionPath(), role,
+					new DefaultModelListener());
+			
+			if (localModel instanceof ConversationModel &&
+					((ConversationModel)localModel).getConversation() != null) {
+				ConversationModel lcm=(ConversationModel)localModel;
+				
+				ModelReference targetRef=
+					new ModelReference(BPELNotation.NOTATION_CODE);
+				
+				DefaultBPELLanguageModel target=
+					new DefaultBPELLanguageModel(targetRef);
+				
+				ModelGenerator generator=(ModelGenerator)
+					RegistryFactory.getRegistry().getExtension(
+							ModelGenerator.class, null);
+				
+				if (generator != null) {
+					generator.generate(targetRef, role, target,
+								lcm);
+					
+					generateRoleProject(projectName, role,
+								target.getBPELProcess(), lcm, target, cdmResource);
+				} else {
+					logger.error("Unable to find model generator");
+				}
+			}
+		}
+	}
+	
+	protected void generateRoleProject(String projectName, Role role,
+			org.savara.bpel.model.component.Process bpelProcess, ConversationModel localcm,
+			BPELLanguageModel model, IFile cdmResource) throws Exception {
+		
+		final IProject proj=createProject(projectName);
+		
+		if (proj != null && bpelProcess != null) {
+
+			// Store BPEL configuration
+			IPath bpelPath=proj.getFullPath().append(
+					new Path(BPEL_PATH)).
+						append(localcm.getModelName().getName()+"_"+
+							localcm.getModelName().getRole().getName()+".bpel");
+			
+			IFile bpelFile=proj.getProject().getWorkspace().getRoot().getFile(bpelPath);
+			createFolder(bpelFile);
+			
+			bpelFile.create(null, true,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+			
+			String bpelText=XMLUtils.toText(bpelProcess.getDOMElement());
+			
+			if (bpelText != null) {
+				bpelFile.setContents(new java.io.ByteArrayInputStream(
+						bpelText.getBytes()), true, false,
+						new org.eclipse.core.runtime.NullProgressMonitor());
+			}
+			
+			// Write the WSDL files
+			generateWSDL(role, proj, localcm, cdmResource);		
+			
+			java.util.List<Role> roles=localcm.getConversation().getRoles();
+			
+			for (int i=0; i < roles.size(); i++) {
+				generateWSDL(roles.get(i), proj, localcm, cdmResource);
+			}
+			
+			// Generate WSDL with partner link types
+			generatePartnerLinkTypes(role, proj, localcm, bpelProcess);
+			
+			// Generate BPEL deployment descriptor
+			generateBPELDeploy(role, proj, localcm, bpelProcess);
+		}
+	}
+	
+	protected void generateWSDL(Role role, IProject proj, ConversationModel localcm,
+						IFile cdmResource) throws Exception {		
+		
+		if (role.getAnnotations().containsKey(Contract.class.getName())) {
+			javax.wsdl.xml.WSDLWriter writer=
+				javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
+			org.savara.wsdl.generator.WSDLGenerator generator=
+						WSDLGeneratorFactory.getWSDLGenerator();
+			Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
+
+			// Generate BPEL folder
+			IPath bpelFolderPath=proj.getFullPath().append(
+					new Path(BPEL_PATH));
+
+			IFolder wsdlFolder=proj.getProject().getWorkspace().getRoot().getFolder(bpelFolderPath);
+			
+			createFolder(wsdlFolder);
+			
+			// Generate definition
+			java.util.List<javax.wsdl.Definition> defns=generator.generate(contract,
+									new SOAPDocLitWSDLBinding());
+			
+			// Check if contract has atleast one message exchange pattern
+			boolean f_hasMEP=false;
+			
+			java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
+
+			while (f_hasMEP == false && iter.hasNext()) {
+				Interface intf=iter.next();
+				f_hasMEP = (intf.getMessageExchangePatterns().size() > 0);
+			}
+			
+			for (int i=defns.size()-1; i >= 0; i--) {
+				javax.wsdl.Definition defn=defns.get(i);
+
+				// Check if definition has a port type
+				if (defn.getPortTypes().size() > 0 || defn.getMessages().size() > 0
+							|| (f_hasMEP && defn.getServices().size() > 0)) {
+					String num="";
+					if (i > 0) {
+						num += i;
+					}
+
+					String filename=getWSDLFileName(role, localcm.getModelName().getName(), num);
+					byte[] b=null;
+					
+					if (i > 0) {
+						javax.wsdl.Import imp=defns.get(0).createImport();
+						
+						imp.setDefinition(defn);
+						imp.setNamespaceURI(defn.getTargetNamespace());
+						imp.setLocationURI(filename);
+						
+						defns.get(0).addImport(imp);					
+
+						java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+						
+						writer.writeWSDL(defn, baos);
+						
+						b = baos.toByteArray();
+						
+						baos.close();
+						
+					} else {
+						org.w3c.dom.Document doc=writer.getDocument(defn);
+						
+						importSchemas(cdmResource, contract, bpelFolderPath,
+									doc);
+
+						// Create bytearray from DOM
+						java.io.ByteArrayOutputStream xmlstr=
+							new java.io.ByteArrayOutputStream();
+						
+						DOMSource source=new DOMSource();
+						source.setNode(doc);
+						
+						StreamResult result=new StreamResult(xmlstr);
+						
+						Transformer trans=
+								TransformerFactory.newInstance().newTransformer();
+						trans.transform(source, result);
+						
+						xmlstr.close();
+						
+						b = XMLUtils.format(new String(xmlstr.toByteArray())).getBytes();
+					}
+					
+					IPath wsdlPath=bpelFolderPath.append(filename);
+					
+					IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+					
+					createFolder(wsdlFile);
+					
+					if (wsdlFile.exists() == false) {
+						wsdlFile.create(null, true,
+								new org.eclipse.core.runtime.NullProgressMonitor());
+					}
+					
+					wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
+								new org.eclipse.core.runtime.NullProgressMonitor());
+				}
+			}
+		}
+	}
+	
+	protected void importSchemas(IFile cdmResource, Contract contract,
+					IPath bpelFolderPath, org.w3c.dom.Document doc) throws Exception {
+		
+		// NOTE: Unfortunate workaround due to issue with WSDLWriter not
+		// generating output for extensible elements created to represent
+		// the xsd:schema/xsd:import elements. So instead had to obtain
+		// the DOM document and insert the relevant elements.
+		
+		if (contract.getNamespaces().size() > 0) {
+			org.w3c.dom.Element defnElem=doc.getDocumentElement();
+			
+			// Added types node
+			org.w3c.dom.Element types=doc.createElementNS("http://schemas.xmlsoap.org/wsdl/",
+										"types");
+			
+			org.w3c.dom.Element schema=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
+										"schema");
+			
+			types.appendChild(schema);		
+			
+			// Generate imports for specified message schema
+			for (Namespace ns : contract.getNamespaces()) {
+				
+				if (ns.getSchemaLocation() != null &&
+							ns.getSchemaLocation().trim().length() > 0) {
+
+					java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
+					
+					while (st.hasMoreTokens()) {
+						String location=st.nextToken();
+						IFile file=cdmResource.getParent().getFile(new Path(location));
+					
+						org.w3c.dom.Element imp=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
+										"import");
+						
+						imp.setAttribute("namespace", ns.getURI());
+						
+						if (file.exists()) {
+							imp.setAttribute("schemaLocation", file.getProjectRelativePath().toPortableString());
+
+							// Copy schema file into generated BPEL project
+							IPath artifactPath=bpelFolderPath.append(file.getProjectRelativePath());
+							
+							IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+							copySchema(file, artifactFile, bpelFolderPath);
+						} else {
+							imp.setAttribute("schemaLocation", location);
+						}
+						
+						schema.appendChild(imp);					
+					}
+				}
+			}
+
+			defnElem.insertBefore(types, defnElem.getFirstChild());
+		}
+	}
+
+	protected void copySchema(IFile srcXSDFile, IFile targetXSDFile, IPath bpelFolderPath) throws Exception {
+
+		if (targetXSDFile.exists() == false) {
+			createFolder(targetXSDFile.getParent());
+
+			targetXSDFile.create(null, true,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+		}
+		
+		targetXSDFile.setContents(srcXSDFile.getContents(), true, false,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		// Check XSD for further 'include' statements
+		DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+		fact.setNamespaceAware(true);
+
+		DocumentBuilder builder=fact.newDocumentBuilder();
+		org.w3c.dom.Document doc=builder.parse(srcXSDFile.getContents());
+
+		org.w3c.dom.NodeList nl=doc.getElementsByTagNameNS(XML_SCHEMA, INCLUDE_ELEMENT);
+		
+		for (int i=0; i < nl.getLength(); i++) {
+			org.w3c.dom.Node includeNode=nl.item(i);
+			
+			if (includeNode instanceof org.w3c.dom.Element) {
+				String schemaLocation=((org.w3c.dom.Element)includeNode).getAttribute(SCHEMA_LOCATION_ATTR);
+				
+				// Check if a relative path
+				IFile file=srcXSDFile.getParent().getFile(new Path(schemaLocation));
+				
+				if (file.exists()) {
+					
+					IPath artifactPath=bpelFolderPath.append(file.getProjectRelativePath());
+					
+					IFile artifactFile=file.getProject().getWorkspace().getRoot().getFile(artifactPath);
+
+					copySchema(file, artifactFile, bpelFolderPath);
+				}
+			}
+		}
+	}
+	
+	protected void generatePartnerLinkTypes(Role role, IProject proj, ConversationModel localcm,
+			org.savara.bpel.model.component.Process bpelProcess) throws Exception {	
+		
+		org.w3c.dom.Document doc=javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();;
+		
+		org.w3c.dom.Element defn=doc.createElement(WSDL_DEFINITIONS);
+		doc.appendChild(defn);
+		
+		defn.setAttribute(XMLNS_PLNK, PLNKTYPE_NS);
+		defn.setAttribute(XMLNS_WSDL, WSDL_NS);
+		
+		defn.setAttribute(TARGET_NAMESPACE_LABEL, bpelProcess.getTargetNamespace());
+		
+		// Add import to associated wsdl
+		String wsdlName=getWSDLFileName(role, localcm.getModelName().getName(), "");
+
+		org.w3c.dom.Element imp=doc.createElement(WSDL_IMPORT);
+		
+		imp.setAttribute("namespace", bpelProcess.getTargetNamespace());
+		imp.setAttribute("location", wsdlName);
+		
+		defn.appendChild(imp);					
+
+		// Add imports for associated roles
+		java.util.ListIterator<Role> roles=localcm.getConversation().getRoles().listIterator();
+		
+		while (roles.hasNext()) {
+			Role r=roles.next();
+			
+			if (r != null && r.getAnnotations().containsKey(Contract.class.getName())) {
+				Contract contract=(Contract)r.getAnnotations().get(Contract.class.getName());
+				
+				boolean gen=false;
+				
+				java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
+				
+				while (gen == false && iter.hasNext()) {
+					Interface intf=iter.next();
+					
+					if (intf.getMessageExchangePatterns().size() > 0) {
+						gen = true;
+					}
+				}
+				
+				if (gen) {
+					wsdlName = getWSDLFileName(r, localcm.getModelName().getName(), "");
+		
+					imp = doc.createElement(WSDL_IMPORT);
+					
+					imp.setAttribute("namespace", contract.getNamespace());
+					imp.setAttribute("location", wsdlName);
+					
+					defn.appendChild(imp);
+				}
+			}
+		}
+
+		// Create partner link types
+		java.util.Map<String, String> nsMap=new java.util.HashMap<String, String>();
+		
+		for (PartnerLink pl : bpelProcess.getPartnerLinks()) {
+			org.w3c.dom.Element plt=doc.createElement(PLNK_PARTNER_LINK_TYPE);
+			
+			plt.setAttribute(NAME_LABEL, XMLUtils.getLocalname(pl.getPartnerLinkType()));
+			
+			if (pl.getPartnerRole() != null && pl.getPartnerRole().trim().length() > 0) {
+				org.w3c.dom.Element plRole=doc.createElement(PLNK_ROLE);
+				
+				plt.appendChild(plRole);
+				
+				plRole.setAttribute(NAME_LABEL, pl.getPartnerRole());
+				
+				Role useRole=null;
+				
+				for (int i=0; useRole == null &&
+							i < localcm.getConversation().getRoles().size(); i++) {
+					if (pl.getPartnerRole().startsWith(localcm.getConversation().getRoles().get(i).getName())) {
+						useRole = localcm.getConversation().getRoles().get(i);
+					}
+				}
+				
+				if (useRole != null && 
+							useRole.getAnnotations().containsKey(Contract.class.getName())) {
+					Contract contract=(Contract)useRole.getAnnotations().get(Contract.class.getName());
+					Interface intf=null;
+					
+					if (pl.getMyRole() != null) {
+						intf = contract.getInterface(pl.getMyRole());
+					}
+						
+					if (intf == null && contract.getInterfaces().size() > 0) {
+						intf = contract.getInterfaces().iterator().next();
+					}
+					
+					if (intf != null) {
+						String prefix=null;
+						String portType=intf.getName();
+						
+						if (intf.getNamespace() != null) {
+							prefix = XMLUtils.getPrefix(intf.getNamespace(), nsMap);
+							
+							portType = prefix+":"+portType;
+						}
+						
+						plRole.setAttribute(PORT_TYPE_LABEL, portType);
+					}
+				}
+			}
+			
+			if (pl.getMyRole() != null && pl.getMyRole().trim().length() > 0) {
+				org.w3c.dom.Element plRole=doc.createElement(PLNK_ROLE);
+				
+				plt.appendChild(plRole);
+				
+				plRole.setAttribute(NAME_LABEL, pl.getMyRole());
+				
+				if (role.getAnnotations().containsKey(Contract.class.getName())) {
+					Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
+					Interface intf=null;
+					
+					if (pl.getMyRole() != null) {
+						intf = contract.getInterface(pl.getMyRole());
+					}
+						
+					if (intf == null && contract.getInterfaces().size() > 0) {
+						intf = contract.getInterfaces().iterator().next();
+					}
+					
+					if (intf != null) {
+						String prefix=null;
+						String portType=intf.getName();
+						
+						if (intf.getNamespace() != null) {
+							prefix = XMLUtils.getPrefix(intf.getNamespace(), nsMap);
+							
+							portType = prefix+":"+portType;
+						}
+						
+						plRole.setAttribute(PORT_TYPE_LABEL, portType);
+					}
+				}
+			}
+			
+			defn.appendChild(plt);
+		}
+		
+		// Create remaining namespace/prefix mappings
+		java.util.Iterator<String> iter=nsMap.keySet().iterator();
+		while (iter.hasNext()) {
+			String ns=iter.next();
+			String prefix=nsMap.get(ns);
+			
+			defn.setAttribute(XMLNS_PREFIX+prefix, ns);
+		}
+		
+		// Write partner link types to file
+		String filename=getWSDLFileName(role, localcm.getModelName().getName(), "Artifacts");
+		
+		IPath wsdlPath=proj.getFullPath().append(
+				new Path(BPEL_PATH)).
+					append(filename);
+		
+		IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+		
+		createFolder(wsdlFile);
+		
+		wsdlFile.create(null, true,
+				new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		java.io.ByteArrayOutputStream xmlstr=
+			new java.io.ByteArrayOutputStream();
+		
+		DOMSource source=new DOMSource();
+		source.setNode(doc);
+		
+		StreamResult result=new StreamResult(xmlstr);
+		
+		Transformer trans=
+				TransformerFactory.newInstance().newTransformer();
+		trans.transform(source, result);
+		
+		xmlstr.close();
+		
+		String xml=XMLUtils.format(new String(xmlstr.toByteArray()));
+		
+		wsdlFile.setContents(new java.io.ByteArrayInputStream(xml.getBytes()), true, false,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+	}
+	
+	
+	protected void generateBPELDeploy(Role role, IProject proj, ConversationModel localcm,
+			org.savara.bpel.model.component.Process bpelProcess) throws Exception {	
+		
+		org.w3c.dom.Document doc=javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();;
+		
+		org.w3c.dom.Element defn=doc.createElementNS(APACHE_ODE_NAMESPACE,
+													DEPLOY_LABEL);
+		doc.appendChild(defn);
+		
+		java.util.Map<String, String> nsMap=new java.util.HashMap<String, String>();
+		
+		// Create process element
+		org.w3c.dom.Element proc=doc.createElement(PROCESS_LABEL);
+		defn.appendChild(proc);
+		
+		String name=bpelProcess.getName();
+		
+		if (bpelProcess.getTargetNamespace() != null) {
+			String prefix=XMLUtils.getPrefix(bpelProcess.getTargetNamespace(), nsMap);
+			
+			name = prefix+":"+name;
+		}
+		
+		proc.setAttribute(NAME_LABEL, name);
+		
+		org.w3c.dom.Element active=doc.createElement(ACTIVE_LABEL);
+		proc.appendChild(active);
+		
+		org.w3c.dom.Text activeText=doc.createTextNode(Boolean.TRUE.toString());
+		active.appendChild(activeText);
+		
+		// TODO: Need more info - possibly Contract should have interfaces based on
+		// the relationship between two roles, as this may provide the necessary
+		// information - but this requires the ability to have multiple interfaces
+		// per role, which some other parts of the BPEL generation would currently
+		// not handle.
+		
+		// Work through partner links for now
+		for (PartnerLink pl : bpelProcess.getPartnerLinks()) {
+			if (pl.getPartnerRole() != null && pl.getPartnerRole().trim().length() > 0) {
+				org.w3c.dom.Element invoke=doc.createElement(INVOKE_LABEL);
+				
+				invoke.setAttribute(PARTNER_LINK_LABEL, XMLUtils.getLocalname(pl.getName()));
+				
+				org.w3c.dom.Element service=doc.createElement(SERVICE_LABEL);
+				
+				invoke.appendChild(service);
+				
+				proc.appendChild(invoke);
+			}
+			
+			if (pl.getMyRole() != null && pl.getMyRole().trim().length() > 0) {
+				org.w3c.dom.Element provide=doc.createElement(PROVIDE_LABEL);
+				
+				provide.setAttribute(PARTNER_LINK_LABEL, XMLUtils.getLocalname(pl.getName()));
+				
+				org.w3c.dom.Element service=doc.createElement(SERVICE_LABEL);
+				
+				provide.appendChild(service);
+				
+				proc.appendChild(provide);
+			}
+		}
+		
+		// Create remaining namespace/prefix mappings
+		java.util.Iterator<String> iter=nsMap.keySet().iterator();
+		while (iter.hasNext()) {
+			String ns=iter.next();
+			String prefix=nsMap.get(ns);
+			
+			defn.setAttribute(XMLNS_PREFIX+prefix, ns);
+		}
+		
+		// Write partner link types to file
+		IPath wsdlPath=proj.getFullPath().append(
+				new Path(BPEL_PATH)).
+					append(BPEL_DEPLOY_DESCRIPTOR_FILENAME);
+		
+		IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+		
+		createFolder(wsdlFile);
+		
+		wsdlFile.create(null, true,
+				new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		java.io.ByteArrayOutputStream xmlstr=
+			new java.io.ByteArrayOutputStream();
+		
+		DOMSource source=new DOMSource();
+		source.setNode(doc);
+		
+		StreamResult result=new StreamResult(xmlstr);
+		
+		Transformer trans=
+				TransformerFactory.newInstance().newTransformer();
+		trans.transform(source, result);
+		
+		xmlstr.close();
+		
+		String xml=XMLUtils.format(new String(xmlstr.toByteArray()));
+		
+		wsdlFile.setContents(new java.io.ByteArrayInputStream(xml.getBytes()), true, false,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+	}
+	
+	/**
+	 * This method returns the WSDL file name for the supplied role and local
+	 * conversation model.
+	 * 
+	 * @param role The role
+	 * @param localcm The local conversation model
+	 * @param fileNum The file name (zero being the main wsdl file)
+	 * @return The file name
+	 */
+	public static String getWSDLFileName(Role role, String modelName, String suffix) {
+		return(modelName+"_"+role.getName()+suffix+".wsdl");
+	}
+			
+	protected IProject createProject(String projectName)
+							throws Exception {
+		
+		// Create project
+		IProject project=m_file.getWorkspace().getRoot().getProject(projectName);
+		project.create(new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		// Open the project
+		project.open(new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		// Add wtp natures
+		WtpUtils.addNatures(project);
+		
+		// Add required project facets	
+		IProjectFacet bpelFacet =
+					ProjectFacetsManager.getProjectFacet("jbt.bpel.facet.core");
+		IProjectFacetVersion ipfv = bpelFacet.getVersion("2.0");
+		IFacetedProject ifp = ProjectFacetsManager.create(project, true, null);
+		ifp.installProjectFacet(ipfv, null,
+					new org.eclipse.core.runtime.NullProgressMonitor());
+
+		// Update the project description
+		IProjectDescription description = project.getDescription();
+		
+		// Setup project reference to CDM project
+		IProject[] projects=new IProject[1];
+		projects[0] = m_file.getProject();
+		description.setReferencedProjects(projects);
+		
+		// Set the description
+		project.setDescription(description,
+				new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		return(project);
+	}
+	
+	/**
+	 * This method checks whether the folder exists,
+	 * and if not attempts to create it.
+	 * 
+	 * @param res The current resource
+	 */
+	public static void createFolder(IResource res) {
+		if (res instanceof IFolder) {
+			IFolder folder=(IFolder)res;
+			
+			if (folder.exists() == false) {
+				createFolder(folder.getParent());
+
+				try {
+					folder.create(true, true,
+							new org.eclipse.core.runtime.NullProgressMonitor());
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+			}
+		} else if (res.getParent() != null) {
+			createFolder(res.getParent());
+		}
+	}
+
+	/*
+	public BuildSystem getBuildSystem() {
+		return(m_buildSystem);
+	}
+	*/
+
+	private static Log logger = LogFactory.getLog(Generator.class);
+
+	private IFile m_file=null;
+	private java.util.List<ModelReference> m_localModelRefs=null;
+	private ConversationModel m_conversationModel=null;
+	//private BuildSystem m_buildSystem=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorException.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorException.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorException.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,35 @@
+/*
+ * 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.tools.bpel.generator;
+
+public class GeneratorException extends Exception {
+
+	private static final long serialVersionUID = -2263049447116467663L;
+	
+	/**
+	 * This constructor initializes the generator exception
+	 * with a message and the underlying exception that
+	 * caused the problem.
+	 * 
+	 * @param mesg The message
+	 * @param t The cause
+	 */
+	public GeneratorException(String mesg, Throwable t) {
+		super(mesg, t);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorUtil.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/GeneratorUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,53 @@
+/*
+ * 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.tools.bpel.generator;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * This class provides general utility functions for
+ * use when generating artefacts.
+ */
+public class GeneratorUtil {
+
+	/**
+	 * This method checks whether the parent folder exists,
+	 * and if not attempts to create it.
+	 * 
+	 * @param res The current resource
+	 */
+	public static void createParentFolder(IResource res) {
+		
+		if (res.getParent() instanceof IFolder) {
+			IFolder parent=(IFolder)res.getParent();
+			
+			if (parent.exists() == false) {
+				createParentFolder(parent);
+
+				try {
+					parent.create(true, true,
+							new org.eclipse.core.runtime.NullProgressMonitor());
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Ant.template
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Ant.template	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Ant.template	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,44 @@
+<project name="%PROJECT%" basedir="." default="deploy" >
+   <property name="build.dir" value="${basedir}/target" />
+   <property name="classes" value="${build.dir}/classes" />
+   <property name="lib" value="src/lib" />
+   <property name="src" value="src/java" />
+   <property name="conf" value="src/conf" />
+	
+   <path id="compile-classpath">
+      <fileset dir="${lib}" includes="*.jar" />
+   </path>
+   
+   <target name="init" depends="clean">
+      <mkdir dir="${build.dir}" />
+   </target>
+   
+   <target name="clean">
+      <delete dir="${build.dir}" />
+   </target>
+
+   <target name="compile" depends="init">
+        <mkdir dir="${classes}" />
+	<javac srcdir="${src}" destdir="${classes}" debug="true" deprecation="true">
+	   <classpath refid="compile-classpath" />			
+	</javac>
+        <copy todir="${classes}">
+           <fileset dir="${conf}" includes="**/*.xml"/>
+        </copy>
+   </target>
+   
+   <target name="esbjar" depends="compile">
+        <jar destfile="${build.dir}/${ant.project.name}.esb">
+                   <fileset dir="${classes}" />
+                   <fileset dir="${build.dir}" includes="*.jar,*.war"/>
+                   <fileset dir="${classes}" includes="deployment.xml"/>
+                   <fileset dir="${classes}" includes="META-INF/**" />
+                   <fileset dir="${lib}" includes="*.jar"/>
+        </jar>
+    </target>
+
+    <target name="deploy" depends="esbjar">
+    	<copy todir="${org.jboss.esb.server.deploy.dir}"
+            file="${build.dir}/${ant.project.name}.esb"/>	
+    </target>
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Maven.template
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Maven.template	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/template/Maven.template	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.jboss.soa.overlord.cdl.project</groupId>
+	<artifactId>%PROJECT%</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<packaging>jboss-esb</packaging>
+	<name>%PROJECT%</name>
+	<url>http://www.jboss.org/overlord</url>
+
+
+	<dependencies>	
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.14</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.soa.overlord.cdl</groupId>
+			<artifactId>runtime-jbossesb</artifactId>
+			<version>1.0-SNAPSHOT</version>
+			<scope>provided</scope>
+		</dependency>
+
+	</dependencies>
+		
+	  <build>
+	    <finalName>%PROJECT%</finalName>
+	    <plugins>
+	      <plugin>
+		 <groupId>org.codehaus.mojo</groupId>
+		 <artifactId>jboss-packaging-maven-plugin</artifactId>
+		 <version>2.0-20080130.110241-9</version>
+		 <extensions>true</extensions>
+	      </plugin>
+	    </plugins>
+	   </build>
+
+    <pluginRepositories>
+	 <pluginRepository>
+	   <releases>
+	      <enabled>false</enabled>
+	   </releases>
+	   <snapshots/>
+	   <id>jboss-plugin-snapshots</id>
+	   <name>JBoss Snapshot Plugin Repository</name>
+	   <url>http://snapshots.repository.codehaus.org</url>
+	 </pluginRepository>
+    </pluginRepositories>
+		
+	
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,73 @@
+package org.savara.tools.bpel.osgi;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tools.bpel";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * This method logs an error against the plugin.
+	 * 
+	 * @param mesg The error message
+	 * @param t The optional exception
+	 */
+	public static void logError(String mesg, Throwable t) {
+		
+		if (getDefault() != null) {
+			Status status=new Status(IStatus.ERROR,
+					PLUGIN_ID, 0, mesg, t);
+			
+			getDefault().getLog().log(status);
+		}
+		
+		logger.error("LOG ERROR: "+mesg+
+				(t == null ? "" : ": "+t), t);
+	}
+	
+	private static Log logger = LogFactory.getLog(Activator.class);
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.bpmn</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Tools BPMN Plug-in
+Bundle-SymbolicName: org.savara.tools.bpmn;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.bpmn.eclipse.Activator
+Bundle-Vendor: www.savara.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.pi4soa.service,
+ org.pi4soa.cdl,
+ org.eclipse.stp.bpmn,
+ org.eclipse.gmf.runtime.notation,
+ org.eclipse.core.resources,
+ org.pi4soa.common
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,5 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.exportWizards">
+     <wizard
+           class="org.savara.tools.bpmn.eclipse.ExportBPMNWizard"
+           name="BPMN"
+           id="org.savara.tools.bpmn.exportbpmnwizard"/>
+   </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.bpmn</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsBPMN</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,50 @@
+package org.savara.tools.bpmn.eclipse;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tools.bpmn";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/ExportBPMNWizard.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/ExportBPMNWizard.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/ExportBPMNWizard.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Feb 1, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.eclipse;
+
+import java.io.File;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.CDLDefinitions;
+import org.pi4soa.cdl.ParticipantType;
+import org.pi4soa.common.resource.FileSystemArtifactManager;
+import org.pi4soa.common.resource.eclipse.ResourceUtil;
+import org.pi4soa.service.ServiceDefinitions;
+import org.pi4soa.service.behavior.ServiceDescription;
+import org.pi4soa.service.behavior.projection.BehaviorProjection;
+import org.savara.tools.bpmn.generation.BPMNGenerator;
+import org.savara.tools.bpmn.generation.DefaultBPMNConfiguration;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.core.resources.*;
+
+
+/**
+ * This class implements the Eclipse ExportWizrd for exporting
+ * a CDL object model to a BPMN representation.
+ */
+public class ExportBPMNWizard extends Wizard implements IExportWizard {
+
+	/**
+     * This method is invoked when the 'finish' button is
+     * pressed on the export wizard.
+     */
+	public boolean performFinish() {
+		boolean ret=true;
+		
+		// Export CDL's service endpoint projections to folder
+		if (m_cdlFile != null) {
+			
+			// Load the CDL object model
+			try {
+				org.pi4soa.cdl.Package cdlpack=
+					org.pi4soa.cdl.eclipse.Activator.getPackage(m_cdlFile);
+			
+				BPMNGenerator generator=new BPMNGenerator();
+				
+				generator.generate(cdlpack, null,
+						m_selectionPage.getFolderName(),
+						new DefaultBPMNConfiguration());
+
+			} catch(Exception e) {
+			    
+			    // Record error message on wizard page
+				m_selectionPage.setErrorMessage("Failed to export Choreography to BPMN: "+e);
+				
+				logger.log(Level.SEVERE,
+						"Failed to export Choreography to BPMN", e);
+				ret = false;
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method is used to initialize the export wizard.
+	 * 
+	 * @param workbench The workbench
+	 * @param selection The selected item(s)
+	 */
+	public void init(IWorkbench workbench, IStructuredSelection selection) {
+	    String errMesg=null;
+	    
+	    // Create the selection page
+		m_selectionPage = new FolderSelectionPage(PAGE_NAME,
+		        "Select a folder as the destination for "+
+		        "the exported BPMN");
+		
+	    // Check that a single CDL file has been selected
+		if (selection != null) {
+		    
+		    // Check element is a file
+		    if (selection.getFirstElement() instanceof IFile) {
+			
+		        m_cdlFile = (IFile)selection.getFirstElement();
+			
+		        // Check the file extension is valid
+		        if (m_cdlFile.getFileExtension().equals(
+		        		CDLDefinitions.CDL_FILE_EXTENSION)) {
+		            
+		            // Make sure there are no markers associated
+		            // with the resource
+		        	if (ResourceUtil.hasErrors(m_cdlFile)) {
+					    errMesg = RESOURCE_ERROR;		        		
+		        	}
+				} else {
+				    errMesg = RESOURCE_NOT_CDL_ERROR;
+				}
+			} else {
+			    errMesg = RESOURCE_NOT_FILE_ERROR;
+		    }
+		} else {
+		    errMesg = RESOURCE_NOT_SELECTED_ERROR;
+		}
+		
+		// Check if an error should be reported
+		if (errMesg != null) {
+		    m_selectionPage.setErrorMessage(errMesg);
+		}
+	}
+
+	/**
+	 * This method configures the pages associated with
+	 * the CDL export wizard.
+	 */
+	public void addPages() {
+		addPage(m_selectionPage);
+	}
+	
+    private static Logger logger = Logger.getLogger("org.savara.tools.bpmn.eclipse");
+	private IFile m_cdlFile=null;
+	private FolderSelectionPage m_selectionPage=null;
+	
+    private static final String BEHAVIOR_EXTENSION = ServiceDefinitions.SERVICE_ENDPOINT_FILE_EXTENSION;
+	
+	private static String PAGE_NAME="Export BPMN";
+	private static String RESOURCE_NOT_SELECTED_ERROR="A resource has not been selected";
+	private static String RESOURCE_NOT_FILE_ERROR="The selected resource is not a file";
+	private static String RESOURCE_NOT_CDL_ERROR="The selected file is not a valid CDL object model";
+	private static String RESOURCE_ERROR="Invalid CDL cannot be exported as BPMN";
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/FolderSelectionPage.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/FolderSelectionPage.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/eclipse/FolderSelectionPage.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Feb 1, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.eclipse;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * This class represents the wizard page for selecting
+ * a folder.
+ */
+class FolderSelectionPage extends org.eclipse.jface.wizard.WizardPage {
+
+	/**
+	 * Constructor for the folder selection page.
+	 * 
+	 * @param pageName The page name
+	 * @param description The description
+	 */
+	public FolderSelectionPage(String pageName,
+	        String description) {
+		super(pageName);
+		setTitle(pageName);
+		setDescription(description);
+		setPageComplete(false);
+	}
+
+	/**
+	 * Create the control for the selection page.
+	 * 
+	 * @param parent The parent component
+	 */
+	public void createControl(Composite parent) {
+	    
+	    // Identify the shell
+		m_shell = parent.getShell();
+		
+		// Create the composite component
+		Composite composite = new Composite(parent, SWT.NONE);
+		composite.setLayout(new GridLayout());
+		composite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL));
+		
+		// Create the text field for entering the
+		// path to the folder
+		m_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+		m_text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+				    
+		// Ensure there is no error before setting up the
+		// text listener
+		if (getErrorMessage() == null) {
+			m_text.addModifyListener(new ModifyListener() {
+			    
+				public void modifyText(ModifyEvent e) {
+					String errMesg=null;
+					
+					try {
+					    // Setup file associated with entered
+					    // name
+					    java.io.File file=
+					        new java.io.File(m_text.getText());
+						
+					  	// Check that the folder exists
+						if (file.exists() == false) {
+							errMesg = "The folder does not exist";
+						} else if (file.isDirectory() == false) {
+							errMesg = "A folder should be selected";
+						}
+					} catch(Exception e2) {
+						// Ignore
+					}
+					
+					// Check if error has been found
+					if (errMesg != null) {
+						setErrorMessage(errMesg);
+						setPageComplete(false);
+					} else {
+						setErrorMessage(null);
+						setPageComplete(true);
+					}
+				}
+			});
+		}		
+
+		// Create a 'browse' button
+		m_button=new Button(composite, 0);
+		
+		m_button.setText("Browse");
+		m_button.setToolTipText("Browse file system to locate destination folder");
+		
+		m_button.addSelectionListener(new org.eclipse.swt.events.SelectionListener() {
+			public void widgetSelected(SelectionEvent evt) {
+				DirectoryDialog dialog=new DirectoryDialog(m_shell);
+
+				String filename=dialog.open();
+				
+				if (filename != null) {
+					
+					filename = preProcessFilename(filename);
+					m_text.setText(filename);
+				}
+			}
+			
+			public void widgetDefaultSelected(SelectionEvent evt) {					
+			}
+		});
+		
+		if (getErrorMessage() != null) {
+			m_button.setEnabled(false);
+			m_text.setEnabled(false);
+			m_text.setEditable(false);
+		}
+		
+		setControl(composite);
+	}
+		
+	/**
+	 * This method preprocesses the filename before it is
+	 * used.
+	 * 
+	 * @param filename The original filename
+	 * @return The pre-processed filename
+	 */
+	protected String preProcessFilename(String filename) {
+		return(filename);
+	}
+	
+	/**
+	 * This method returns the folder path that has been
+	 * entered by the user.
+	 * 
+	 * @return The folder name
+	 */
+	public String getFolderName() {
+	    if (m_text == null) {
+	        return(null);
+	    }
+	    return(m_text.getText());
+	}
+	
+	private Text m_text=null;
+	private Shell m_shell=null;
+	private Button m_button=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNConfiguration.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNConfiguration.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNConfiguration.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+/**
+ * This interface represents the configuration information used
+ * by the BPMN projection to determine what model components and
+ * features should be included.
+ *
+ */
+public interface BPMNConfiguration {
+
+	/**
+	 * This method returns the UML export format to be used. The list
+	 * of valid export formats is available using the
+	 * #UMLGenerator.getExportFormats() method.
+	 * 
+	 * @return The export format, or null if the default is being used.
+	 */
+	public String getExportFormat();
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerationException.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerationException.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerationException.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+/**
+ * This class represents a BPMN generation exception.
+ *
+ */
+public class BPMNGenerationException extends Exception {
+
+	private static final long serialVersionUID = -8580109779260853013L;
+
+	/**
+	 * This constructor initializes the UML generation exception
+	 * with a message.
+	 * 
+	 * @param mesg The message
+	 */
+	public BPMNGenerationException(String mesg) {
+		super(mesg);
+	}
+	
+	/**
+	 * This constructor initializes the UML generation exception
+	 * with a message and associated exception.
+	 * 
+	 * @param mesg The message
+	 * @param t The associated exception
+	 */
+	public BPMNGenerationException(String mesg, Throwable t) {
+		super(mesg, t);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,945 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.CDLManager;
+import org.pi4soa.service.behavior.ActivityType;
+import org.pi4soa.service.behavior.Assign;
+import org.pi4soa.service.behavior.AtomicUnit;
+import org.pi4soa.service.behavior.BehaviorDescription;
+import org.pi4soa.service.behavior.BehaviorVisitor;
+import org.pi4soa.service.behavior.Choice;
+import org.pi4soa.service.behavior.CompletionHandler;
+import org.pi4soa.service.behavior.Conditional;
+import org.pi4soa.service.behavior.ExceptionHandler;
+import org.pi4soa.service.behavior.Finalize;
+import org.pi4soa.service.behavior.Parallel;
+import org.pi4soa.service.behavior.Perform;
+import org.pi4soa.service.behavior.RaiseException;
+import org.pi4soa.service.behavior.Receive;
+import org.pi4soa.service.behavior.RepetitionType;
+import org.pi4soa.service.behavior.Send;
+import org.pi4soa.service.behavior.Sequence;
+import org.pi4soa.service.behavior.ServiceDescription;
+import org.pi4soa.service.behavior.StructuralType;
+import org.pi4soa.service.behavior.TimedUnit;
+import org.pi4soa.service.behavior.Unobservable;
+import org.pi4soa.service.behavior.VariableDeclaration;
+import org.pi4soa.service.behavior.When;
+import org.pi4soa.service.behavior.While;
+import org.pi4soa.service.behavior.projection.BehaviorProjection;
+import org.pi4soa.service.session.internal.LookaheadElement;
+import org.pi4soa.service.session.internal.Predicate;
+import org.savara.tools.bpmn.generation.components.*;
+
+/**
+ * This class provides the functionality for converting a
+ * choreography description into a BPMN representation.
+ *
+ */
+public class BPMNGenerator {
+
+	public static void main(String[] args) {
+		
+		// Check for optional parameters
+		int pos=0;
+		int num=args.length;
+		String[] participant=null;
+		
+		for (; pos < num && args[pos].charAt(0) == '-'; pos++) {
+			String option=args[pos].substring(1);
+			if (option.equals("p")) {
+				if (participant != null) {
+					System.err.println("Cannot specify participant more than once");
+					System.exit(1);
+				} else if (pos+1 >= num) {
+					System.err.println("Participant not defined");
+					System.exit(1);
+				} else {
+					pos++;
+					participant = new String[]{args[pos]};
+				}
+			} else {
+				System.err.println("Unknown option "+args[pos]);
+				System.err.println(USAGE_MESSAGE);
+				System.exit(1);
+			}
+		}
+		
+		// Check parameters
+		if (num - pos != 2) {
+			System.err.println(USAGE_MESSAGE);
+			System.exit(1);
+		}
+		
+		String choreographyFile=args[pos];
+		String outputFolder=args[pos+1];
+		org.pi4soa.cdl.Package choreography=null;
+		
+		// Load the choreography
+		try {
+			choreography = CDLManager.load(choreographyFile);
+			
+		} catch(Exception e) {
+			System.err.println("Failed to load choreography: "+e);
+			e.printStackTrace();
+			System.exit(1);
+		}
+		
+		try {
+			BPMNGenerator generator=new BPMNGenerator();
+			
+			generator.generate(choreography, participant, outputFolder,
+					new DefaultBPMNConfiguration());
+			
+		} catch(Exception e) {
+			System.err.println("Failed to generate UML: "+e);
+			e.printStackTrace();
+			System.exit(3);
+		}
+	}
+	
+	/**
+	 * This is the constructor for the UML generator.
+	 * 
+	 */
+	public BPMNGenerator() {
+	}
+	
+	/**
+	 * This method generates the UML representation for the
+	 * supplied choreography. If the optional participant
+	 * is specified, then only the UML representation for
+	 * that participant will be generated, otherwise all
+	 * participants associated with the choreography will be
+	 * generated.
+	 * 
+	 * @param choreography The choreography
+	 * @param participants The optional participant names
+	 * @param folder The folder where the model/diagrams will
+	 * 					be stored
+	 * @param config The UML configuration
+	 * @exception BPMNGenerationException Failed to generate
+	 */
+	public void generate(org.pi4soa.cdl.Package choreography,
+					String[] participants, String folder,
+					BPMNConfiguration config) throws BPMNGenerationException {
+	
+		if (participants == null) {
+			java.util.List pTypes=
+				choreography.getTypeDefinitions().getParticipantTypes();
+			
+			participants = new String[pTypes.size()];
+			
+			for (int i=0; i < pTypes.size(); i++) {
+				participants[i] = ((org.pi4soa.cdl.ParticipantType)pTypes.
+							get(i)).getName();
+			}
+		}
+
+		// Create the model
+		org.savara.tools.bpmn.generation.BPMNModelFactory model=null;
+		org.savara.tools.bpmn.generation.BPMNNotationFactory notation=null;
+		
+		try {
+			model = new org.savara.tools.bpmn.generation.stp.STPBPMNModelFactoryImpl();
+			notation = new org.savara.tools.bpmn.generation.gmf.GMFBPMNNotationFactoryImpl();
+			
+			generateModel(model, notation, choreography, config, folder);
+
+		} catch(Exception e) {
+			throw new BPMNGenerationException("Failed to generate UML model", e);
+		}
+		
+		/*
+		if (diagrams.size() > 0) {
+			Object diagram=diagrams.get(0);
+			
+			try {
+				
+				// Output the UML2 model to the supplied stream
+				final org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl xmi =
+					new org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl();
+				xmi.getContents().add(diagram);
+				
+				xmi.doSave(ostream, xmi.getDefaultLoadOptions());
+				
+				ostream.close();
+				
+			} catch(Exception e) {
+				throw new BPMNGenerationException("Failed to convert to XMI", e);
+			}
+		}
+		*/
+		// Just need to store as EMF based file
+		/*
+		try {
+			java.io.ByteArrayOutputStream bs=new java.io.ByteArrayOutputStream();
+			
+			// Output the UML2 model to the supplied stream
+			final org.eclipse.emf.ecore.xmi.impl.EMOFResourceImpl xmi =
+				new org.eclipse.emf.ecore.xmi.impl.EMOFResourceImpl();
+			xmi.getContents().add(model);
+			
+			xmi.doSave(bs, xmi.getDefaultLoadOptions());
+			
+			bs.close();
+			
+			UMLExportFormatter formatter=getExportFormatter(config.getExportFormat());
+			if (formatter != null) {
+				formatter.export(bs, ostream);
+			} else {
+				throw new UMLException("Unable to find UML export formatter for '"+
+						config.getExportFormat()+"'");
+			}
+				
+		} catch(UMLException UMLex) {
+			throw UMLex;
+			
+		} catch(Exception e) {
+			throw new UMLException("Failed to convert to XMI", e);
+		}
+		*/
+	}
+	
+	/**
+	 * This method generates the model information associated
+	 * with the supplied choreography description.
+	 * 
+	 * @param model The model
+	 * @param cdlpack The choreography description
+	 * @param config The MDA configuration
+	 * @return The list of diagrams
+	 * @throws BPMNGenerationException Failed to generate model
+	 */
+	public void generateModel(BPMNModelFactory model, 
+			BPMNNotationFactory notation, org.pi4soa.cdl.Package cdlpack,
+					BPMNConfiguration config, String folder) throws BPMNGenerationException {
+		try {
+			java.util.List participants=cdlpack.getTypeDefinitions().getParticipantTypes();
+			
+			BPMNModelVisitor visitor=
+				new BPMNModelVisitor(org.pi4soa.common.xml.XMLUtils.getLocalname(
+						cdlpack.getName()),
+						model, notation, folder);
+			
+			for (int i=0; i < participants.size(); i++) {
+				org.pi4soa.cdl.ParticipantType partType=
+							(org.pi4soa.cdl.ParticipantType)
+							cdlpack.getTypeDefinitions().getParticipantTypes().get(i);
+					
+				org.pi4soa.service.behavior.ServiceDescription sdesc=
+					BehaviorProjection.projectServiceDescription(cdlpack,
+							partType, null);
+			
+				visitor.setParticipant(partType.getName());
+				
+				sdesc.visit(visitor);
+			}
+			
+			visitor.completeModels();
+			
+		} catch(Exception e) {
+			throw new BPMNGenerationException("Failed to generate BPMN model", e);
+		}
+	}
+	
+    private static Logger logger = Logger.getLogger("org.savara.tools.bpmn.generation");
+
+    private static final String USAGE_MESSAGE = "Usage: BPMNGenerator [-p Participant] " +
+							"ChoreographyFile OutputFolder";
+
+    // NOTE: Currently uses the Activity Model constructs
+	public class BPMNModelVisitor implements BehaviorVisitor {
+		
+		/**
+		 * The constructor the BPMN model visitor.
+		 * 
+		 */
+		public BPMNModelVisitor(String choreoName,
+				BPMNModelFactory model, BPMNNotationFactory notation,
+					String folder) {
+			m_choreoName = choreoName;
+			m_modelFactory = model;
+			m_notationFactory = notation;
+			m_folder = folder;
+		}
+		
+		/**
+		 * This method sets the name associated with the participant
+		 * being projected.
+		 * 
+		 * @param participant The participant
+		 */
+		public void setParticipant(String participant) {
+			m_participant = participant;
+		}
+		
+		/**
+		 * This method visits the abstract activity. This will be
+		 * performed after performing the specific visit method
+		 * for the real type, but before performing the visit
+		 * on any other activities that may be contained within
+		 * this activity type.
+		 * 
+		 * @param elem The activity type
+		 */
+		public void activityType(ActivityType elem) {
+			
+		}
+		
+		/**
+		 * This method visits the assign activity.
+		 * 
+		 * @param elem The assign
+		 */
+		public void assign(Assign elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				new SimpleActivity(elem,
+						umls, m_modelFactory, m_notationFactory);
+			}
+		}
+		
+		/**
+		 * This method starts visiting the atomic unit element.
+		 * 
+		 * @param elem The atomic unit
+		 */
+		public void atomicUnitStart(AtomicUnit elem) {
+			
+		}
+		
+		/**
+		 * This method ends visiting the atomic unit element.
+		 * 
+		 * @param elem The atomic unit
+		 */
+		public void atomicUnitEnd(AtomicUnit elem) {
+			
+		}
+		
+		/**
+		 * This method starts visiting the behavior description element.
+		 * 
+		 * @param elem The behavior description
+		 */
+		public void behaviorDescriptionStart(BehaviorDescription elem) {
+			
+			try {
+				BPMNDiagram diagram=getBPMNModel(elem, m_folder);
+				
+				String participant=m_participant;
+				
+				if (org.pi4soa.common.util.NamesUtil.isSet(elem.getParticipant())) {
+					participant += " ["+elem.getParticipant()+"]";
+				}
+				
+				BPMNPool pool=diagram.createPool(participant);
+				
+				//diagram.initialize(elem);
+				
+				pushBPMNActivity(pool);
+			} catch(Exception e) {
+				logger.severe("Failed to get state machine " +
+						"for behavior '"+elem+"': "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the behavior description element.
+		 * 
+		 * @param elem The behavior description
+		 */
+		public void behaviorDescriptionEnd(BehaviorDescription elem) {
+
+			BPMNActivity umls=getBPMNActivity();
+			
+			if (umls != null) {
+				umls.childrenComplete();
+			}
+
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method starts visiting the choice element.
+		 * 
+		 * @param elem The choice
+		 */
+		public void choiceStart(Choice elem) {
+			
+			try {
+				pushBPMNActivity(new ChoiceActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create choice state: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the choice element.
+		 * 
+		 * @param elem The choice
+		 */
+		public void choiceEnd(Choice elem) {
+			
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method starts visiting the completion handler element.
+		 * 
+		 * @param elem The completion handler
+		 */
+		public void completionHandlerStart(CompletionHandler elem) {
+			
+			/*
+			try {
+				BPMNActivity bdstate=getBPMNModel(elem, m_folder);
+					
+				pushBPMNActivity(bdstate);
+			} catch(Exception e) {
+				logger.severe("Failed to get state machine for " +
+						"completion handler '"+elem+"': "+e);
+			}
+			*/
+		}
+		
+		/**
+		 * This method ends visiting the completion handler element.
+		 * 
+		 * @param elem The completion handler
+		 */
+		public void completionHandlerEnd(CompletionHandler elem) {
+			
+			/*
+			BPMNActivity umls=getBPMNActivity();
+			
+			if (umls != null) {
+				umls.childrenComplete();
+			}
+
+			popUMLActivity();
+			*/
+		}
+		
+		/**
+		 * This method starts visiting the conditional element.
+		 * 
+		 * @param elem The conditional
+		 */
+		public void conditionalStart(Conditional elem) {
+			
+			try {
+				pushBPMNActivity(new ConditionalActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+				pushBPMNActivity(new SequenceActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create conditional state: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the conditional element.
+		 * 
+		 * @param elem The conditional
+		 */
+		public void conditionalEnd(Conditional elem) {
+			
+			popUMLActivity();
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method starts visiting the exception handler element.
+		 * 
+		 * @param elem The exception handler
+		 */
+		public void exceptionHandlerStart(ExceptionHandler elem) {
+			
+			/*
+			try {
+				BPMNActivity bdstate=getBPMNModel(elem);
+					
+				pushBPMNActivity(bdstate);
+			} catch(Exception e) {
+				logger.severe("Failed to get state machine for " +
+						"exception handler '"+elem+"': "+e);
+			}
+			*/
+		}
+		
+		/**
+		 * This method ends visiting the exception handler element.
+		 * 
+		 * @param elem The exception handler
+		 */
+		public void exceptionHandlerEnd(ExceptionHandler elem) {
+			
+			/*
+			BPMNActivity umls=getBPMNActivity();
+			
+			if (umls != null) {
+				umls.childrenComplete();
+			}
+
+			popUMLActivity();
+			*/
+		}
+		
+		/**
+		 * This method visits the finalize activity.
+		 * 
+		 * @param elem The finalize
+		 */
+		public void finalize(Finalize elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				SimpleActivity state=new SimpleActivity(elem,
+						umls, m_modelFactory, m_notationFactory);
+				
+				/*
+				try {
+					StateMachineState subMachine=
+						getStateMachineState(elem.getCompletionHandler());
+					state.setSubStateMachine(subMachine);
+				} catch(Exception e) {
+					logger.severe("Failed to get state machine: "+e);
+				}
+				*/
+			}
+		}
+		
+		/**
+		 * This method starts visiting the parallel element.
+		 * 
+		 * @param elem The parallel
+		 */
+		public void parallelStart(Parallel elem) {
+			
+			try {
+				pushBPMNActivity(new ParallelActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create parallel state: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the parallel element.
+		 * 
+		 * @param elem The parallel
+		 */
+		public void parallelEnd(Parallel elem) {
+			
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method visits the perform activity.
+		 * 
+		 * @param elem The perform
+		 */
+		public void perform(Perform elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				PerformActivity state=new PerformActivity(elem,
+						umls, m_modelFactory, m_notationFactory);
+				
+				if (elem instanceof LookaheadElement) {
+					LookaheadElement lookahead=(LookaheadElement)elem;
+					boolean f_send=false;
+					boolean f_receive=false;
+					
+					java.util.Iterator iter=lookahead.getPreConditions().iterator();
+					while (iter.hasNext()) {
+						Predicate pred=(Predicate)iter.next();
+						
+						if (pred.isMessagePredicate()) {
+							
+							if (pred.isReceiveLookaheadPredicate()) {
+								f_receive = true;
+							} else {
+								f_send = true;
+							}
+						}
+					}
+					
+					if (f_send && !f_receive) {
+						umls.getBPMNDiagram().registerInitiatingPerform(elem, state);
+					} else if (!f_send && f_receive) {
+						umls.getBPMNDiagram().registerInitiatedPerform(elem, state);
+					}
+				}
+			}
+		}
+		
+		/**
+		 * This method visits the raise exception activity.
+		 * 
+		 * @param elem The raise exception
+		 */
+		public void raiseException(RaiseException elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				new SimpleActivity(elem, umls, m_modelFactory, m_notationFactory);
+			}
+		}
+		
+		/**
+		 * This method visits the receive activity.
+		 * 
+		 * @param elem The receive
+		 */
+		public void receive(Receive elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				ReceiveActivity sa=
+					new ReceiveActivity(elem, umls, m_modelFactory, m_notationFactory);
+				
+				// Register the receive to enable links to be established
+				// with an appropriate send
+				BPMNDiagram amodel=umls.getBPMNDiagram();		
+				amodel.registerReceiveActivity(elem, sa);
+			}
+		}
+		
+		/**
+		 * This method starts visiting the repetition type abstract element.
+		 * 
+		 * @param elem The repetition type
+		 */
+		public void repetitionTypeStart(RepetitionType elem) {
+			
+		}
+		
+		/**
+		 * This method ends visiting the repetition type abstract element.
+		 * 
+		 * @param elem The repetition type
+		 */
+		public void repetitionTypeEnd(RepetitionType elem) {
+			
+		}
+		
+		/**
+		 * This method visits the send activity.
+		 * 
+		 * @param elem The send
+		 */
+		public void send(Send elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				SimpleActivity sa=
+					new SimpleActivity(elem, umls, m_modelFactory, m_notationFactory);
+				
+				// Register the send to enable links to be established
+				// with an appropriate receive
+				BPMNDiagram amodel=umls.getBPMNDiagram();		
+				amodel.registerSendActivity(elem, sa);
+			}
+		}
+		
+		/**
+		 * This method starts visiting the sequence element.
+		 * 
+		 * @param elem The sequence
+		 */
+		public void sequenceStart(Sequence elem) {
+			
+			try {
+				pushBPMNActivity(new SequenceActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create sequence state: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the sequence element.
+		 * 
+		 * @param elem The sequence
+		 */
+		public void sequenceEnd(Sequence elem) {
+			
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method starts visiting the service description element.
+		 * 
+		 * @param elem The service description
+		 */
+		public void serviceDescriptionStart(ServiceDescription elem) {
+			
+		}
+		
+		/**
+		 * This method ends visiting the service description element.
+		 * 
+		 * @param elem The service description
+		 */
+		public void serviceDescriptionEnd(ServiceDescription elem) {
+			
+		}
+		
+		/**
+		 * This method starts visiting the structural type abstract element.
+		 * 
+		 * @param elem The structural type
+		 */
+		public void structuralTypeStart(StructuralType elem) {
+			
+		}
+		
+		/**
+		 * This method ends visiting the structural type abstract element.
+		 * 
+		 * @param elem The structural type
+		 */
+		public void structuralTypeEnd(StructuralType elem) {
+			
+			/*
+			BPMNActivity umls=getBPMNActivity();
+			
+			if (umls != null) {
+				umls.childrenComplete();
+			}
+			*/
+		}
+		
+		/**
+		 * This method starts visiting the timed unit element.
+		 * 
+		 * @param elem The timed unit
+		 */
+		public void timedUnitStart(TimedUnit elem) {
+			
+		}
+		
+		/**
+		 * This method ends visiting the timed unit element.
+		 * 
+		 * @param elem The timed unit
+		 */
+		public void timedUnitEnd(TimedUnit elem) {
+			
+		}
+		
+		/**
+		 * This method visits the unobservable activity.
+		 * 
+		 * @param elem The unobservable
+		 */
+		public void unobservable(Unobservable elem) {
+			
+			BPMNActivity umls=getBPMNActivity();
+			if (umls != null) {
+				new SimpleActivity(elem, umls, m_modelFactory, m_notationFactory);
+			}
+		}
+		
+		/**
+		 * This method visits the variable declaration activity.
+		 * 
+		 * @param elem The variable declaration
+		 */
+		public void variableDeclaration(VariableDeclaration elem) {
+			
+		}
+		
+		/**
+		 * This method starts visiting the when element.
+		 * 
+		 * @param elem The when
+		 */
+		public void whenStart(When elem) {
+			
+			try {
+				pushBPMNActivity(new WhenActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+					
+				pushBPMNActivity(new SequenceActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+			} catch(Exception e) {
+				logger.severe("Failed to create when Activity: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the when element.
+		 * 
+		 * @param elem The when
+		 */
+		public void whenEnd(When elem) {
+			
+			popUMLActivity();
+			popUMLActivity();
+		}
+
+		/**
+		 * This method starts visiting the while element.
+		 * 
+		 * @param elem The while
+		 */
+		public void whileStart(While elem) {
+			
+			try {
+				pushBPMNActivity(new WhileActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+				pushBPMNActivity(new SequenceActivity(elem,
+						getBPMNActivity(), m_modelFactory, m_notationFactory));
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create while Activity: "+e);
+			}
+		}
+		
+		/**
+		 * This method ends visiting the while element.
+		 * 
+		 * @param elem The while
+		 */
+		public void whileEnd(While elem) {
+			
+			popUMLActivity();
+			
+			popUMLActivity();
+		}
+		
+		/**
+		 * This method returns a Activity machine Activity for the supplied
+		 * behavior type. If one already exists, then it will be
+		 * returned, otherwise one will be created.
+		 * 
+		 * @param elem The behavior type
+		 * @return The Activity machine state
+		 */
+		protected BPMNDiagram getBPMNModel(
+					BehaviorDescription elem, String folder) throws BPMNGenerationException {
+			String name=BPMNDiagram.getName(elem);
+			
+			BPMNDiagram ret=(BPMNDiagram)
+						m_activityModels.get(name);
+			
+			if (ret == null) {
+				ret = new BPMNDiagram(m_choreoName, name,
+						null, m_modelFactory, m_notationFactory, folder);
+				
+				m_activityModels.put(name, ret);
+			}
+			
+			// Create activity partition for service
+			/*
+			org.eclipse.uml2.uml.ActivityPartition partition = 
+				(org.eclipse.uml2.uml.ActivityPartition)
+				ret.getTopLevelActivity().createGroup(
+						UMLPackage.eINSTANCE.getActivityPartition());
+			partition.setName(org.pi4soa.common.xml.XMLUtils.getLocalname(
+					elem.getServiceDescription().getName()));
+			ret.setCurrentPartition(partition);
+			*/
+			
+			return(ret);
+		}
+		
+		/**
+		 * This method pushes the supplied UML activity
+		 * onto a stack.
+		 * 
+		 * @param sms The activity
+		 */
+		protected void pushBPMNActivity(BPMNActivity umls) {
+			m_umlActivityStack.insertElementAt(umls, 0);
+		}
+		
+		/**
+		 * This method returns the UML activity found at the
+		 * top of the stack.
+		 * 
+		 * @return The activity
+		 */
+		protected BPMNActivity getBPMNActivity() {
+			BPMNActivity ret=null;
+			
+			if (m_umlActivityStack.size() > 0) {
+				ret = (BPMNActivity)m_umlActivityStack.get(0);
+			}
+			
+			return(ret);
+		}
+		
+		/**
+		 * This method returns the UML activity from the
+		 * top of the stack.
+		 *
+		 */
+		protected void popUMLActivity() {
+			BPMNActivity umls=getBPMNActivity();
+			
+			if (umls != null) {
+				umls.childrenComplete();
+			}
+			
+			if (m_umlActivityStack.size() > 0) {
+				m_umlActivityStack.remove(0);
+			}
+		}
+		
+		/**
+		 * This method completes the construction of the activity
+		 * models.
+		 *
+		 */
+		public void completeModels() throws BPMNGenerationException {
+			java.util.Enumeration iter=m_activityModels.elements();
+			
+			while (iter.hasMoreElements()) {
+				BPMNDiagram amodel=(BPMNDiagram)iter.nextElement();
+				
+				amodel.completeModel();
+			}
+		}
+		
+		private BPMNModelFactory m_modelFactory=null;
+		private BPMNNotationFactory m_notationFactory=null;
+		private String m_folder=null;
+		private String m_choreoName=null;
+		private String m_participant=null;
+	    private java.util.Vector m_umlActivityStack=new java.util.Vector();
+	    private java.util.Hashtable m_activityModels=new java.util.Hashtable();
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNModelFactory.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNModelFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNModelFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-6 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 26 Jan 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+import org.pi4soa.service.behavior.ActivityType;
+
+public interface BPMNModelFactory {
+
+	public String getFileExtension();
+	
+	public void saveModel(String fileName, Object diagram)
+						throws BPMNGenerationException;
+	
+	public Object createDiagram();
+	
+	public Object createPool(Object diagram, String name);
+	
+	public Object createInitialNode(Object container);
+	
+	public Object createSimpleTask(Object container, ActivityType activity);
+	
+	public Object createDataBasedXORGateway(Object container);
+	
+	public Object createEventBasedXORGateway(Object container);
+	
+	public Object createANDGateway(Object container);
+	
+	public Object createFinalNode(Object container);
+	
+	public Object createControlLink(Object container,
+			Object fromNode, Object toNode,
+			String conditionalExpression);
+	
+	public Object createMessageLink(Object container,
+			Object fromNode, Object toNode,
+			org.pi4soa.service.behavior.Receive receive);
+	
+	public Object setLinkExpression(Object link, String expression);
+	
+	public boolean isDecision(Object node);
+	
+	/**
+	 * This method determines if the supplied node is a join. This
+	 * is true, if the node is a data or event based gateway,
+	 * and as incoming edges. This is based on the fact that only
+	 * a join gateway, at the point this method is invoked, would
+	 * have incoming links, otherwise any other gateway would be
+	 * assumed to be the initial gateway in a conditional grouping
+	 * construct.
+	 * 
+	 * @param node
+	 * @return Whether the node is a join
+	 */
+	public boolean isJoin(Object node);
+	
+	public boolean isTerminal(Object node);
+	
+	public void setLabel(Object entity, String label);
+	
+	public Object getSource(Object link);
+	
+	public void setSource(Object link, Object node);
+	
+	public Object getTarget(Object link);
+	
+	public void setTarget(Object link, Object node);
+	
+	public java.util.List getInboundControlLinks(Object node);
+	
+	public java.util.List getOutboundControlLinks(Object node);
+	
+	public java.util.List getInboundMessageLinks(Object node);
+	
+	public java.util.List getOutboundMessageLinks(Object node);
+	
+	public void delete(Object entity);
+	
+	public boolean isDeleted(Object entity);
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNNotationFactory.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNNotationFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/BPMNNotationFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-6 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 30 Jan 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+
+public interface BPMNNotationFactory {
+
+	public String getFileExtension();
+	
+	public void saveNotation(String modelFileName, Object diagramModel,
+			String notationFileName, Object diagramNotation)
+							throws BPMNGenerationException;
+
+	public Object createDiagram(BPMNModelFactory factory,
+			Object diagramModel, int x, int y, int width, int height);
+	
+	public Object createPool(BPMNModelFactory factory,
+				Object poolModel, Object diagramNotation,
+				int x, int y, int width, int height);
+	
+	public Object createTask(BPMNModelFactory factory,
+			Object taskModel, Object parentNotation,
+					int x, int y, int width, int height);
+	
+	public Object createJunction(BPMNModelFactory factory,
+			Object junctionModel, Object parentNotation,
+					int x, int y, int width, int height);
+		
+	public Object createMessageLink(BPMNModelFactory factory,
+			Object linkModel, Object diagramNotation);
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/DefaultBPMNConfiguration.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/DefaultBPMNConfiguration.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/DefaultBPMNConfiguration.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation;
+
+/**
+ * This class provides the default implementation for the
+ * BPMN configuration interface.
+ *
+ */
+public class DefaultBPMNConfiguration implements BPMNConfiguration {
+
+	/**
+	 * This is the default constructor.
+	 *
+	 */
+	public DefaultBPMNConfiguration() {
+	}
+	
+	/**
+	 * This method returns the UML export format to be used. The list
+	 * of valid export formats is available using the
+	 * #UMLGenerator.getExportFormats() method.
+	 * 
+	 * @return The export format, or null if the default is being used.
+	 */
+	public String getExportFormat() {
+		return(m_exportFormat);
+	}
+	
+	/**
+	 * This method sets the export format.
+	 * 
+	 * @param format The export format
+	 */
+	public void setExportFormat(String format) {
+		m_exportFormat = format;
+	}
+	
+	private String m_exportFormat=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/AbstractBPMNActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/AbstractBPMNActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/AbstractBPMNActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+public abstract class AbstractBPMNActivity implements BPMNActivity {
+
+	/**
+	 * This is the constructor for the default BPMN activity.
+	 * 
+	 * @param parent The parent
+	 */
+	public AbstractBPMNActivity(BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		m_parent = parent;
+		m_modelFactory = model;
+		m_notationFactory = notation;
+		
+		if (parent instanceof AbstractBPMNActivity) {
+			((AbstractBPMNActivity)parent).addChildState(this);
+		}
+	}
+	
+	/**
+	 * This method returns the parent BPMN activity.
+	 * 
+	 * @return The parent
+	 */
+	public BPMNActivity getParent() {
+		return(m_parent);
+	}
+	
+	/**
+	 * This method returns the container associated with the
+	 * activity.
+	 * 
+	 * @return The container
+	 */
+	public Object getContainer() {
+		return(m_parent.getContainer());
+	}
+	
+	/**
+	 * This method returns the model.
+	 * 
+	 * @return The model
+	 */
+	protected org.savara.tools.bpmn.generation.BPMNModelFactory getModelFactory() {
+		return(m_modelFactory);
+	}
+	
+	/**
+	 * This method returns the notation factory.
+	 * 
+	 * @return The notation factory
+	 */
+	protected org.savara.tools.bpmn.generation.BPMNNotationFactory getNotationFactory() {
+		return(m_notationFactory);
+	}
+	
+	/**
+	 * This method adds a child BPMN state.
+	 * 
+	 * @param child The child BPMN state
+	 */
+	protected void addChildState(BPMNActivity child) {
+		m_childStates.add(child);
+	}
+	
+	/**
+	 * This method returns the list of child states.
+	 * 
+	 * @return The child states
+	 */
+	protected java.util.Vector getChildStates() {
+		return(m_childStates);
+	}
+	
+	/**
+	 * This method indicates that the BPMN state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+	}
+	
+	/**
+	 * This method returns the containing BPMN diagram.
+	 * 
+	 * @return The BPMN diagram
+	 */
+	public BPMNDiagram getBPMNDiagram() {
+		BPMNDiagram ret=null;
+		
+		if (m_parent != null) {
+			ret = m_parent.getBPMNDiagram();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the BPMN Activity Model.
+	 * 
+	 * @return The activity model
+	 */
+	/*
+	public Activity getTopLevelActivity() {
+		Activity ret=null;
+		
+		if (m_parent != null) {
+			ret = m_parent.getTopLevelActivity();
+		}
+		
+		return(ret);
+	}
+	*/
+	
+	/**
+	 * This method returns the BPMN Activity Partition.
+	 * 
+	 * @return The activity model
+	 */
+	/*
+	public ActivityPartition getActivityPartition() {
+		ActivityPartition ret=null;
+		
+		if (m_parent != null) {
+			ret = m_parent.getActivityPartition();
+		}
+		
+		return(ret);
+	}
+	*/
+	
+	/**
+	 * This method causes a transition to be established from
+	 * the supplied BPMN state to the current state, applying
+	 * any relevant information (such as event triggers
+	 * or conditios) to the transition as appropriate.
+	 * 
+	 * @param fromNode The source node
+	 * @param expression The optional conditional expression
+	 * @return The edge
+	 */
+	public Object transitionFrom(BPMNActivity fromNode,
+					String conditionalExpression) {
+		Object ret=getModelFactory().createControlLink(getContainer(),
+				fromNode.getEndNode(),
+				getStartNode(), conditionalExpression);
+		
+		/*
+		Activity activity=getTopLevelActivity();
+		ActivityEdge ret=(ActivityEdge)
+				activity.createEdge(null, UMLPackage.eINSTANCE.getControlFlow());
+		ret.getInPartitions().add(getActivityPartition());
+		
+		ret.setSource(fromNode.getEndNode());
+		ret.setTarget(getStartNode());
+		*/
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method joins a list of sequential child BPMN states with transitions.
+	 * 
+	 * @param children The list of child BPMN states
+	 */
+	public void transitionSequentialNodes() {
+		int width=0;
+		int height=0;
+		
+		if (getChildStates().size() > 0) {
+			BPMNActivity v1=(BPMNActivity)getChildStates().get(0);
+			width += v1.getWidth();
+			height = v1.getHeight();
+		}
+		
+		for (int i=1; i < getChildStates().size(); i++) {
+			BPMNActivity v1=(BPMNActivity)getChildStates().get(i-1);
+			BPMNActivity v2=(BPMNActivity)getChildStates().get(i);
+			
+			width += v2.getWidth();
+			
+			width += HORIZONTAL_GAP; // Gap
+			
+			if (height < v2.getHeight()) {
+				height = v2.getHeight();
+			}
+
+			Object endNode=v1.getEndNode();
+			
+			if (v1.canDeleteEndNode() &&
+					(getModelFactory().isJoin(endNode) || // instanceof org.eclipse.uml2.uml.MergeNode ||
+					getModelFactory().isTerminal(endNode))) { // instanceof org.eclipse.uml2.uml.FlowFinalNode) {
+
+				// Move the incoming transitions from the junction
+				// to the next state
+				java.util.List list=getModelFactory().getInboundControlLinks(endNode);
+				for (int j=list.size()-1; j >= 0; j--) {
+					Object transition=list.get(j);
+					
+					getModelFactory().setTarget(transition, v2.getStartNode());
+					//transition.setTarget(v2.getStartNode());
+				}
+				
+				// Remove Junction
+				getModelFactory().delete(endNode);
+				
+			} else {
+				v2.transitionFrom(v1, null);
+			}
+		}
+		
+		//height += VERTICAL_GAP; // Gap
+		
+		setWidth(width);
+		setHeight(height);
+//System.out.println("THIS: children="+m_childStates.size()+
+//		" this="+this+" width="+width+" height="+height);		
+	}
+	
+	public int getX() {
+		return(m_x);
+	}
+	
+	public void setX(int x) {
+//System.out.println("SETX: this="+this+" x="+x);		
+		m_x = x;
+	}
+
+	public int getY() {
+		return(m_y);
+	}
+	
+	public void setY(int y) {
+//System.out.println("SETY: this="+this+" y="+y);		
+		m_y = y;
+	}
+
+	public int getWidth() {
+		return(m_width);
+	}
+	
+	public void setWidth(int width) {
+		m_width = width;
+	}
+
+	public int getHeight() {
+		return(m_height);
+	}
+	
+	public void setHeight(int height) {
+		m_height = height;
+	}
+
+	public void adjustWidth(int width) {
+		float percentChange=width/getWidth();
+		
+		//setWidth(width);
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			int cur=act.getWidth();
+			int newWidth=(int)((float)cur * percentChange);
+			
+			act.adjustWidth(newWidth);
+			
+			int change=act.getWidth()-cur;
+			
+			setWidth(getWidth()+change);
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		setX(x);
+		setY(y);
+	}
+
+	public void draw(Object parent) {
+	}
+	
+	public boolean canDeleteEndNode() {
+		return(true);
+	}
+	
+	public static final int VERTICAL_GAP = 40;
+	public static final int HORIZONTAL_GAP = 50;
+	
+	private BPMNActivity m_parent=null;
+	private org.savara.tools.bpmn.generation.BPMNModelFactory m_modelFactory=null;
+	private org.savara.tools.bpmn.generation.BPMNNotationFactory m_notationFactory=null;
+	private java.util.Vector m_childStates=new java.util.Vector();
+	private int m_x=0;
+	private int m_y=0;
+	private int m_width=0;
+	private int m_height=0;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+/**
+ * This interface represents the generic capabilities of a state
+ * managing component in the CDL to BPMN transformation.
+ *
+ */
+public interface BPMNActivity {
+
+	/**
+	 * This method returns the parent BPMN activity.
+	 * 
+	 * @return The parent
+	 */
+	public BPMNActivity getParent();
+	
+	/**
+	 * This method returns the container object associated
+	 * with this activity.
+	 * 
+	 * @return The container
+	 */
+	public Object getContainer();
+		
+	/**
+	 * This method indicates that the BPMN state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete();
+	
+	/**
+	 * This method returns the BPMN top level Activity.
+	 * 
+	 * @return The top level activity
+	 */
+	//public Activity getTopLevelActivity();
+	
+	/**
+	 * This method returns the containing ActivityModel.
+	 * 
+	 * @return The activity model
+	 */
+	public BPMNDiagram getBPMNDiagram();
+	
+	/**
+	 * This method returns the BPMN Activity Partition.
+	 * 
+	 * @return The activity model
+	 */
+	//public ActivityPartition getActivityPartition();
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode();
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode();
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState();
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState();
+	
+	/**
+	 * This method causes a transition to be established from
+	 * the supplied BPMN state to the current state, applying
+	 * any relevant information (such as event triggers
+	 * or conditios) to the transition as appropriate.
+	 * 
+	 * @param fromNode The source node
+	 * @param expression The optional conditional expression
+	 * @return The edge
+	 */
+	public Object transitionFrom(BPMNActivity fromNode, String expression);
+	
+	public int getX();
+	
+	public void setX(int x);
+
+	public int getY();
+	
+	public void setY(int y);
+
+	public int getWidth();
+	
+	public void setWidth(int width);
+
+	public int getHeight();
+	
+	public void setHeight(int height);
+	
+	public void adjustWidth(int width);
+	
+	public void calculatePosition(int x, int y);
+	
+	public void draw(Object parent);
+	
+	public boolean canDeleteEndNode();
+	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNDiagram.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNDiagram.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNDiagram.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,465 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.service.behavior.BehaviorDescription;
+import org.pi4soa.service.behavior.BehaviorType;
+import org.pi4soa.service.behavior.CompletionHandler;
+import org.pi4soa.service.behavior.ExceptionHandler;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+/**
+ * This class represents the state information associated with
+ * the construction of a BPMN Activity model.
+ *
+ */
+public class BPMNDiagram extends AbstractBPMNActivity {
+
+	/**
+	 * This is the constructor for the activity model.
+	 * 
+	 * @param choreoName The choreography name
+	 * @param diagramName The diagram name
+	 * @param parent The parent activity
+	 * @param model The model factory
+	 * @param folder The output folder
+	 * @exception BPMNGenerationException Failed to construct activity model
+	 */
+	public BPMNDiagram(String choreoName, String diagramName,
+			BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation,
+			String folder) throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		m_name = choreoName+"_"+diagramName;
+		
+		m_diagram = model.createDiagram();
+		m_folder = folder;
+	}
+	
+	/**
+	 * This method returns the container associated with the
+	 * activity.
+	 * 
+	 * @return The container
+	 */
+	public Object getContainer() {
+		return(m_container);
+	}
+	
+	/**
+	 * This method sets the container associated with the
+	 * BPMN model.
+	 * 
+	 * @param container The container
+	 */
+	public BPMNPool createPool(String participant) {
+		BPMNPool ret=new BPMNPool(m_diagram, participant,
+					this, getModelFactory(), getNotationFactory());
+		
+		if (m_pools.containsKey(participant)) {
+			m_duplicatePools.add(ret);
+		} else {
+			m_pools.put(participant, ret);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the state machine name to be used for the
+	 * supplied behavior type.
+	 * 
+	 * @param elem The behavior type
+	 * @return The name
+	 */
+	public static String getName(BehaviorType elem) {
+		String ret=elem.getName();
+		
+		if (elem instanceof BehaviorDescription) {
+			ret = ((BehaviorDescription)elem).getName();
+			
+			if (org.pi4soa.common.util.NamesUtil.isSet(
+					((BehaviorDescription)elem).getParticipant()) &&
+				ret.endsWith("_"+((BehaviorDescription)elem).getParticipant())) {
+				
+				ret = ret.substring(0, ret.length()-
+						((BehaviorDescription)elem).getParticipant().length()-1);
+			}
+
+		} else if (elem instanceof CompletionHandler) {
+			ret = getName(((CompletionHandler)elem).
+					getEnclosingBehaviorDescription())+"["+
+					ret+"]";
+
+		} else if (elem instanceof ExceptionHandler) {
+			String excType=((ExceptionHandler)elem).getExceptionType();
+			if (NamesUtil.isSet(excType) == false) {
+				excType = "default";
+			}
+			
+			ret = getName(((ExceptionHandler)elem).
+					getEnclosingBehaviorDescription())+"[exception="+
+					excType+"]";
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied behavior type
+	 * should result in a root entry/exit point from the
+	 * state machine.
+	 * 
+	 * @param elem The behavior type
+	 * @return Whether it is a root
+	 */
+	protected boolean isRoot(BehaviorType elem) {
+		boolean ret=false;
+		
+		if (elem instanceof BehaviorDescription &&
+				((BehaviorDescription)elem).isRoot()) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the containing ActivityModel.
+	 * 
+	 * @return The activity model
+	 */
+	public BPMNDiagram getBPMNDiagram() {
+		return(this);
+	}
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		//return(m_initialState.getStartNode());
+		return(null);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		//return(m_finalState.getEndNode());
+		return(null);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(null);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(null);
+	}
+	
+	/**
+	 * This method registers a send activity against the BPMN representation.
+	 * 
+	 * @param send The send activity
+	 * @param activity The BPMN representation
+	 */
+	public void registerSendActivity(org.pi4soa.service.behavior.Send send,
+						BPMNActivity activity) {
+		if (isPoolDuplicate(activity) == false) {
+			m_sendActivities.put(send, activity);
+		}
+	}
+		
+	/**
+	 * This method registers a receive activity against the BPMN representation.
+	 * 
+	 * @param recv The receive activity
+	 * @param activity The BPMN representation
+	 */
+	public void registerReceiveActivity(org.pi4soa.service.behavior.Receive recv,
+						BPMNActivity activity) {
+		if (isPoolDuplicate(activity) == false) {
+			m_receiveActivities.put(recv.getGlobalDescriptionURI(), activity);
+		}
+	}
+	
+	/**
+	 * This method registers an initiating perform activity
+	 * against the BPMN representation.
+	 * 
+	 * @param perform The perform activity
+	 * @param activity The BPMN representation
+	 */
+	public void registerInitiatingPerform(org.pi4soa.service.behavior.Perform perform,
+						BPMNActivity activity) {
+		m_initiatingPerforms.put(perform.getGlobalDescriptionURI(), activity);
+	}
+		
+	/**
+	 * This method registers an initiated perform activity
+	 * against the BPMN representation.
+	 * 
+	 * @param perform The perform activity
+	 * @param activity The BPMN representation
+	 */
+	public void registerInitiatedPerform(org.pi4soa.service.behavior.Perform perform,
+						BPMNActivity activity) {
+		m_initiatedPerforms.put(perform.getGlobalDescriptionURI(), activity);
+	}
+	
+	/**
+	 * This method determines if the supplied activity is
+	 * associated with a duplicate pool that will be deleted.
+	 * 
+	 * @param activity The activity
+	 * @return Whether the activity is associated with a
+	 * 					duplicate pool
+	 */
+	protected boolean isPoolDuplicate(BPMNActivity activity) {
+		boolean ret=false;
+		
+		while (activity != null && (activity instanceof BPMNPool)
+							== false) {
+			activity = activity.getParent();
+		}
+		
+		if (activity != null) {
+			ret = m_duplicatePools.contains(activity);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method completes the generation of the model.
+	 *
+	 */
+	public void completeModel() throws BPMNGenerationException {
+		java.util.Enumeration iter=m_sendActivities.keys();
+		java.util.Vector messageLinks=new java.util.Vector();
+		
+		while (iter.hasMoreElements()) {
+			org.pi4soa.service.behavior.Send send=
+				(org.pi4soa.service.behavior.Send)iter.nextElement();
+
+			BPMNActivity sendActivity=(BPMNActivity)
+							m_sendActivities.get(send);
+			ReceiveActivity receiveActivity=(ReceiveActivity)
+							m_receiveActivities.get(send.getGlobalDescriptionURI());
+			
+			if (sendActivity != null && receiveActivity != null) {
+				
+				if (m_sendReceiveAsControlLink) {
+				
+					if (m_controlFromSendOnly) {
+						// Break links to the receive node, as control will
+						// be from the sending participant
+						receiveActivity.breakLinks();
+					}
+					
+					// Create control flow between the activities
+					/*
+					Activity activity=getTopLevelActivity();
+					ActivityEdge ret=(ActivityEdge)
+							activity.createEdge(null, UMLPackage.eINSTANCE.getControlFlow());
+					
+					ret.setSource(sendActivity.getEndNode());
+					ret.setTarget(receiveActivity.getStartNode());
+					
+					ret.setName(send.getOperationName());
+					*/
+					messageLinks.add(getModelFactory().
+							createMessageLink(m_diagram,
+							sendActivity.getEndNode(),
+							receiveActivity.getStartNode(),
+							receiveActivity.getReceive()));
+					
+					// Check if the receive and send activities have a link to the
+					// same node, in which case remove the link from the send
+					checkForRedundantTargetLinks(sendActivity, receiveActivity);
+				}
+			}
+		}
+		
+		// Process initiating and initiated performs
+		/* GPB: COMMENT OUT PERFORM LINKS FOR NOW
+		iter = m_initiatingPerforms.keys();
+		
+		while (iter.hasMoreElements()) {
+			String key=(String)iter.nextElement();
+
+			PerformActivity initiatingPerform=(PerformActivity)
+					m_initiatingPerforms.get(key);
+			PerformActivity initiatedPerform=(PerformActivity)
+					m_initiatedPerforms.get(key);
+			
+			if (initiatingPerform != null && initiatedPerform != null) {
+				
+				if (m_performedAsControlLink) {
+					
+					if (m_controlFromInitiatingPerformOnly) {
+						// Break links to the receive node, as control will
+						// be from the initiating participant
+						initiatedPerform.breakLinks();
+					}
+					
+					// Create control flow between the activities
+					Activity activity=getTopLevelActivity();
+					
+					ActivityEdge ret=(ActivityEdge)
+							activity.createEdge(null, UMLPackage.eINSTANCE.getControlFlow());
+					
+					ret.setSource(initiatingPerform.getEndNode());
+					ret.setTarget(initiatedPerform.getStartNode());
+					
+					// Check if the initiating and initiated performs have a link to the
+					// same node, in which case remove the link from the initiating/
+					checkForRedundantTargetLinks(initiatingPerform, initiatedPerform);
+					
+				}
+				
+				if (m_performedAsDependencyLink) {
+					initiatingPerform.getEndNode().createDependency(
+							initiatedPerform.getStartNode());
+				}
+			}
+		}		
+		*/
+		
+		// Delete duplicate pools
+		for (int i=0; i < m_duplicatePools.size(); i++) {
+			BPMNPool pool=(BPMNPool)m_duplicatePools.get(i);
+			getModelFactory().delete(pool.getContainer());
+			getChildStates().remove(pool);
+		}
+		
+		// Draw diagram
+		int cury=0;
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNPool pool=(BPMNPool)getChildStates().get(i);
+			
+			pool.calculatePosition(0, cury);
+			
+			cury += (pool.getHeight()+100);
+		}
+		
+		getModelFactory().saveModel(m_folder+
+				java.io.File.separator+m_name+"."+
+				getModelFactory().getFileExtension(), m_diagram);
+		
+		// Construct notation
+		Object diagramNotation=getNotationFactory().createDiagram(getModelFactory(), m_diagram,
+					getX(), getY(), getWidth(), getHeight());
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNPool pool=(BPMNPool)getChildStates().get(i);
+
+			pool.draw(diagramNotation);	
+		}
+		
+		/* GPB: 25/4/08
+		 * Don't generate message links, as diagram infers them
+		 * anyway - and in the latest version the link positions
+		 * the label incorrectly. If using the default message
+		 * link is an issue, then need to investigate how to
+		 * get label positioned correctly.
+		for (int i=0; i < messageLinks.size(); i++) {
+			Object mesglink=messageLinks.get(i);
+			
+			getNotationFactory().createMessageLink(getModelFactory(),
+								mesglink, diagramNotation);
+		}
+		*/
+
+		getNotationFactory().saveNotation(m_folder+
+				java.io.File.separator+m_name+"."+
+				getModelFactory().getFileExtension(), m_diagram,
+				m_folder+java.io.File.separator+m_name+"."+
+				getNotationFactory().getFileExtension(), diagramNotation);
+	}
+	
+	protected void checkForRedundantTargetLinks(BPMNActivity source, BPMNActivity target) {
+		
+		// Check if the target and source activities have a link to the
+		// same node, in which case remove the link from the source
+		java.util.List outgoing1=getModelFactory().getOutboundControlLinks(target.getStartNode());
+		
+		for (int i=0; i < outgoing1.size(); i++) {
+			Object ae1=outgoing1.get(i);
+			
+			java.util.List outgoing2=getModelFactory().getOutboundControlLinks(source.getStartNode());
+			boolean f_found=false;
+			
+			for (int j=0; f_found==false && j < outgoing2.size(); j++){ 
+				Object ae2=outgoing2.get(j);
+				
+				if (getModelFactory().getTarget(ae1) == 
+							getModelFactory().getTarget(ae2)) {
+					f_found = true;
+					
+					getModelFactory().delete(ae2);
+				}
+			}
+		}
+	}
+		
+	//private boolean m_completed=false;
+	private String m_name=null;
+	private Object m_diagram=null;
+	private String m_folder=null;
+	private Object m_container=null;
+	//private java.util.Hashtable m_pools=new java.util.Hashtable();
+    //private BPMNActivity m_initialState=null;
+    //private BPMNActivity m_finalState=null;
+    private java.util.Hashtable m_sendActivities=new java.util.Hashtable();
+    private java.util.Hashtable m_receiveActivities=new java.util.Hashtable();
+    private java.util.Hashtable m_initiatingPerforms=new java.util.Hashtable();
+    private java.util.Hashtable m_initiatedPerforms=new java.util.Hashtable();
+    
+    private java.util.Hashtable m_pools=new java.util.Hashtable();
+    private java.util.Vector m_duplicatePools=new java.util.Vector();
+    
+    private boolean m_sendReceiveAsControlLink=true;
+    private boolean m_controlFromSendOnly=false;
+    
+    //private boolean m_performedAsControlLink=true;
+    //private boolean m_performedAsDependencyLink=false;
+    //private boolean m_controlFromInitiatingPerformOnly=false;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNPool.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNPool.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/BPMNPool.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2005-6 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 29 Jan 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.BehaviorDescription;
+import org.pi4soa.service.behavior.Choice;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+public class BPMNPool extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the pool state.
+	 * 
+	 * @param diagram The diagram
+	 * @param name The pool name
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public BPMNPool(Object diagram, String name,
+			BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(parent, model, notation);
+		
+		initialize(diagram, name);
+	}
+	
+	/**
+	 * This method performs the initialization of the 
+	 * activity model.
+	 * 
+	 * @param diagram The diagram
+	 * @param name The pool name
+	 */
+	public void initialize(Object diagram, String name) {
+		
+		m_pool = getModelFactory().createPool(diagram, name);
+		
+		/*
+		m_activityModel = (org.eclipse.uml2.uml.Activity)
+			servicePackage.createPackagedElement(null,
+				UMLPackage.eINSTANCE.getActivity());
+	
+		m_activityModel.setName(getName(elem));
+		*/
+
+		// Create initial state
+		/*
+		org.eclipse.uml2.uml.InitialNode initialState=
+				(org.eclipse.uml2.uml.InitialNode)
+				m_activityModel.createNode(null, UMLPackage.eINSTANCE.getInitialNode());
+		
+		m_initialState = new SimpleActivity(initialState, this);
+		*/
+		m_initialState = new JunctionActivity(getModelFactory().createInitialNode(getContainer()),
+				this, getModelFactory(), getNotationFactory());
+		
+		// Create final state
+		/*
+		org.eclipse.uml2.uml.FlowFinalNode finalState=
+					(org.eclipse.uml2.uml.FlowFinalNode)
+				m_activityModel.createNode(null, UMLPackage.eINSTANCE.getFlowFinalNode());
+		
+		m_finalState = new SimpleActivity(finalState, this);
+		*/
+		m_finalState = new JunctionActivity(getModelFactory().createFinalNode(getContainer()),
+				this, getModelFactory(), getNotationFactory());
+		
+	}
+	
+	/**
+	 * This method returns the container associated with the
+	 * activity.
+	 * 
+	 * @return The container
+	 */
+	public Object getContainer() {
+		return(m_pool);
+	}
+		
+	public Object getStartNode() {
+		return(m_initialState.getStartNode());
+	}
+	
+	public Object getEndNode() {
+		return(m_finalState.getEndNode());
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(m_initialState);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(m_finalState);
+	}
+	
+	/**
+	 * This method indicates that the BPMN state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			
+			// Move the final state to the end of the list
+			if (getChildStates().remove(m_finalState)) {
+				getChildStates().add(m_finalState);
+			}
+			
+			// Join the child state vertex with transitions
+			transitionSequentialNodes();
+			
+			// Add padding
+			setHeight(getHeight()+(VERTICAL_GAP*2));
+			
+			m_completed = true;
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		int curx=0;
+		int midy=(getHeight()/2);
+		
+		setX(x);
+		setY(y+VERTICAL_GAP);
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.calculatePosition(curx, midy-(act.getHeight()/2));
+			
+			curx += (act.getWidth()+HORIZONTAL_GAP);
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		Object notation=getNotationFactory().createPool(getModelFactory(), m_pool,
+				parent, getX(), getY(), getWidth(), getHeight());
+		
+		//m_initialState.draw(notation);
+		//m_finalState.draw(notation);
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(notation);
+		}
+	}
+	
+	private boolean m_completed=false;
+	private Object m_pool=null;
+	private BPMNActivity m_initialState=null;
+	private BPMNActivity m_finalState=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ChoiceActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ChoiceActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ChoiceActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,320 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.Choice;
+import org.savara.tools.bpmn.generation.*;
+
+/**
+ * This class represents a selection of states within a
+ * BPMN state machine.
+ *
+ */
+public class ChoiceActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the choice state.
+	 * 
+	 * @param choice The choice
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public ChoiceActivity(Choice choice, BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation)
+						throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		initialize(choice);		
+	}
+
+	/**
+	 * This method performs the initialization of the 
+	 * choice state.
+	 * 
+	 * @param elem The choice
+	 * @throws BPMNGenerationException Failed to initialize
+	 */
+	protected void initialize(Choice elem) throws BPMNGenerationException {
+		
+		// Get region
+		//Activity region=getTopLevelActivity();
+	
+		// Determine if choice is event based, or data based
+		boolean dataBased=true;
+		
+		java.util.List children=elem.getActivityTypes();
+		for (int i=0; i < children.size(); i++) {
+			org.pi4soa.service.behavior.ActivityType act=
+				(org.pi4soa.service.behavior.ActivityType)children.get(i);
+			
+			if (act instanceof org.pi4soa.service.behavior.StructuralType) {
+				org.pi4soa.service.behavior.StructuralType st=
+					(org.pi4soa.service.behavior.StructuralType)act;
+				
+				if ((st.isConditionalGroupingConstruct() == false ||
+						(st.isConditionalGroupingConstruct() &&
+						st.isConditionObservable() == false)) &&
+						st.isPredicateExtensionRequired() == false) {
+					dataBased = false;
+				}
+				
+				/*
+				String expr=null;
+				
+				if (st instanceof org.pi4soa.service.behavior.Conditional) {
+					expr = ((org.pi4soa.service.behavior.Conditional)st).getExpression();
+				} else if (st instanceof org.pi4soa.service.behavior.While) {
+					expr = ((org.pi4soa.service.behavior.While)st).getExpression();
+				} else if (st instanceof org.pi4soa.service.behavior.When) {
+					expr = ((org.pi4soa.service.behavior.When)st).getExpression();
+				}
+				
+				if (expr != null && expr.trim().length() == 0) {
+					expr = "";
+				}
+				
+				m_expressions.add(expr);
+				*/
+			}
+		}
+		
+		// If not data-based, then clear list of expressions
+		/*
+		if (dataBased == false) {
+			m_expressions.clear();
+		}
+		*/
+		
+		// Create choice state
+		Object choiceState=null;
+		
+		if (dataBased) {
+			choiceState=getModelFactory().createDataBasedXORGateway(getContainer());
+		} else {
+			choiceState=getModelFactory().createEventBasedXORGateway(getContainer());
+		}
+		
+			//region.createNode(null, UMLPackage.eINSTANCE.getDecisionNode());
+		//choiceState.getInPartitions().add(getActivityPartition());
+		
+		m_choiceState = new JunctionActivity(choiceState, this,
+				getModelFactory(), getNotationFactory());
+		
+		// Create junction state
+		Object junctionState=null;
+		
+		if (dataBased) {
+			junctionState=getModelFactory().createDataBasedXORGateway(getContainer());
+		} else {
+			junctionState=getModelFactory().createEventBasedXORGateway(getContainer());
+		}
+
+		//region.createNode(null, UMLPackage.eINSTANCE.getMergeNode());
+		//junctionState.getInPartitions().add(getActivityPartition());
+
+		m_junctionState = new JunctionActivity(junctionState, this,
+				getModelFactory(), getNotationFactory());
+	}
+	
+	/**
+	 * This method indicates that the BPMN state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			int width=m_choiceState.getWidth()+m_junctionState.getWidth()+
+						(2 * HORIZONTAL_GAP);
+			int height=0;
+								
+			// Move the junction state to the end of the list
+			if (getChildStates().remove(m_junctionState)) {
+				getChildStates().add(m_junctionState);
+			}
+			
+			// Join the child state vertex with transitions
+			int maxwidth=0;
+			
+			for (int i=1; i < getChildStates().size()-1; i++) {
+				BPMNActivity umls=(BPMNActivity)getChildStates().get(i);
+				
+				height += umls.getHeight();
+				
+				if (i != 1) {
+					height += VERTICAL_GAP;
+				}
+				
+				if (umls.getWidth() > maxwidth) {
+					maxwidth = umls.getWidth();
+				}
+				
+				/*
+				String expr=null;
+				
+				if (m_expressions.size() > 0) {
+					expr = (String)m_expressions.get(i-1);
+					
+					if (expr != null && expr.length() == 0) {
+						expr = null;
+					}
+				}
+				*/
+				
+				umls.transitionFrom(m_choiceState, null);
+				
+				// Check if state is a junction
+				Object endNode=umls.getEndNode();
+				
+				/*
+				if (umls.getEndState().canDeleteEndNode() &&
+						(getModelFactory().isJoin(endNode) || // instanceof org.eclipse.uml2.uml.MergeNode ||
+						getModelFactory().isTerminal(endNode))) { // instanceof org.eclipse.uml2.uml.FlowFinalNode) {
+
+					// Move the incoming transitions from the junction
+					// to the next state
+					java.util.List list=getModelFactory().getInboundControlLinks(endNode);
+					for (int j=list.size()-1; j >= 0; j--) {
+						Object transition=list.get(j);
+						
+						getModelFactory().setTarget(transition, m_junctionState.getStartNode());
+						//transition.setTarget(m_junctionState.getStartNode());
+					}
+					
+					// Remove the junction
+					//endNode.destroy();
+					getModelFactory().delete(endNode);
+				} else {
+				*/
+					m_junctionState.transitionFrom(umls, null);
+				//}
+			}
+			
+			width += maxwidth;
+			
+			if (height < m_choiceState.getHeight()) {
+				height = m_choiceState.getHeight();
+			}
+			
+			if (height < m_junctionState.getHeight()) {
+				height = m_junctionState.getHeight();
+			}
+			
+			setWidth(width);
+			setHeight(height);
+			
+			adjustWidth(width);
+			
+			m_completed = true;
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		int cury=y;
+		int midx=x+(getWidth()/2);
+		int midy=y+(getHeight()/2);
+		
+		setX(x);
+		setY(y);
+		
+		for (int i=1; i < getChildStates().size()-1; i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.calculatePosition(midx-(act.getWidth()/2), cury);
+			//midy-(act.getHeight()/2));
+
+			cury += (act.getHeight()+VERTICAL_GAP);
+		}
+		
+		m_choiceState.calculatePosition(x, midy-(m_choiceState.getHeight()/2));
+		m_junctionState.calculatePosition(x+getWidth()-
+				m_junctionState.getWidth(),
+				midy-(m_junctionState.getHeight()/2));
+	}
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		return(m_choiceState.getStartNode());
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		return(m_junctionState.getEndNode());
+	}
+		
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(m_choiceState);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(m_junctionState);
+	}
+	
+	public void adjustWidth(int width) {
+		
+		int extrawidth=m_choiceState.getWidth()+m_junctionState.getWidth()+
+						(2 * HORIZONTAL_GAP);
+		
+		setWidth(width);
+		
+		// Adjust child widths
+		for (int i=1; i < getChildStates().size()-1; i++) {
+			BPMNActivity umls=(BPMNActivity)getChildStates().get(i);
+			
+			umls.adjustWidth(width-extrawidth);
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+	
+	private boolean m_completed=false;
+    private BPMNActivity m_choiceState=null;
+    private BPMNActivity m_junctionState=null;
+    //private java.util.Vector m_expressions=new java.util.Vector();
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ConditionalActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ConditionalActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ConditionalActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,362 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.Choice;
+import org.pi4soa.service.behavior.Conditional;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+/**
+ * This class represents a conditional decision within a
+ * BPMN state machine.
+ *
+ */
+public class ConditionalActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the conditional state.
+	 * 
+	 * @param conditional The conditional
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public ConditionalActivity(Conditional conditional,
+					BPMNActivity parent,
+					org.savara.tools.bpmn.generation.BPMNModelFactory model,
+					org.savara.tools.bpmn.generation.BPMNNotationFactory notation)
+						throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		initialize(conditional);		
+	}
+
+	/**
+	 * This method performs the initialization of the 
+	 * conditional state.
+	 * 
+	 * @param elem The conditional
+	 * @throws BPMNGenerationException Failed to initialize
+	 */
+	protected void initialize(Conditional elem) throws BPMNGenerationException {
+		m_choiceElement = (elem.getParent() instanceof Choice);
+		
+		// TODO: condition expression causes problem when used as
+		// name
+		m_conditionalDescription = elem.getName();
+		
+		if (org.pi4soa.common.util.NamesUtil.isSet(elem.getExpression())) {
+			m_conditionalExpression = elem.getExpression();
+		}
+		
+		if (isChoiceElement() == false) {
+			
+			// Get region
+			/*
+			Activity region=getTopLevelActivity();
+			
+			// Create choice state
+			ActivityNode choiceState = region.createNode(null,
+						UMLPackage.eINSTANCE.getDecisionNode());
+			choiceState.getInPartitions().add(getActivityPartition());
+			*/
+			Object choiceState=getModelFactory().createDataBasedXORGateway(getContainer());
+			
+			m_choiceState = new JunctionActivity(choiceState, this,
+					getModelFactory(), getNotationFactory());
+			
+			// Create junction state
+			/*
+			ActivityNode junctionState = region.createNode(null,
+					UMLPackage.eINSTANCE.getMergeNode());
+			junctionState.getInPartitions().add(getActivityPartition());
+			 */
+			Object junctionState=getModelFactory().createDataBasedXORGateway(getContainer());
+			
+			m_junctionState = new JunctionActivity(junctionState, this,
+					getModelFactory(), getNotationFactory());
+		}
+	}
+	
+	/**
+	 * This method determines whether the conditional is a
+	 * choice element.
+	 * 
+	 * @return Whether a choice element
+	 */
+	protected boolean isChoiceElement() {
+		return(m_choiceElement);
+	}
+	
+	/**
+	 * This method indicates that the UML state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			
+			if (isChoiceElement() == false) {
+				
+				// Move the junction state to the end of the list
+				if (getChildStates().remove(m_junctionState)) {
+					getChildStates().add(m_junctionState);
+				}
+			}
+			
+			// Join the child state vertex with transitions
+			transitionSequentialNodes();
+			
+			if (isChoiceElement() == false) {
+				
+				// Place the condition on the outgoing transition
+				// from the choice state, before adding the alternate
+				// 'false' path
+				java.util.List list=getModelFactory().getOutboundControlLinks(m_choiceState.getEndNode());
+
+				if (list.size() > 0) {
+					Object outgoing=list.get(0);
+
+					/*
+					org.eclipse.uml2.uml.OpaqueExpression expr=
+						(org.eclipse.uml2.uml.OpaqueExpression)
+						outgoing.createGuard("expression", null,
+							UMLPackage.eINSTANCE.getOpaqueExpression());
+					*/
+					
+					if (m_conditionalExpression != null) {
+						//expr.getBodies().add(m_conditionalExpression);
+						getModelFactory().setLinkExpression(outgoing,
+								m_conditionalExpression);
+					} else {
+						//expr.getBodies().add("<non-observable>");								
+						getModelFactory().setLinkExpression(outgoing,
+								"<non-observable>");
+					}
+				}
+				
+				// Have direct transition from choice to junction
+				// to represent the 'false' path
+				Object transition=
+						m_junctionState.transitionFrom(m_choiceState,
+								"false()");
+				//transition.setName("false");
+				
+				/*
+				org.eclipse.uml2.uml.OpaqueExpression expr=
+					(org.eclipse.uml2.uml.OpaqueExpression)
+					transition.createGuard("expression", null,
+						UMLPackage.eINSTANCE.getOpaqueExpression());
+					
+				expr.getBodies().add("false()");
+				*/
+			}
+						
+			if (isChoiceElement() == false) {
+				int width=0;
+				int height=0;
+				
+				// Calculate extra width
+				/*
+				width = m_junctionState.getWidth()+
+						(HORIZONTAL_GAP*2)+
+						m_choiceState.getWidth();
+				*/
+				
+				height = m_choiceState.getHeight();
+				
+				if (height < m_junctionState.getHeight()) {
+					height = m_junctionState.getHeight();
+				}
+				
+				height += (VERTICAL_GAP*2);
+				
+				setWidth(getWidth()+width);
+				setHeight(getHeight()+height);
+			}
+			
+			m_completed = true;
+		}
+	}
+	
+	/**
+	 * This method causes a transition to be established from
+	 * the supplied BPMN state to the current state, applying
+	 * any relevant information (such as event triggers
+	 * or conditions) to the transition as appropriate.
+	 * 
+	 * @param fromVertex The source vertex
+	 * @return The transition
+	 */
+	public Object transitionFrom(BPMNActivity fromVertex,
+			String conditionalExpression) {
+		Object ret=null;
+		
+		if (isChoiceElement()) {
+			String expr=m_conditionalExpression;
+			
+			if (expr == null) {
+				expr = "<non-observable>";
+			}
+			
+			ret = super.transitionFrom(fromVertex, expr);
+		} else {
+			ret = super.transitionFrom(fromVertex, conditionalExpression);
+		}
+
+		if (ret != null && m_conditionalDescription != null) {
+			String name=m_conditionalDescription.replace(' ', '_');
+			getModelFactory().setLabel(ret, name);
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		Object ret=null;
+		
+		if (isChoiceElement() == false) {
+			ret = m_choiceState.getStartNode();
+			
+		} else if (getChildStates().size() > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(0);
+			ret = state.getStartNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this BPMN activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		Object ret=null;
+		int len=0;
+		
+		if (isChoiceElement() == false) {
+			ret = m_junctionState.getEndNode();
+			
+		} else if ((len=getChildStates().size()) > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(len-1);
+			ret = state.getEndNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		BPMNActivity ret=null;
+		
+		if (isChoiceElement() == false) {
+			ret = m_choiceState;
+			
+		} else if (getChildStates().size() > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(0);
+			ret = state;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		BPMNActivity ret=null;
+		int len=0;
+		
+		if (isChoiceElement() == false) {
+			ret = m_junctionState;
+			
+		} else if ((len=getChildStates().size()) > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(len-1);
+			ret = state;
+		}
+		
+		return(ret);
+	}
+	
+	public void calculatePosition(int x, int y) {
+		if (isChoiceElement()) {
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					act.calculatePosition(x, y);
+				}
+			}
+			
+		} else {
+			int junctionY=y+getHeight()-VERTICAL_GAP;
+			//int junctionY=y+(getHeight()/2);
+			
+			m_choiceState.calculatePosition(x, junctionY-
+					(m_choiceState.getHeight()/2));
+			m_junctionState.calculatePosition(x+getWidth()-
+					m_junctionState.getWidth(), junctionY-
+					(m_junctionState.getHeight()/2));
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					act.calculatePosition(x+
+								m_choiceState.getWidth()+
+								HORIZONTAL_GAP, y);
+				}
+			}
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+	
+	private boolean m_completed=false;
+	private boolean m_choiceElement=false;
+	
+    private BPMNActivity m_choiceState=null;
+    private BPMNActivity m_junctionState=null;
+    private String m_conditionalDescription=null;
+    private String m_conditionalExpression=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/JunctionActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/JunctionActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/JunctionActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+/**
+ * This class represents a junction within a
+ * BPMN process.
+ *
+ */
+public class JunctionActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the junction activity.
+	 * 
+	 * @param node The junction node
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public JunctionActivity(Object node,
+			BPMNActivity parent, org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(parent, model, notation);
+		
+		m_node = node;
+		
+	}
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		return(m_node);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		return(m_node);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(this);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(this);
+	}
+	
+	public int getWidth() {
+		return(30);
+	}
+	
+	public int getHeight() {
+		return(30);
+	}
+	
+	public void draw(Object parent) {
+		
+		if (getModelFactory().isDeleted(m_node) == false) {
+			getNotationFactory().createJunction(getModelFactory(),
+					m_node, parent, getX(), getY(), getWidth(), getHeight());
+		}
+	}
+	
+	private Object m_node=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ParallelActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ParallelActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ParallelActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.Parallel;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+/**
+ * This class represents a parallel grouping of states within a
+ * UML state machine.
+ *
+ */
+public class ParallelActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the parallel state.
+	 * 
+	 * @param parallel The parallel
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public ParallelActivity(Parallel parallel, BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation)
+						throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		initialize(parallel);		
+	}
+
+	/**
+	 * This method performs the initialization of the 
+	 * parallel state.
+	 * 
+	 * @param elem The parallel
+	 * @throws BPMNGenerationException Failed to initialize
+	 */
+	protected void initialize(Parallel elem) throws BPMNGenerationException {
+		
+		// Get region
+		/*
+		Activity region=getTopLevelActivity();
+		
+		// Create parallel state
+		ActivityNode parallelState = region.createNode(null,
+				UMLPackage.eINSTANCE.getForkNode());
+		parallelState.getInPartitions().add(getActivityPartition());
+		*/
+		Object parallelState=getModelFactory().createANDGateway(getContainer());
+		
+		m_forkState = new JunctionActivity(parallelState, this,
+				getModelFactory(), getNotationFactory());
+		
+		// Create join state
+		/*
+		ActivityNode joinState = region.createNode(null,
+				UMLPackage.eINSTANCE.getJoinNode());
+		joinState.getInPartitions().add(getActivityPartition());
+		*/
+		
+		Object joinState=getModelFactory().createANDGateway(getContainer());
+		
+		m_joinState = new JunctionActivity(joinState, this,
+				getModelFactory(), getNotationFactory());
+	}
+	
+	/**
+	 * This method indicates that the UML state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			int width=m_forkState.getWidth()+m_joinState.getWidth()+
+							(2 * HORIZONTAL_GAP);
+			int height=0;
+			
+			// Move the junction state to the end of the list
+			if (getChildStates().remove(m_joinState)) {
+				getChildStates().add(m_joinState);
+			}
+			
+			// Join the child state vertex with transitions
+			int maxwidth=0;
+
+			for (int i=1; i < getChildStates().size()-1; i++) {
+				BPMNActivity umls=(BPMNActivity)getChildStates().get(i);
+				
+				height += (umls.getHeight()+VERTICAL_GAP);
+				
+				if (umls.getWidth() > maxwidth) {
+					maxwidth = umls.getWidth();
+				}
+
+				umls.transitionFrom(m_forkState, null);
+				
+				// Check if state is a junction
+				Object endNode=umls.getEndNode();
+				
+				/* Do not remove endpoint junctions from
+				 * parallel elements, as this can cause issues
+				 * with layout
+				if (getModelFactory().isJoin(endNode) || // instanceof org.eclipse.uml2.uml.MergeNode ||
+						getModelFactory().isTerminal(endNode)) { // instanceof org.eclipse.uml2.uml.FlowFinalNode) {
+
+					// Move the incoming transitions from the junction
+					// to the next state
+					java.util.List list=getModelFactory().getInboundControlLinks(endNode);
+					for (int j=list.size()-1; j >= 0; j--) {
+						Object transition=list.get(j);
+						
+						getModelFactory().setTarget(transition,
+								m_joinState.getStartNode());
+					}
+					
+					// Remove the junction
+					getModelFactory().delete(endNode);
+				} else {
+				*/
+					m_joinState.transitionFrom(umls, null);
+				//}
+			}
+			
+			width += maxwidth;
+			
+			if (height >= HORIZONTAL_GAP) {
+				height -= HORIZONTAL_GAP;
+			}
+			
+			if (height < m_forkState.getHeight()) {
+				height = m_forkState.getHeight();
+			}
+			
+			if (height < m_joinState.getHeight()) {
+				height = m_joinState.getHeight();
+			}
+			
+			setWidth(width);
+			setHeight(height);
+
+			adjustWidth(width);
+			
+			m_completed = true;
+		}
+	}
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		return(m_forkState.getStartNode());
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		return(m_joinState.getEndNode());
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(m_forkState);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(m_joinState);
+	}
+	
+	public void adjustWidth(int width) {
+		int extrawidth=m_forkState.getWidth()+m_joinState.getWidth()+
+						(2 * HORIZONTAL_GAP);
+		
+		setWidth(width);
+		
+		// Adjust child widths
+		for (int i=1; i < getChildStates().size()-1; i++) {
+			BPMNActivity umls=(BPMNActivity)getChildStates().get(i);
+			
+			umls.adjustWidth(width-extrawidth);
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		int cury=y;
+		int midx=x+(getWidth()/2);
+		int midy=y+(getHeight()/2);
+		
+		setX(x);
+		setY(y);
+		
+		for (int i=1; i < getChildStates().size()-1; i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.calculatePosition(midx-(act.getWidth()/2), cury);
+			//midy-(act.getHeight()/2));
+
+			cury += (act.getHeight()+VERTICAL_GAP);
+		}
+		
+		m_forkState.calculatePosition(x, midy);
+		m_joinState.calculatePosition(x+getWidth()-
+				m_joinState.getWidth(), midy);
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+
+	private boolean m_completed=false;
+    private BPMNActivity m_forkState=null;
+    private BPMNActivity m_joinState=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/PerformActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/PerformActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/PerformActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+/**
+ * This class represents the BPMN activity node for a Perform activity.
+ * 
+ */
+public class PerformActivity extends SimpleActivity {
+
+	/**
+	 * This constructor initializes the receive state.
+	 * 
+	 * @param act The behavioral activity
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public PerformActivity(org.pi4soa.service.behavior.ActivityType act,
+			BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(act, parent, model, notation);
+	}
+	
+	/**
+	 * This method causes the receive activity to break any
+	 * existing control links, including removing preceeding
+	 * nodes that only have these links as their outgoing
+	 * links.
+	 *
+	 */
+	public void breakLinks() {
+		Object node=getStartNode();
+		
+		java.util.List list=getModelFactory().getInboundControlLinks(node);
+		
+		for (int i=list.size()-1; i >= 0; i--) {
+			Object edge=list.get(i);
+			
+			tidyUpEdge(edge);
+		}
+ 	}
+	
+	/**
+	 * This method tidies up an activity edge, recursively being
+	 * called if its source node only has a single incoming
+	 * activity edge.
+	 * 
+	 * @param edge The activity edge
+	 */
+	protected void tidyUpEdge(Object edge) {
+		
+		// Check if source node has only a single incoming link
+		// and if so, then remove the node
+		Object sourceNode=getModelFactory().getSource(edge);
+		
+		getModelFactory().delete(edge);
+		
+		// If has less than 2 incoming links and no
+		// outgoing link, then tidyup node and links recursively
+		if (getModelFactory().getInboundControlLinks(sourceNode).size() <= 1 &&
+				getModelFactory().getOutboundControlLinks(sourceNode).size() == 0 &&
+				(getModelFactory().isDecision(sourceNode) ||	// was decision node
+					getModelFactory().isJoin(sourceNode))) {	// was merge node
+			if (getModelFactory().getInboundControlLinks(sourceNode).size() == 1) {
+				Object actedge=getModelFactory().
+						getInboundControlLinks(sourceNode).get(0);
+				
+				tidyUpEdge(actedge);
+			}
+			
+			getModelFactory().delete(sourceNode);
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ReceiveActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ReceiveActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/ReceiveActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+/**
+ * This class represents the UML activity node for a Receive activity.
+ * 
+ */
+public class ReceiveActivity extends SimpleActivity {
+
+	/**
+	 * This constructor initializes the receive state.
+	 * 
+	 * @param act The behavioral activity
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public ReceiveActivity(org.pi4soa.service.behavior.Receive act,
+			BPMNActivity parent, org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(act, parent, model, notation);
+		
+		m_receive = act;
+	}
+	
+	/**
+	 * This method returns the behavioral receive activity.
+	 * 
+	 * @return The receive activity
+	 */
+	public org.pi4soa.service.behavior.Receive getReceive() {
+		return(m_receive);
+	}
+	
+	/**
+	 * This method causes the receive activity to break any
+	 * existing control links, including removing preceeding
+	 * nodes that only have these links as their outgoing
+	 * links.
+	 *
+	 */
+	public void breakLinks() {
+		Object node=getStartNode();
+		
+		java.util.List list=getModelFactory().getInboundControlLinks(node);
+		
+		for (int i=list.size()-1; i >= 0; i--) {
+			Object edge=list.get(i);
+			
+			tidyUpEdge(edge);
+		}
+ 	}
+	
+	/**
+	 * This method tidies up an activity edge, recursively being
+	 * called if its source node only has a single incoming
+	 * activity edge.
+	 * 
+	 * @param edge The activity edge
+	 */
+	protected void tidyUpEdge(Object edge) {
+		
+		// Check if source node has only a single incoming link
+		// and if so, then remove the node
+		Object sourceNode=getModelFactory().getSource(edge);
+		
+		getModelFactory().delete(edge);
+		
+		// If has less than 2 incoming links and no
+		// outgoing link, then tidyup node and links recursively
+		if (getModelFactory().getInboundControlLinks(sourceNode).size() <= 1 &&
+				getModelFactory().getOutboundControlLinks(sourceNode).size() == 0 &&
+				(getModelFactory().isDecision(sourceNode) ||	// was decision node
+					getModelFactory().isJoin(sourceNode))) {	// was merge node
+			if (getModelFactory().getInboundControlLinks(sourceNode).size() == 1) {
+				Object actedge=getModelFactory().
+						getInboundControlLinks(sourceNode).get(0);
+				
+				tidyUpEdge(actedge);
+			}
+			
+			getModelFactory().delete(sourceNode);
+		}
+	}
+	
+	private org.pi4soa.service.behavior.Receive m_receive=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SequenceActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SequenceActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SequenceActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+//import org.pi4soa.service.behavior.Sequence;
+
+/**
+ * This class represents a sequence of states within a
+ * UML state machine.
+ *
+ */
+public class SequenceActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the sequence state.
+	 * 
+	 * @param sequence The sequence
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public SequenceActivity(org.pi4soa.service.behavior.ActivityType sequence, 
+			BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(parent, model, notation);
+		
+		//addChildState(new SimpleState(null, this));
+		//addChildState(new SimpleState(null, this));
+	}
+
+	/**
+	 * This method indicates that the UML state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			
+			// Join the child state vertex with transitions
+			/*
+			for (int i=1; i < getChildStates().size(); i++) {
+				UMLState v1=(UMLState)getChildStates().get(i-1);
+				UMLState v2=(UMLState)getChildStates().get(i);
+				
+				v2.transitionFrom(v1);
+			}
+			*/
+			transitionSequentialNodes();
+			
+			m_completed = true;
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		int curx=x;
+		int midy=y+(getHeight()/2);
+		
+		setX(x);
+		setY(y);
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.calculatePosition(curx, midy-(act.getHeight()/2));
+			
+			curx += (act.getWidth()+HORIZONTAL_GAP);
+		}
+	}
+	
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		Object ret=null;
+		
+		if (getChildStates().size() > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(0);
+			ret = state.getStartNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		Object ret=null;
+		int len=0;
+		
+		if ((len=getChildStates().size()) > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(len-1);
+			ret = state.getEndNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		BPMNActivity ret=null;
+		
+		if (getChildStates().size() > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(0);
+			ret = state;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		BPMNActivity ret=null;
+		int len=0;
+		
+		if ((len=getChildStates().size()) > 0) {
+			BPMNActivity state=(BPMNActivity)getChildStates().get(len-1);
+			ret = state.getEndState();
+		}
+		
+		return(ret);
+	}
+	
+	public void adjustWidth(int width) {
+		float percentChange=((float)width)/((float)getWidth());
+		
+		//setWidth(width);
+		
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			int cur=act.getWidth();
+			int newWidth=(int)((float)cur * percentChange);
+			
+			act.adjustWidth(newWidth);
+			
+			int change=act.getWidth()-cur;
+			
+			setWidth(getWidth()+change);
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+	
+	private boolean m_completed=false;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SimpleActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SimpleActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/SimpleActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+/**
+ * This class represents a simple task within a
+ * BPMN process.
+ *
+ */
+public class SimpleActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the simple activity.
+	 * 
+	 * @param act The behavioral activity
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public SimpleActivity(org.pi4soa.service.behavior.ActivityType act,
+			BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation) {
+		super(parent, model, notation);
+		
+		// Create a state
+		/*
+		Activity region=getTopLevelActivity();
+		
+		if (region != null) {
+			m_node = (ActivityNode)
+				region.createNode(null, UMLPackage.eINSTANCE.getCallBehaviorAction());
+			m_node.getInPartitions().add(getActivityPartition());
+			
+			if (label != null) {
+				m_node.setName(label);
+			}
+		}
+		*/
+		m_node = model.createSimpleTask(getContainer(), act);
+		
+	}
+	
+	/**
+	 * Internal constructor which can be used to wrap a vertex.
+	 * 
+	 * @param vertex The vertex
+	 * @param parent The parent state
+	 */
+	/*
+	protected SimpleActivity(org.eclipse.uml2.uml.ActivityNode node, BPMNActivity parent) {
+		super(parent);
+		
+		m_node = node;
+	}
+	*/
+	
+	/**
+	 * This method sets the association between this state and
+	 * the sub-state machine that it represents.
+	 * 
+	 * @param subMachine The sub state machine
+	 */
+	/*
+	public void setSubStateMachine(ActivityModel subMachine) {
+		
+		((State)m_node).setSubmachine(subMachine.getStateMachine());
+	}
+	*/
+
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		return(m_node);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		return(m_node);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		return(this);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(this);
+	}
+	
+	public int getWidth() {
+		return(m_width);
+	}
+	
+	public int getHeight() {
+		return(60);
+	}
+	
+	public void adjustWidth(int width) {
+		m_width = width;
+	}
+	
+	public void draw(Object parent) {
+		getNotationFactory().createTask(getModelFactory(),
+				m_node, parent, getX(), getY(), getWidth(), getHeight());
+	}
+	
+	private Object m_node=null;
+	private int m_width=110;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhenActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhenActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhenActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,387 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.When;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+/**
+ * This class represents a when activity within a
+ * UML state machine.
+ *
+ */
+public class WhenActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the when state.
+	 * 
+	 * @param when The when
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public WhenActivity(When when, BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation)
+					throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		initialize(when);		
+	}
+
+	/**
+	 * This method performs the initialization of the 
+	 * when's state.
+	 * 
+	 * @param elem The when
+	 * @throws BPMNGenerationException Failed to initialize
+	 */
+	protected void initialize(When elem) throws BPMNGenerationException {
+		
+		if (org.pi4soa.common.util.NamesUtil.isSet(elem.getExpression())) {
+			m_conditionalExpression = elem.getExpression();
+		}
+
+		if (org.pi4soa.common.util.NamesUtil.isSet(elem.getReEvaluateExpression())) {
+			m_repeatExpression = elem.getReEvaluateExpression();
+		}
+				
+		// Get region
+		/*
+		Activity region=getTopLevelActivity();
+		
+		ActivityNode initialState = region.createNode(null,
+				UMLPackage.eINSTANCE.getCallBehaviorAction());
+		initialState.setName(UMLGenerationUtil.processName("When "+elem.getName()));
+		initialState.getInPartitions().add(getActivityPartition());
+		m_initialState = new SimpleActivity(initialState, this);
+		*/
+
+		m_initialState = new SimpleActivity(elem, this, getModelFactory(),
+				getNotationFactory());
+
+		// Only create end choice if there is a possibility of repeating
+		if (m_repeatExpression != null) {
+			/*
+			ActivityNode endChoiceState = region.createNode(null,
+					UMLPackage.eINSTANCE.getDecisionNode());
+			endChoiceState.getInPartitions().add(getActivityPartition());
+			
+			m_endChoiceState = new SimpleActivity(endChoiceState, this);
+			*/
+			
+			Object endChoiceState=getModelFactory().createDataBasedXORGateway(getContainer());
+			
+			m_endChoiceState = new JunctionActivity(endChoiceState, this,
+					getModelFactory(), getNotationFactory());
+
+			// Create junction state
+			Object junctionState=getModelFactory().createFinalNode(getContainer());
+			
+			m_junctionState = new JunctionActivity(junctionState, this,
+					getModelFactory(), getNotationFactory());
+		}
+	}
+	
+	/**
+	 * This method indicates that the UML state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			
+			// Move the end choice state to the end of the list
+			if (m_endChoiceState != null &&
+					getChildStates().remove(m_endChoiceState)) {
+				getChildStates().add(m_endChoiceState);
+			}
+			
+			// Move the junction state to the end of the list
+			boolean junctionRemoved=false;
+			
+			if (m_junctionState != null) {
+				junctionRemoved = getChildStates().remove(m_junctionState);
+			}
+
+			// If no repeat condition, then include junction before
+			// setting up sequential transitions
+			if (junctionRemoved && m_repeatExpression == null) {
+				getChildStates().add(m_junctionState);				
+			}
+			
+			// Join the child state vertex with transitions
+			// Don't join the endChoice and junction states here
+			transitionSequentialNodes();
+			
+			/*
+			java.util.List list=m_initialState.getEndNode().getOutgoings();
+			
+			if (list.size() > 0) {
+				ActivityEdge transition=(ActivityEdge)list.get(0);
+				
+				org.eclipse.uml2.uml.OpaqueExpression expr=
+					(org.eclipse.uml2.uml.OpaqueExpression)
+					transition.createGuard("expression", null,
+							UMLPackage.eINSTANCE.getOpaqueExpression());
+				
+				if (m_conditionalExpression != null) {
+					expr.getBodies().add(m_conditionalExpression);
+				} else {
+					expr.getBodies().add("<non-observable>");				
+				}
+			}
+			*/
+			java.util.List list=getModelFactory().getOutboundControlLinks(m_initialState.getEndNode());
+
+			if (list.size() > 0) {
+				Object outgoing=list.get(0);
+
+				if (m_conditionalExpression != null) {
+					getModelFactory().setLinkExpression(outgoing,
+							m_conditionalExpression);
+				} else {
+					getModelFactory().setLinkExpression(outgoing,
+							"<non-observable>");
+				}
+			}
+			
+			// Junction is re-added after setting up the sequential transitions,
+			// so that it is not sequentially transitioned - only transition
+			// to the junction state based on an appropriate condition
+			// evaluation
+			if (junctionRemoved && m_repeatExpression != null) {
+				getChildStates().add(m_junctionState);				
+			}
+			
+			// Transition from end choice state to start vertex
+			// to represent the loop back
+			if (m_repeatExpression != null) {
+				/*
+				ActivityEdge loopback=
+					m_initialState.transitionFrom(m_endChoiceState);
+				
+				org.eclipse.uml2.uml.OpaqueExpression expr=
+					(org.eclipse.uml2.uml.OpaqueExpression)
+					loopback.createGuard("expression", null,
+						UMLPackage.eINSTANCE.getOpaqueExpression());
+				
+				expr.getBodies().add(m_repeatExpression);
+				*/
+				m_initialState.transitionFrom(m_endChoiceState,
+							m_repeatExpression);				
+								
+				// Transition from end choice state to junction, to
+				// represent the situation where the loopback does
+				// not occur
+				/*
+				ActivityEdge whenEnd=
+					m_junctionState.transitionFrom(m_endChoiceState);
+	
+				expr = (org.eclipse.uml2.uml.OpaqueExpression)
+						whenEnd.createGuard("expression", null,
+						UMLPackage.eINSTANCE.getOpaqueExpression());
+				
+				expr.getBodies().add("false()");
+				*/
+				m_junctionState.transitionFrom(m_endChoiceState,
+						"false()");
+			}
+			
+			int width=0;
+			int height=0;
+			
+			// Calculate extra width
+			if (m_junctionState != null) {
+				width = m_junctionState.getWidth()+HORIZONTAL_GAP;
+			
+				height = m_initialState.getHeight();
+				
+				if (m_junctionState != null &&
+						height < m_junctionState.getHeight()) {
+					height = m_junctionState.getHeight();
+				}
+				
+				height += (VERTICAL_GAP*2);
+				
+				if (m_endChoiceState != null) {
+					height += m_endChoiceState.getHeight()+VERTICAL_GAP;
+				}
+				
+				setWidth(getWidth()+width);
+				setHeight(getHeight()+height);
+			}
+
+			m_completed = true;
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		
+		if (m_junctionState == null) {
+			int curx=x;
+			int midy=y+(getHeight()/2);
+			
+			setX(x);
+			setY(y);
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				act.calculatePosition(curx, midy-(act.getHeight()/2));
+				
+				curx += (act.getWidth()+HORIZONTAL_GAP);
+			}
+		} else {
+		/*
+		if (isChoiceElement()) {
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					act.calculatePosition(x, y);
+				}
+			}
+			
+		} else {
+		*/
+			int junctionY=y+getHeight()-VERTICAL_GAP;
+			//int junctionY=y+(getHeight()/2);
+			int extraY=0;
+			
+			m_initialState.calculatePosition(x, junctionY-
+					(m_initialState.getHeight()/2));
+			
+			if (m_junctionState != null) {
+				m_junctionState.calculatePosition(x+getWidth()-
+						m_junctionState.getWidth(), junctionY-
+						(m_junctionState.getHeight()/2));
+			}
+			
+			if (m_endChoiceState != null) {
+				m_endChoiceState.calculatePosition(x+getWidth()-
+//						m_junctionState.getWidth(), y);
+						m_junctionState.getWidth()-
+						HORIZONTAL_GAP, junctionY-
+						(m_junctionState.getHeight()/2));
+				//extraY = m_endChoiceState.getHeight()+VERTICAL_GAP;
+			}
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					act.calculatePosition(x+
+								m_initialState.getWidth()+
+								HORIZONTAL_GAP, y+extraY);
+				}
+			}
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		Object ret=null;
+		BPMNActivity state=getStartState();
+		
+		if (state != null) {
+			ret = state.getStartNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		BPMNActivity ret=null;
+		
+		if (getChildStates().size() > 0) {
+			ret = (BPMNActivity)getChildStates().get(0);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		BPMNActivity ret=null;
+		
+		if (m_junctionState != null) {
+			ret = m_junctionState;
+		} else if (getChildStates().size() > 0) {
+			BPMNActivity act=(BPMNActivity)
+					getChildStates().get(getChildStates().size()-1);
+			ret = act;
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		Object ret=null;
+		
+		if (m_junctionState != null) {
+			ret = m_junctionState.getEndNode();
+		} else if (getChildStates().size() > 0) {
+			BPMNActivity act=(BPMNActivity)
+					getChildStates().get(getChildStates().size()-1);
+			ret = act.getEndNode();
+		}
+		
+		return(ret);
+	}
+	
+	private boolean m_completed=false;
+	
+    private BPMNActivity m_initialState=null;
+    private BPMNActivity m_endChoiceState=null;
+    private BPMNActivity m_junctionState=null;
+    private String m_conditionalExpression=null;    
+    private String m_repeatExpression=null;    
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhileActivity.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhileActivity.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/components/WhileActivity.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,472 @@
+/*
+ * Copyright 2005-7 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Jan 25, 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.components;
+
+import org.pi4soa.service.behavior.Choice;
+import org.pi4soa.service.behavior.While;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+/**
+ * This class represents a while repetition within a
+ * UML state machine.
+ *
+ */
+public class WhileActivity extends AbstractBPMNActivity {
+
+	/**
+	 * This constructor initializes the while state.
+	 * 
+	 * @param while The while
+	 * @param parent The parent BPMN state
+	 * @param model The BPMN model
+	 */
+	public WhileActivity(While whileElem, BPMNActivity parent,
+			org.savara.tools.bpmn.generation.BPMNModelFactory model,
+			org.savara.tools.bpmn.generation.BPMNNotationFactory notation)
+					throws BPMNGenerationException {
+		super(parent, model, notation);
+		
+		initialize(whileElem);		
+	}
+
+	/**
+	 * This method performs the initialization of the 
+	 * whiles state.
+	 * 
+	 * @param elem The while
+	 * @throws BPMNGenerationException Failed to initialize
+	 */
+	protected void initialize(While elem) throws BPMNGenerationException {
+		m_choiceElement = (elem.getParent() instanceof Choice);
+
+		m_conditionalDescription = elem.getName();
+		
+		if (org.pi4soa.common.util.NamesUtil.isSet(elem.getExpression())) {
+			m_conditionalExpression = elem.getExpression();
+		}
+
+		if (org.pi4soa.common.util.NamesUtil.isSet(elem.getReEvaluateExpression()) &&
+				elem.getReEvaluateExpression().equals("true()") == false) {
+			m_repeatExpression = elem.getReEvaluateExpression();
+			
+			if (isChoiceElement() && m_conditionalExpression != null) {
+				m_repeatExpression += " and "+m_conditionalExpression;
+			}
+		} else if (isChoiceElement() && m_conditionalExpression != null) {
+			m_repeatExpression = m_conditionalExpression;
+		}
+		
+		// Get region
+		//Activity region=getTopLevelActivity();
+		
+		if (isChoiceElement() == false) {
+			
+			// Create choice state
+			/*
+			ActivityNode choiceState = region.createNode(null,
+					UMLPackage.eINSTANCE.getDecisionNode());
+			choiceState.getInPartitions().add(getActivityPartition());
+			
+			m_initialChoiceState = new SimpleActivity(choiceState, this);
+			*/
+			Object choiceState=getModelFactory().createDataBasedXORGateway(getContainer());
+			
+			m_initialChoiceState = new JunctionActivity(choiceState, this,
+					getModelFactory(), getNotationFactory());
+		}
+				
+		if (m_repeatExpression != null) {
+			/*
+			ActivityNode endChoiceState = region.createNode(null,
+					UMLPackage.eINSTANCE.getDecisionNode());
+			endChoiceState.getInPartitions().add(getActivityPartition());
+			
+			m_endChoiceState = new SimpleActivity(endChoiceState, this);
+			*/
+			Object endChoiceState=getModelFactory().createDataBasedXORGateway(getContainer());
+			
+			m_endChoiceState = new JunctionActivity(endChoiceState, this,
+					getModelFactory(), getNotationFactory());
+		}
+
+		// Create junction state
+		/*
+		ActivityNode junctionState = region.createNode(null,
+				UMLPackage.eINSTANCE.getMergeNode());
+		junctionState.getInPartitions().add(getActivityPartition());
+		
+		m_junctionState = new SimpleActivity(junctionState, this);
+		*/
+		Object junctionState=getModelFactory().createDataBasedXORGateway(getContainer());
+		
+		m_junctionState = new JunctionActivity(junctionState, this,
+				getModelFactory(), getNotationFactory());
+	}
+	
+	/**
+	 * This method determines whether the conditional is a
+	 * choice element.
+	 * 
+	 * @return Whether a choice element
+	 */
+	protected boolean isChoiceElement() {
+		return(m_choiceElement);
+	}
+	
+	/**
+	 * This method indicates that the UML state for the
+	 * child nodes is complete.
+	 *
+	 */
+	public void childrenComplete() {
+		
+		if (m_completed == false) {
+			
+			// Move the end choice state to the end of the list
+			if (m_endChoiceState != null &&
+					getChildStates().remove(m_endChoiceState)) {
+				getChildStates().add(m_endChoiceState);
+			}
+			
+			// Move the junction state to the end of the list
+			boolean junctionRemoved=getChildStates().remove(m_junctionState);
+			
+			// Join the child state vertex with transitions
+			// Don't join the endChoice and junction states here
+			transitionSequentialNodes();
+			
+			// Label the expression on the choice outgoing link
+			/*
+			java.util.List list=
+				m_initialChoiceState.getEndNode().getOutgoings();
+			if (list != null && list.size() > 0) {
+				ActivityEdge t=(ActivityEdge)list.get(0);
+				
+				if (t != null && m_conditionalDescription != null) {
+					String name=m_conditionalDescription.replace(' ', '_');
+					t.setName(name);
+					
+					org.eclipse.uml2.uml.OpaqueExpression expr=
+						(org.eclipse.uml2.uml.OpaqueExpression)
+						t.createGuard("expression", null,
+							UMLPackage.eINSTANCE.getOpaqueExpression());
+						
+					if (m_conditionalExpression != null) {
+						expr.getBodies().add(m_conditionalExpression);
+					} else {
+						expr.getBodies().add("<non-observable>");
+					}
+				}
+			}
+			*/
+			
+			if (m_initialChoiceState != null) {
+				java.util.List list=getModelFactory().getOutboundControlLinks(m_initialChoiceState.getEndNode());
+	
+				if (list.size() > 0) {
+					Object outgoing=list.get(0);
+	
+					if (m_conditionalExpression != null) {
+						getModelFactory().setLinkExpression(outgoing,
+								m_conditionalExpression);
+					} else {
+						getModelFactory().setLinkExpression(outgoing,
+								"<non-observable>");
+					}
+				}
+			}
+			
+			// Junction is re-added after setting up the sequential transitions,
+			// so that it is not sequentially transitioned - only transition
+			// to the junction state based on an appropriate condition
+			// evaluation
+			BPMNActivity lastState=(BPMNActivity)getChildStates().
+								get(getChildStates().size()-1);
+			
+			if (junctionRemoved) {
+				getChildStates().add(m_junctionState);				
+			}
+
+			if (isChoiceElement() == false) {
+				
+				// Have direct transition from choice to junction
+				// to represent the 'false' path
+				/*
+				ActivityEdge transition=
+						m_junctionState.transitionFrom(m_initialChoiceState);
+				//transition.setName("false");
+			
+				org.eclipse.uml2.uml.OpaqueExpression expr=
+					(org.eclipse.uml2.uml.OpaqueExpression)
+					transition.createGuard("expression", null,
+						UMLPackage.eINSTANCE.getOpaqueExpression());
+				
+				expr.getBodies().add("false()");
+				*/
+				m_junctionState.transitionFrom(m_initialChoiceState,
+						"false()");
+			}
+			
+			if (m_repeatExpression != null) {
+				// Transition from end choice state to start vertex
+				// to represent the loop back
+				/*
+				ActivityEdge loopback=
+					getStartState().transitionFrom(m_endChoiceState);
+				
+				if (loopback != null && m_repeatExpression != null) {
+					org.eclipse.uml2.uml.OpaqueExpression expr=
+						(org.eclipse.uml2.uml.OpaqueExpression)
+						loopback.createGuard("expression", null,
+							UMLPackage.eINSTANCE.getOpaqueExpression());
+					
+					expr.getBodies().add(m_repeatExpression);
+				}
+				*/
+				
+				getStartState().transitionFrom(m_endChoiceState,
+						m_repeatExpression != null?
+							m_repeatExpression:"<non-observable>");
+				
+				// Transition from end choice state to junction, to
+				// represent the situation where the loopback does
+				// not occur
+				/*
+				ActivityEdge whileEnd=
+					m_junctionState.transitionFrom(m_endChoiceState);
+				
+				org.eclipse.uml2.uml.OpaqueExpression expr=
+					(org.eclipse.uml2.uml.OpaqueExpression)
+					whileEnd.createGuard("expression", null,
+						UMLPackage.eINSTANCE.getOpaqueExpression());
+				
+				expr.getBodies().add("false()");
+				*/
+				m_junctionState.transitionFrom(m_endChoiceState,
+						"false()");
+			} else {
+				// Establish transition from last state to initial choice
+				//m_initialChoiceState.transitionFrom(lastState, null);
+				getStartState().transitionFrom(lastState, null);
+				
+				if (isChoiceElement()) {
+					m_junctionState.transitionFrom(lastState,
+								"false()");
+				}
+			}
+			
+			if (isChoiceElement() == false) {
+				int width=0;
+				int height=0;
+				
+				// Calculate extra width
+				width = m_initialChoiceState.getWidth()+HORIZONTAL_GAP+
+						m_junctionState.getWidth()+HORIZONTAL_GAP;
+				
+				height = m_initialChoiceState.getHeight();
+				
+				if (height < m_junctionState.getHeight()) {
+					height = m_junctionState.getHeight();
+				}
+				
+				height += (VERTICAL_GAP*2);
+				
+				if (m_endChoiceState != null) {
+					height += m_endChoiceState.getHeight()+VERTICAL_GAP;
+				}
+				
+				setWidth(getWidth()+width);
+				setHeight(getHeight()+height);
+			} else {
+				
+				int width=0;
+				int height=0;
+				
+				// Calculate extra width
+				width = m_junctionState.getWidth()+HORIZONTAL_GAP;
+				
+				setWidth(getWidth()+width);
+			}
+			
+			m_completed = true;
+		}
+	}
+	
+	public void calculatePosition(int x, int y) {
+		int junctionY=y+getHeight()-VERTICAL_GAP;
+		
+		if (isChoiceElement()) {
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					act.calculatePosition(x, y);
+				}
+			}
+			
+			m_junctionState.calculatePosition(x+getWidth()-
+					m_junctionState.getWidth(), junctionY-
+					(m_junctionState.getHeight()/2));
+			
+			if (m_endChoiceState != null) {
+				m_endChoiceState.calculatePosition(x+getWidth()-
+					m_junctionState.getWidth()-HORIZONTAL_GAP-
+					m_endChoiceState.getWidth(),
+					junctionY-m_endChoiceState.getHeight()-
+					(VERTICAL_GAP/2));
+				//extraY = m_endChoiceState.getHeight()+VERTICAL_GAP;
+			}
+			
+		} else {
+			//int junctionY=y+(getHeight()/2);
+			int extraY=0;
+			
+			m_initialChoiceState.calculatePosition(x, junctionY-
+					(m_initialChoiceState.getHeight()/2));
+			m_junctionState.calculatePosition(x+getWidth()-
+					m_junctionState.getWidth(), junctionY-
+					(m_junctionState.getHeight()/2));
+			
+			if (m_endChoiceState != null) {
+				m_endChoiceState.calculatePosition(x+getWidth()-
+					m_junctionState.getWidth()-HORIZONTAL_GAP-
+					m_endChoiceState.getWidth(),
+					junctionY-m_endChoiceState.getHeight()-
+					(VERTICAL_GAP/2));
+				//extraY = m_endChoiceState.getHeight()+VERTICAL_GAP;
+			}
+			
+			SequenceActivity seq=null;
+			
+			for (int i=0; i < getChildStates().size(); i++) {
+				BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+				
+				if (act instanceof SequenceActivity) {
+					seq = (SequenceActivity)act;
+					
+					//act.calculatePosition(x+
+					//		m_initialChoiceState.getWidth()+
+					//		HORIZONTAL_GAP, y+extraY);
+					int gap=(VERTICAL_GAP/4);
+					
+					if (m_endChoiceState != null) {
+						gap = VERTICAL_GAP;
+					}
+					
+					act.calculatePosition(x+
+							m_initialChoiceState.getWidth()+
+							HORIZONTAL_GAP, junctionY-
+							act.getHeight()-gap);
+				}
+			}
+			
+			// If a normal expression, then move the end
+			// node of the last child, to help with layout
+			if (m_endChoiceState == null && seq.getChildStates().size() > 0) {
+				BPMNActivity lastState=(BPMNActivity)seq.getEndState();
+				
+				lastState.calculatePosition(x+getWidth()-
+						lastState.getWidth()-HORIZONTAL_GAP-
+						m_junctionState.getWidth(),
+						junctionY-lastState.getHeight()-
+						(VERTICAL_GAP/2));
+			}
+		}
+	}
+	
+	public void draw(Object parent) {
+		
+		// Construct notation
+		for (int i=0; i < getChildStates().size(); i++) {
+			BPMNActivity act=(BPMNActivity)getChildStates().get(i);
+			
+			act.draw(parent);
+		}
+	}
+
+	/**
+	 * This method returns the start node for the activites
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The starting node
+	 */
+	public Object getStartNode() {
+		Object ret=null;
+		BPMNActivity state=getStartState();
+		
+		if (state != null) {
+			ret = state.getStartNode();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the start state.
+	 * 
+	 * @return The start state
+	 */
+	public BPMNActivity getStartState() {
+		BPMNActivity ret=null;
+		
+		if (isChoiceElement() == false) {
+			ret = m_initialChoiceState;
+			
+		} else if (getChildStates().size() > 0) {
+			ret = (BPMNActivity)getChildStates().get(0);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the end state.
+	 * 
+	 * @return The end state
+	 */
+	public BPMNActivity getEndState() {
+		return(m_junctionState);
+	}
+	
+	/**
+	 * This method returns the end node for the activities
+	 * represented by this UML activity implementation.
+	 * 
+	 * @return The ending node
+	 */
+	public Object getEndNode() {
+		return(m_junctionState.getEndNode());
+	}
+	
+	public boolean canDeleteEndNode() {
+		return(false);
+	}
+	
+	private boolean m_completed=false;
+	private boolean m_choiceElement=false;
+	
+    private BPMNActivity m_initialChoiceState=null;
+    private BPMNActivity m_endChoiceState=null;
+    private BPMNActivity m_junctionState=null;
+    private String m_conditionalDescription=null;
+    private String m_conditionalExpression=null;
+    private String m_repeatExpression=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/gmf/GMFBPMNNotationFactoryImpl.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/gmf/GMFBPMNNotationFactoryImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/gmf/GMFBPMNNotationFactoryImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,341 @@
+/*
+ * Copyright 2005-6 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 30 Jan 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.gmf;
+
+import org.eclipse.gmf.runtime.notation.*;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+import org.savara.tools.bpmn.generation.BPMNModelFactory;
+import org.savara.tools.bpmn.generation.BPMNNotationFactory;
+
+public class GMFBPMNNotationFactoryImpl implements BPMNNotationFactory {
+
+	public String getFileExtension() {
+		return("bpmn_diagram");
+	}
+	
+	public void saveNotation(String modelFileName, Object diagramModel,
+			String notationFileName, Object diagramNotation)
+						throws BPMNGenerationException {
+		try {
+			int pos=notationFileName.lastIndexOf(java.io.File.separator);
+			
+			((Diagram)diagramNotation).setName(notationFileName.substring(pos+1));
+									
+			org.eclipse.emf.ecore.resource.ResourceSet resourceSet =
+						new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl();
+
+//			 Register XML resource factory
+			resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn_diagram", 
+					new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl());
+			resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", 
+					new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl());
+			
+			resourceSet.getPackageRegistry().put(NotationPackage.eINSTANCE.getNsURI(), NotationPackage.eINSTANCE);
+			resourceSet.getPackageRegistry().put(org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE.getNsURI(), org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE);
+
+			org.eclipse.emf.ecore.resource.Resource modelResource =
+				resourceSet.createResource(org.eclipse.emf.common.util.URI.createFileURI(modelFileName));
+			
+			if (modelResource instanceof org.eclipse.emf.ecore.xmi.XMLResource) {
+				setXMIId((org.eclipse.emf.ecore.xmi.XMLResource)modelResource,
+							(org.eclipse.stp.bpmn.BpmnDiagram)diagramModel);
+			}
+			
+			modelResource.getContents().add((org.eclipse.emf.ecore.EObject)diagramModel);
+			
+			org.eclipse.emf.ecore.resource.Resource notationResource =
+				resourceSet.createResource(org.eclipse.emf.common.util.URI.createFileURI(notationFileName));
+			
+			if (notationResource instanceof org.eclipse.emf.ecore.xmi.XMLResource) {
+				setXMIId((org.eclipse.emf.ecore.xmi.XMLResource)notationResource,
+							(org.eclipse.emf.ecore.EObject)diagramNotation);
+			}
+			
+			notationResource.getContents().add((org.eclipse.emf.ecore.EObject)diagramNotation);
+			
+			/*
+			org.eclipse.emf.ecore.resource.Resource resource =
+					((Diagram)diagramNotation).eResource();
+			resource.setURI(org.eclipse.emf.common.util.URI.createFileURI(fileName));
+			*/
+			
+			org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl xmi =
+				new org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl();
+			java.util.Map options=xmi.getDefaultSaveOptions();
+			
+			options.put(org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.OPTION_SAVE_TYPE_INFORMATION, Boolean.TRUE);
+			//options.put(org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.OPTION_RECORD_ANY_TYPE_NAMESPACE_DECLARATIONS, Boolean.TRUE);
+			notationResource.save(options);
+			modelResource.save(options);
+
+			
+/*			
+			// Output the UML2 model to the supplied stream
+			final org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl xmi =
+				new org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl();
+			xmi.setURI(org.eclipse.emf.common.util.URI.createFileURI(fileName));
+			
+			xmi.getResourceSet();
+			
+			org.eclipse.emf.ecore.resource.impl.ResourceSetImpl set=
+				new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl();
+			
+			org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE.getActivity();
+			
+			System.out.println("Registry for '"+org.eclipse.stp.bpmn.BpmnPackage.eNS_URI
+					+": "+xmi.getResourceSet().getPackageRegistry().getEPackage(org.eclipse.stp.bpmn.BpmnPackage.eNS_URI));
+
+			xmi.getContents().add(diagramNotation);
+			
+			xmi.doSave(ostream, xmi.getDefaultLoadOptions());
+*/			
+			//ostream.close();
+			
+		} catch(Exception e) {
+			throw new BPMNGenerationException("Failed to convert to XMI", e);
+		}
+	}
+
+	public Object createDiagram(BPMNModelFactory factory, Object diagramModel,
+			int x, int y, int width, int height) {
+		Diagram ret=NotationFactory.eINSTANCE.createDiagram();
+		
+		ret.setType("Bpmn");
+		ret.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
+		ret.setElement((org.eclipse.emf.ecore.EObject)diagramModel);
+	
+		ret.getStyles().add(NotationFactory.eINSTANCE.createPageStyle());
+		ret.getStyles().add(NotationFactory.eINSTANCE.createGuideStyle());
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+		
+		/*
+		try {
+		org.eclipse.emf.ecore.resource.ResourceSet resourceSet =
+			new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl();
+
+// Register XML resource factory
+resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn_diagram", 
+						new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl());
+
+resourceSet.getPackageRegistry().put(NotationPackage.eINSTANCE.getNsURI(), NotationPackage.eINSTANCE);
+resourceSet.getPackageRegistry().put(org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE.getNsURI(), org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE);
+
+org.eclipse.emf.ecore.resource.Resource resource =
+	resourceSet.createResource(org.eclipse.emf.common.util.URI.createFileURI("test.xmi"));
+// add the root object to the resource
+resource.getContents().add(ret);
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+		*/
+
+		return(ret);
+	}
+
+	public Object createPool(BPMNModelFactory factory, Object poolModel,
+			Object diagramNotation, int x, int y, int width, int height) {
+		Node ret=NotationFactory.eINSTANCE.createNode();
+		
+		ret.setElement((org.eclipse.emf.ecore.EObject)poolModel);
+		ret.setType("1001");
+		
+		Bounds bounds=NotationFactory.eINSTANCE.createBounds();
+		bounds.setHeight(height);
+		bounds.setWidth(width+100);
+		bounds.setX(x);
+		bounds.setY(y);
+		
+		ret.setLayoutConstraint(bounds);
+		
+		FontStyle font=NotationFactory.eINSTANCE.createFontStyle();
+		font.setFontName("Ariel");
+		ret.getStyles().add(font);
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+		
+		FillStyle fill=NotationFactory.eINSTANCE.createFillStyle();
+		fill.setFillColor(16771304);
+		ret.getStyles().add(fill);
+		
+		LineStyle line=NotationFactory.eINSTANCE.createLineStyle();
+		line.setLineColor(11119017);
+		ret.getStyles().add(line);
+		
+		Node nameNode=NotationFactory.eINSTANCE.createNode();
+		nameNode.setType("4008");
+		ret.insertChild(nameNode);
+		
+		Node lineNode=NotationFactory.eINSTANCE.createNode();
+		lineNode.setType("5001");
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDrawerStyle());
+		ret.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
+		ret.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
+		ret.insertChild(lineNode);
+		
+		((Diagram)diagramNotation).insertChild(ret);	
+		
+		return(lineNode);
+	}
+
+	public Object createTask(BPMNModelFactory factory,
+			Object taskModel, Object parentNotation,
+					int x, int y, int width, int height) {
+		Node ret=NotationFactory.eINSTANCE.createNode();
+		
+		ret.setElement((org.eclipse.emf.ecore.EObject)taskModel);
+		ret.setType("2001");
+		
+		Bounds bounds=NotationFactory.eINSTANCE.createBounds();
+		bounds.setHeight(height);
+		bounds.setWidth(width);
+		bounds.setX(x);
+		bounds.setY(y);
+		
+		ret.setLayoutConstraint(bounds);
+		
+		FontStyle font=NotationFactory.eINSTANCE.createFontStyle();
+		font.setFontName("Ariel");
+		ret.getStyles().add(font);
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+		
+		FillStyle fill=NotationFactory.eINSTANCE.createFillStyle();
+		fill.setFillColor(16771304);
+		ret.getStyles().add(fill);
+		
+		LineStyle line=NotationFactory.eINSTANCE.createLineStyle();
+		line.setLineColor(11119017);
+		ret.getStyles().add(line);
+		
+		Node nameNode=NotationFactory.eINSTANCE.createNode();
+		nameNode.setType("4001");
+		ret.insertChild(nameNode);
+		
+		((Node)parentNotation).insertChild(ret);	
+		
+		m_taskViews.put(taskModel, ret);
+		
+		return(ret);
+	}
+	
+
+	public Object createJunction(BPMNModelFactory factory,
+			Object junctionModel, Object parentNotation,
+					int x, int y, int width, int height) {
+		Node ret=NotationFactory.eINSTANCE.createNode();
+		
+		ret.setElement((org.eclipse.emf.ecore.EObject)junctionModel);
+		ret.setType("2001");
+		
+		Bounds bounds=NotationFactory.eINSTANCE.createBounds();
+		bounds.setHeight(height);
+		bounds.setWidth(width);
+		bounds.setX(x);
+		bounds.setY(y);
+		
+		ret.setLayoutConstraint(bounds);
+		
+		FontStyle font=NotationFactory.eINSTANCE.createFontStyle();
+		font.setFontName("Ariel");
+		ret.getStyles().add(font);
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+		
+		FillStyle fill=NotationFactory.eINSTANCE.createFillStyle();
+		fill.setFillColor(16771304);
+		ret.getStyles().add(fill);
+		
+		LineStyle line=NotationFactory.eINSTANCE.createLineStyle();
+		line.setLineColor(11119017);
+		ret.getStyles().add(line);
+		
+		Node nameNode=NotationFactory.eINSTANCE.createNode();
+		nameNode.setType("4001");
+		ret.insertChild(nameNode);
+		
+		((Node)parentNotation).insertChild(ret);	
+		
+		return(ret);
+	}
+	
+	public Object createMessageLink(BPMNModelFactory factory,
+						Object linkModel, Object diagramNotation) {
+		Edge ret=NotationFactory.eINSTANCE.createEdge();
+		
+		Object source=factory.getSource(linkModel);
+		if (source != null) {
+			ret.setSource(getTaskView(source));
+		}
+		
+		Object target=factory.getTarget(linkModel);
+		if (target != null) {
+			ret.setTarget(getTaskView(target));
+		}
+		
+		ret.setElement((org.eclipse.emf.ecore.EObject)linkModel);
+		ret.setType("3002");
+		
+		Node nameNode=NotationFactory.eINSTANCE.createNode();
+		nameNode.setType("4007");
+		ret.insertChild(nameNode);
+
+		Location layout=NotationFactory.eINSTANCE.createLocation();
+		layout.setY(40);
+		nameNode.setLayoutConstraint(layout);
+				
+		ret.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
+		
+		FontStyle font=NotationFactory.eINSTANCE.createFontStyle();
+		font.setFontName("Ariel");
+		ret.getStyles().add(font);
+		ret.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
+		
+		RelativeBendpoints bendpoints=NotationFactory.eINSTANCE.createRelativeBendpoints();
+		//bendpoints.setPoints(arg0);
+		ret.setBendpoints(bendpoints);
+		
+		((Diagram)diagramNotation).insertEdge(ret);	
+
+		return(ret);
+	}
+	
+	protected View getTaskView(Object modelObject) {
+		View ret=(View)m_taskViews.get(modelObject);
+		
+		return(ret);
+	}
+	
+	protected void setXMIId(org.eclipse.emf.ecore.xmi.XMLResource res,
+					org.eclipse.emf.ecore.EObject eobj) {
+		
+		if (eobj instanceof org.eclipse.stp.bpmn.Identifiable) {
+			res.setID((org.eclipse.stp.bpmn.Identifiable)eobj,
+					((org.eclipse.stp.bpmn.Identifiable)eobj).getID());
+		} else if (eobj instanceof org.eclipse.gmf.runtime.notation.View) {
+			res.setID((org.eclipse.gmf.runtime.notation.View)eobj,
+					"_"+System.currentTimeMillis()+"_"+((org.eclipse.gmf.runtime.notation.View)eobj).hashCode());
+		}
+		
+		java.util.List children=eobj.eContents();
+		
+		for (int i=0; i < children.size(); i++) {
+			setXMIId(res, (org.eclipse.emf.ecore.EObject)children.get(i));
+		}
+	}
+	
+	private java.util.Hashtable m_taskViews=new java.util.Hashtable();
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/stp/STPBPMNModelFactoryImpl.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/stp/STPBPMNModelFactoryImpl.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpmn/src/java/org/savara/tools/bpmn/generation/stp/STPBPMNModelFactoryImpl.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,462 @@
+/*
+ * Copyright 2005-6 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 26 Jan 2007 : Initial version created by gary
+ */
+package org.savara.tools.bpmn.generation.stp;
+
+import org.eclipse.stp.bpmn.*;
+import org.savara.tools.bpmn.generation.BPMNGenerationException;
+
+public class STPBPMNModelFactoryImpl implements org.savara.tools.bpmn.generation.BPMNModelFactory {
+
+	public String getFileExtension() {
+		return("bpmn");
+	}
+	
+	public void saveModel(String fileName, Object diagram)
+						throws BPMNGenerationException {
+		
+		/*
+		try {
+			org.eclipse.stp.bpmn.BpmnPackage.eINSTANCE.getActivity();
+			
+			java.io.FileOutputStream ostream=
+				new java.io.FileOutputStream(fileName);
+						
+			// Output the UML2 model to the supplied stream
+			final org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl xmi =
+				new org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl();
+			xmi.setURI(org.eclipse.emf.common.util.URI.createFileURI(fileName));
+			xmi.getContents().add(diagram);
+			
+			xmi.doSave(ostream, xmi.getDefaultLoadOptions());
+			
+			ostream.close();
+			
+		} catch(Exception e) {
+			throw new BPMNGenerationException("Failed to convert to XMI", e);
+		}
+		*/
+	}
+	
+	public Object createDiagram() {
+		BpmnDiagram ret=BpmnFactory.eINSTANCE.createBpmnDiagram();
+		return(ret);
+	}
+	
+	public Object createPool(Object diagram, String name) {
+		Pool ret = BpmnFactory.eINSTANCE.createPool();
+		ret.setName(name);
+		
+		if (diagram instanceof BpmnDiagram) {
+			((BpmnDiagram)diagram).getPools().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createInitialNode(Object container) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.EVENT_START_EMPTY_LITERAL);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createSimpleTask(Object container,
+			org.pi4soa.service.behavior.ActivityType activity) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.TASK_LITERAL);
+		
+		String label=activity.getName();
+		
+		Class[] intf=activity.getClass().getInterfaces();
+		for (int i=0; i < intf.length; i++) {
+			if (intf[i].getName().startsWith("org.pi4soa.service.behavior")) {
+				int index=intf[i].getName().lastIndexOf('.');
+				label = intf[i].getName().substring(index+1);
+				
+				if (activity instanceof org.pi4soa.service.behavior.Perform) {
+					label += " "+((org.pi4soa.service.behavior.Perform)
+							activity).getBehaviorDescription().getName();
+				} else if (activity.getName() != null) {
+					label += " "+activity.getName();
+				}
+			}
+		}
+
+		ret.setName(label);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createControlLink(Object container,
+			Object fromNode, Object toNode,
+						String conditionalExpression) {
+		org.eclipse.stp.bpmn.SequenceEdge ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createSequenceEdge();
+		
+		if (fromNode instanceof Vertex) {
+			ret.setSource((Vertex)fromNode);
+		}
+		
+		if (toNode instanceof Vertex) {
+			ret.setTarget((Vertex)toNode);
+		}
+		
+		if (conditionalExpression != null) {
+			ret.setName(conditionalExpression);
+		}
+		
+		if (container instanceof Graph) {
+			((Graph)container).getSequenceEdges().add(ret);
+		}
+		
+		return(ret);
+	}
+
+	public Object createMessageLink(Object container,
+			Object fromNode, Object toNode,
+			org.pi4soa.service.behavior.Receive receive) {
+		MessagingEdge ret=BpmnFactory.eINSTANCE.createMessagingEdge();
+		
+		if (fromNode instanceof Activity) {
+			ret.setSource((Activity)fromNode);
+		}
+		
+		if (toNode instanceof Activity) {
+			ret.setTarget((Activity)toNode);
+		}
+		
+		String name=receive.getOperationName();
+		String mesgType=null;
+		
+		if (receive.getMessageDefinition() != null &&
+				receive.getMessageDefinition().getInformationType() != null) {
+			mesgType = receive.getMessageDefinition().getInformationType().getType();			
+			
+			if (mesgType == null) {
+				mesgType = receive.getMessageDefinition().getInformationType().getElement();
+			}
+		}
+		
+		if (mesgType != null) {
+			mesgType = org.pi4soa.common.xml.XMLUtils.getLocalname(mesgType);
+		}
+
+		if (name == null) {
+			name = mesgType;
+		} else if (mesgType != null) {
+			name += "("+mesgType+")";
+		} else {
+			name += "()";
+		}
+		
+		if (name != null) {
+			ret.setName(name);
+		}
+		
+		if (container instanceof BpmnDiagram) {
+			((BpmnDiagram)container).getMessages().add(ret);
+		} else if (container instanceof Pool) {
+			((Pool)container).getBpmnDiagram().getMessages().add(ret);
+		}
+		
+		return(ret);
+	}
+
+	public Object setLinkExpression(Object link, String expression) {
+		
+		if (expression != null &&
+				link instanceof org.eclipse.stp.bpmn.SequenceEdge) {
+			org.eclipse.stp.bpmn.SequenceEdge edge=
+				(org.eclipse.stp.bpmn.SequenceEdge)link;
+			
+			edge.setName(expression);
+		}
+		
+		return(link);
+	}
+	
+	public Object createDataBasedXORGateway(Object container) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.GATEWAY_DATA_BASED_EXCLUSIVE_LITERAL);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createEventBasedXORGateway(Object container) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.GATEWAY_EVENT_BASED_EXCLUSIVE_LITERAL);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createANDGateway(Object container) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.GATEWAY_PARALLEL_LITERAL);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public Object createFinalNode(Object container) {
+		org.eclipse.stp.bpmn.Activity ret=
+			org.eclipse.stp.bpmn.BpmnFactory.eINSTANCE.createActivity();
+		
+		ret.setActivityType(ActivityType.EVENT_END_EMPTY_LITERAL);
+		
+		if (container instanceof Graph) {
+			((Graph)container).getVertices().add(ret);
+		}
+		
+		return(ret);
+	}
+	
+	public boolean isDecision(Object node) {
+		boolean ret=false;
+		
+		if (node instanceof org.eclipse.stp.bpmn.Activity &&
+				(((org.eclipse.stp.bpmn.Activity)node).getActivityType()
+					== ActivityType.GATEWAY_DATA_BASED_EXCLUSIVE_LITERAL ||
+					((org.eclipse.stp.bpmn.Activity)node).getActivityType()
+					== ActivityType.GATEWAY_EVENT_BASED_EXCLUSIVE_LITERAL)) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines if the supplied node is a join. This
+	 * is true, if the node is a data or event based gateway,
+	 * and as incoming edges. This is based on the fact that only
+	 * a join gateway, at the point this method is invoked, would
+	 * have incoming links, otherwise any other gateway would be
+	 * assumed to be the initial gateway in a conditional grouping
+	 * construct.
+	 * 
+	 * @param node
+	 * @return Whether the node is a join
+	 */
+	public boolean isJoin(Object node) {
+		boolean ret=false;
+		
+		if (node instanceof org.eclipse.stp.bpmn.Activity &&
+				(((org.eclipse.stp.bpmn.Activity)node).getActivityType()
+					== ActivityType.GATEWAY_DATA_BASED_EXCLUSIVE_LITERAL ||
+					((org.eclipse.stp.bpmn.Activity)node).getActivityType()
+					== ActivityType.GATEWAY_EVENT_BASED_EXCLUSIVE_LITERAL) &&
+				((org.eclipse.stp.bpmn.Activity)node).getIncomingEdges().size() > 0) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	public boolean isTerminal(Object node) {
+		boolean ret=false;
+		
+		if (node instanceof org.eclipse.stp.bpmn.Activity &&
+				((org.eclipse.stp.bpmn.Activity)node).getActivityType()
+					== ActivityType.EVENT_END_EMPTY_LITERAL) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+	
+	public void setLabel(Object entity, String label) {
+		if (entity instanceof Activity) {
+			((Activity)entity).setName(label);
+		}
+	}
+	
+	public Object getSource(Object link) {
+		Object ret=null;
+		
+		if (link instanceof SequenceEdge) {
+			ret = ((SequenceEdge)link).getSource();
+		} else if (link instanceof MessagingEdge) {
+			ret = ((MessagingEdge)link).getSource();
+		}
+		
+		return(ret);
+	}
+	
+	public void setSource(Object link, Object node) {
+		if (link instanceof SequenceEdge && node instanceof Vertex) {
+			((SequenceEdge)link).setSource((Vertex)node);
+		} else if (link instanceof MessagingEdge &&
+						node instanceof Activity) {
+			((MessagingEdge)link).setSource((Activity)node);
+		}
+	}
+	
+	public Object getTarget(Object link) {
+		Object ret=null;
+		
+		if (link instanceof SequenceEdge) {
+			ret = ((SequenceEdge)link).getTarget();
+		} else if (link instanceof MessagingEdge) {
+			ret = ((MessagingEdge)link).getTarget();
+		}
+		
+		return(ret);
+	}
+	
+	public void setTarget(Object link, Object node) {
+		if (link instanceof SequenceEdge && node instanceof Vertex) {
+			((SequenceEdge)link).setTarget((Vertex)node);
+		} else if (link instanceof MessagingEdge &&
+						node instanceof Activity) {
+			((MessagingEdge)link).setTarget((Activity)node);
+		}
+	}
+	
+	public java.util.List getInboundControlLinks(Object node) {
+		java.util.List ret=null;
+		
+		if (node instanceof Vertex) {
+			ret = ((Vertex)node).getIncomingEdges();
+		}
+		
+		return(ret);
+	}
+	
+	public java.util.List getOutboundControlLinks(Object node) {
+		java.util.List ret=null;
+		
+		if (node instanceof Vertex) {
+			ret = ((Vertex)node).getOutgoingEdges();
+		}
+		
+		return(ret);
+	}
+	
+	public java.util.List getInboundMessageLinks(Object node) {
+		java.util.List ret=null;
+		
+		if (node instanceof Activity) {
+			ret = ((Activity)node).getIncomingMessages();
+		}
+		
+		return(ret);
+	}
+	
+	public java.util.List getOutboundMessageLinks(Object node) {
+		java.util.List ret=null;
+		
+		if (node instanceof Activity) {
+			ret = ((Activity)node).getOutgoingMessages();
+		}
+		
+		return(ret);
+	}
+	
+	public void delete(Object entity) {
+//System.out.println("DELETE: "+entity);
+		
+		if (entity instanceof Vertex) {
+			Vertex node=(Vertex)entity;
+			
+			if (node.getGraph() != null) {
+				node.getGraph().getVertices().remove(node);
+			}
+			
+			for (int i=node.getIncomingEdges().size()-1; i >= 0; i--) {
+				SequenceEdge edge=(SequenceEdge)node.getIncomingEdges().get(i);
+				delete(edge);
+			}
+			
+			for (int i=node.getOutgoingEdges().size()-1; i >= 0; i--) {
+				SequenceEdge edge=(SequenceEdge)node.getOutgoingEdges().get(i);
+				delete(edge);
+			}
+		} else if (entity instanceof SequenceEdge) {
+			SequenceEdge edge=(SequenceEdge)entity;
+			
+			edge.setSource(null);
+			edge.setTarget(null);
+			
+			if (edge.getGraph() != null) {
+				edge.getGraph().getSequenceEdges().remove(edge);
+			}
+		} else if (entity instanceof Pool) {
+			Pool pool=(Pool)entity;
+			
+			if (pool.getBpmnDiagram() != null) {
+				pool.getBpmnDiagram().getPools().remove(pool);
+			}
+		}
+	}
+
+	public boolean isDeleted(Object entity) {
+		boolean ret=false;
+		
+		if (entity instanceof Vertex) {
+			Vertex node=(Vertex)entity;
+			
+			if (node.getGraph() == null) {
+				ret = true;
+			}
+		} else if (entity instanceof SequenceEdge) {
+			SequenceEdge edge=(SequenceEdge)entity;
+			
+			if (edge.getGraph() == null) {
+				ret = true;
+			}
+		} else if (entity instanceof Pool) {
+			Pool pool=(Pool)entity;
+			
+			if (pool.getBpmnDiagram() != null) {
+				ret = true;
+			}
+		}
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.monitor</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/LICENSE.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/LICENSE.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/LICENSE.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Tools Monitor Plug-in
+Bundle-SymbolicName: org.savara.tools.monitor;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.monitor.eclipse.Activator
+Bundle-Vendor: www.savara.org
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.pi4soa.service,
+ org.pi4soa.cdl,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.jface,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.ui.console,
+ org.eclipse.debug.ui,
+ org.eclipse.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.emf.ecore,
+ org.pi4soa.common,
+ org.eclipse.wst.server.core,
+ org.eclipse.jst.server.core,
+ org.eclipse.jst.server.generic.core
+Eclipse-LazyStart: true
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,13 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               LICENSE.txt
+src.includes = .classpath,\
+               .project,\
+               LICENSE.txt,\
+               META-INF/,\
+               build.properties,\
+               plugin.xml,\
+               src/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+  <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+    <launchConfigurationType
+       id="org.savara.tools.monitor.eclipse.MonitorLauncher"
+       delegate="org.savara.tools.monitor.eclipse.MonitorLauncher"
+       modes="run"
+       name="Monitor">
+      <fileExtension extension="cdm" default="true"/>
+    </launchConfigurationType>
+  </extension>
+
+  <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+    <launchConfigurationTabGroup
+        type="org.savara.tools.monitor.eclipse.MonitorLauncher"
+        class="org.savara.tools.monitor.eclipse.MonitorTabGroup"
+        id="org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.monitor">
+    </launchConfigurationTabGroup>
+  </extension>
+   
+  <extension point="org.eclipse.ui.popupMenus"> 
+	<objectContribution 
+      id="org.savara.tools.service.generation.contribution2"
+   			objectClass="org.eclipse.core.resources.IFile"
+   				nameFilter="*.cdm">
+	  <menu
+         id="org.savara.tools.menu"
+         label="Savara"
+         path="additions">
+      	<separator name="group1"/>
+      </menu>
+      <action
+           label="Monitor"
+           class="org.savara.tools.monitor.eclipse.MonitorAction"
+           menubarPath="org.savara.tools.menu/group1"
+           enablesFor="1"
+           id="org.savara.tools.monitor.MonitorAction">
+     </action> 
+    </objectContribution> 
+  </extension>
+
+  <extension
+        point="org.eclipse.ui.preferencePages">
+     <page
+           class="org.savara.tools.preferences.SavaraPreferencePage"
+           id="org.savara.tools.preferences.SavaraPreferencePage"
+           name="Savara">
+     </page>
+     <page
+           category="org.savara.tools.preferences.SavaraPreferencePage"
+           class="org.savara.tools.monitor.preferences.MonitorPreferencePage"
+           id="org.savara.tools.monitor.preferences.MonitorPreferencePage"
+           name="Monitor">
+     </page>
+  </extension>
+  
+  <extension
+        point="org.eclipse.core.runtime.preferences">
+     <initializer
+           class="org.savara.tools.monitor.preferences.PreferenceInitializer">
+     </initializer>
+  </extension>
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.monitor</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsMonitor</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/CorrelationManagerListener.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/CorrelationManagerListener.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/CorrelationManagerListener.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor;
+
+import org.pi4soa.service.correlator.CorrelationSession;
+
+/**
+ * This interface represents a listener interested in changes
+ * that occur within the correlation manager.
+ *
+ */
+public interface CorrelationManagerListener {
+
+	/**
+	 * This method indicates that a correlation session has
+	 * started.
+	 * 
+	 * @param session The correlation session
+	 */
+	public void correlationSessionStarted(CorrelationSession session);
+	
+	/**
+	 * This method indicates that a correlation session has
+	 * finished.
+	 * 
+	 * @param session The correlation session
+	 */
+	public void correlationSessionFinished(CorrelationSession session);
+
+    /**
+     * A new exchange event has been added to a correlation session.
+     *
+     * @param exchangeEvent The exchange event.
+     */
+    public void exchangeEventAdded(ExchangeEvent exchangeEvent);
+
+
+    /**
+     * An exchange event has been updated.
+     *
+     * @param exchangeEvent The exchange event.
+     */
+    public void exchangeEventUpdated(ExchangeEvent exchangeEvent);
+    
+    /**
+     * An unexpected event has occured
+     * 
+     * @param exchangeEvent. The exchange event.
+     * @param serviceName The service reporting the error
+     */
+    public void unexpectedExchangeEventAdded(ExchangeEvent exchangeEvent,
+    					String serviceName);
+
+    /**
+     * An error occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The error message
+     * @param exception The optional exception trace
+     * @param serviceName The service reporting the error
+     */
+    public void error(CorrelationSession session, String mesg,
+    						String exception, String serviceName);
+    
+    /**
+     * A warning occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The warning message
+     * @param exception The optional exception trace
+     * @param serviceName The service reporting the warning
+     */
+    public void warning(CorrelationSession session, String mesg,
+							String exception, String serviceName);
+    
+    /**
+     * An information event occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The information message
+     * @param serviceName The service reporting the information
+     */
+    public void information(CorrelationSession session,
+    					String mesg, String serviceName);
+    
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ExchangeEvent.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ExchangeEvent.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ExchangeEvent.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor;
+
+import java.io.Serializable;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import org.pi4soa.cdl.ExchangeDetails;
+import org.pi4soa.service.Message;
+import org.pi4soa.service.Channel;
+import org.pi4soa.service.correlator.CorrelationSession;
+
+/**
+ * This class represents the 'exchange' correlation event.
+ *
+ */
+public class ExchangeEvent implements Serializable {
+
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = -1984285030410307153L;
+
+	Message m_message = null;
+
+	/**
+	 * This class represents the 'exchange' correlation event.
+	 * 
+	 * @param exchange The exchange details
+	 * @param channel The channel
+	 * @param session The session
+	 * @param serviceDescriptionName The service description name
+	 */
+	public ExchangeEvent(ExchangeDetails exchange,
+				Channel channel, CorrelationSession session,
+						String serviceDescriptionName, Message message) {
+		m_exchange = exchange;
+		m_channel = channel;
+		m_session = session;
+		m_serviceDescriptionName = serviceDescriptionName;
+                this.m_message = message;
+	}
+	
+	/**
+	 * This method returns the exchange details.
+	 * 
+	 * @return The exchange details
+	 */
+	public ExchangeDetails getExchange() {
+		return(m_exchange);
+	}
+	
+	/**
+	 * This method returns the channel.
+	 * 
+	 * @return The channel
+	 */
+	public Channel getChannel() {
+		return(m_channel);
+	}
+	
+	/**
+	 * This method returns the correlation session.
+	 * 
+	 * @return The correlation session
+	 */
+	public CorrelationSession getCorrelationSession() {
+		return(m_session);
+	}
+	
+	/**
+	 * This method returns the service description name.
+	 * 
+	 * @return The service description name
+	 */
+	public String getServiceDescriptionName() {
+		return(m_serviceDescriptionName);
+	}
+
+	/**
+	 * This method returns the message.
+	 * 
+	 * @return The service description name
+	 */
+	public Message getMessage() {
+		return m_message;
+	}
+	
+	/**
+	 * This method returns whether the exchange has been
+	 * initiated and completed.
+	 * 
+	 * @return The 'complete' status of the exchange event
+	 */
+	public boolean isExchangeComplete() {
+		return(m_initiated && m_completed);
+	}
+
+	/**
+	 * This method determines whether the event has been
+	 * initiated.
+	 * 
+	 * @return Whether event has been initiated
+	 */
+    public boolean getInitiated(){
+		return m_initiated;
+    }
+
+	/**
+	 * This method determines whether the event has been
+	 * completed.
+	 * 
+	 * @return Whether event has been completed
+	 */
+    public boolean getCompleted(){
+		return m_completed;
+    }
+	
+	/**
+	 * This method indicates that the exchange associated with
+	 * the event has initiated.
+	 *
+	 */
+	public void initiated() {
+		m_initiated = true;
+                checkIfExchangeCorrelated();
+	}
+	
+	/**
+	 * This method indicates that the exchange associated with
+	 * the event has completed.
+	 *
+	 */
+	public void completed() {
+		m_completed = true;
+                checkIfExchangeCorrelated();
+	}
+
+
+    protected void checkIfExchangeCorrelated() {
+        if (isExchangeComplete()) {
+            //            logger.fine("EXCHANGE CORRELATED: "+this);
+        }
+    }
+
+    public int hashCode() {
+        return(m_message.getOperationName().hashCode());
+    }
+
+    public boolean equals(Object obj) {
+        boolean ret=false;
+        if (obj instanceof ExchangeEvent) {
+            ExchangeEvent other=(ExchangeEvent)obj;
+            if (m_exchange == null || other.getExchange() == null) {
+                // Compare on message basis
+                if (m_message.isRPCStyle() &&
+                				other.getMessage().isRPCStyle()) {
+                	if (m_message.getOperationName().equals(
+                            other.getMessage().getOperationName()) &&
+                            m_message.isRequest() == other.getMessage().isRequest() &&
+                            m_message.getServiceType().equals(
+                             other.getMessage().getServiceType())) {
+                		ret = true;
+                	}
+                } else if (m_message.isRPCStyle() == false &&
+        				other.getMessage().isRPCStyle() == false) {
+                	if (m_message.getType().equals(
+                			other.getMessage().getType())) {
+                		ret = true;
+                	}
+                }
+            } else if (other.getExchange() == m_exchange &&
+                       other.getChannel().getName().equals(m_channel.getName()) &&
+                       other.getCorrelationSession() == m_session) {
+                ret = true;
+            }
+            
+            if (ret) {
+            	
+            	// Check identities
+            	if (other.getMessage().getMessageIdentities().size()
+            			== getMessage().getMessageIdentities().size()) {
+            		
+            		for (int i=0; ret &&
+            				i < getMessage().getMessageIdentities().size(); i++) {
+            			ret = false;
+            			
+            			org.pi4soa.service.Identity id=
+            					getMessage().getMessageIdentities().get(i);
+            			
+                		if (logger.isLoggable(Level.FINEST)) {
+                			logger.finest("Checking message identity ("+i+
+                					"): "+id);
+                		}
+
+                		for (int j=0; ret == false &&
+            					j < other.getMessage().getMessageIdentities().size(); j++) {
+
+                    		if (id.equals(other.getMessage().getMessageIdentities().get(j))) {
+            					ret = true;
+            				}
+            				
+                    		if (logger.isLoggable(Level.FINEST)) {
+                    			logger.finest("Against message identity ("+j+
+                    					"): "+other.getMessage().getMessageIdentities().get(j)+
+                    					" = "+ret);
+                    		}
+            			}
+            		}
+            	} else {
+            		if (logger.isLoggable(Level.FINEST)) {
+            			logger.finest("Message identity list length mismatch");
+            		}
+
+            		ret = false;
+            	}
+            }
+        }
+        return(ret);
+    }
+	
+    public String toString() {
+        StringBuffer ret=new StringBuffer();
+        ret.append("ExchangeEvent[");
+        if (m_exchange != null) {
+
+            //            if (NamesUtil.isSet(m_exchange.getDescription())) {
+
+
+            if (m_exchange.getDescription() != null && "".equals(m_exchange.getDescription()) == false) {
+
+                ret.append(m_exchange.getDescription());
+            } else {
+                ret.append(m_exchange.getName());
+            }
+            ret.append(", ");
+        }
+        ret.append(m_message.toString()+"]");
+        return(ret.toString());
+    }
+
+    private static Logger logger = Logger.getLogger("org.savara.tools.monitor");
+
+    private ExchangeDetails m_exchange=null;
+	private Channel m_channel=null;
+	private CorrelationSession m_session;
+	private String m_serviceDescriptionName=null;
+	private boolean m_initiated=false;
+	private boolean m_completed=false;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/TxnMonitor.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/TxnMonitor.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/TxnMonitor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,615 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor;
+
+import java.util.logging.Logger;
+
+import org.pi4soa.cdl.ExchangeDetails;
+import org.pi4soa.service.Channel;
+import org.pi4soa.service.Message;
+import org.pi4soa.service.ServiceException;
+import org.pi4soa.service.correlator.CorrelationSession;
+import org.pi4soa.service.correlator.ServiceCorrelator;
+import org.pi4soa.service.correlator.ServiceCorrelatorFactory;
+import org.pi4soa.service.correlator.ServiceCorrelatorListener;
+import org.pi4soa.service.tracker.ServiceTrackerClient;
+import org.pi4soa.service.tracker.jms.JMSServiceTrackerClient;
+
+/**
+ * The TxnMonitor class is a generic transaction monitor class that
+ * takes in a CDL description and monitors the progress of transactions,
+ * which are long lived interactions, against the CDL description.
+ * A TxnMonitor MAY be used as a generic monitor for any CDL description.
+ *
+ */
+public class TxnMonitor {
+
+    public TxnMonitor(String fname)
+    {
+        m_cdlFile = fname;
+    }
+    
+    public void initialize() throws ServiceException
+    {
+        
+        m_correlator=ServiceCorrelatorFactory.getServiceCorrelator();
+        m_correlator.addServiceCorrelatorListener(new CorrelatorListener());
+        
+        // Obtain service tracker client
+        m_trackerClient = new JMSServiceTrackerClient();
+        
+        // Check if system properties have been provided for JNDI
+        if (System.getProperty("java.naming.factory.initial") != null) {
+        	m_trackerClient.setJNDIInitialContextFactory(System.getProperty("java.naming.factory.initial"));
+        }
+        
+        if (System.getProperty("java.naming.provider.url") != null) {
+        	m_trackerClient.setJNDIProviderURL(System.getProperty("java.naming.provider.url"));
+        }
+        
+        if (System.getProperty("java.naming.factory.url.pkgs") != null) {
+        	m_trackerClient.setJNDIFactoryURLPackages(System.getProperty("java.naming.factory.url.pkgs"));
+        }
+        
+        if (System.getProperty("java.messaging.factory") != null) {
+        	m_trackerClient.setJMSConnectionFactory(System.getProperty("java.messaging.factory"));
+        }
+        
+        if (System.getProperty("java.messaging.destination") != null) {
+        	m_trackerClient.setJMSDestination(System.getProperty("java.messaging.destination"));
+        }
+        
+        // Add correlator as listener to the tracker
+        m_trackerClient.addServiceTrackerListener(m_correlator);
+        
+        //System.err.println("");            
+        //System.err.println("Staring to monitor events against " + m_cdlFile + " .... ");
+        //System.err.println("");
+        try {
+        	monitor(m_cdlFile);
+        } catch(java.io.IOException ioe) {
+        	throw new ServiceException("Failed to initialize monitor for '"+
+        			m_cdlFile+"'", ioe);
+        }
+    }
+    
+    /**
+     * This method returns the singleton for the TxnMonitor.
+     * 
+     * @return The singleton
+     * @exception ServiceException Failed to obtain monitor
+     */
+    public static TxnMonitor getInstance(String fname) throws ServiceException {
+        // TODO: See if there is a better way to make an instance
+        // available to a view
+        if (m_instance == null) {
+            m_instance = new TxnMonitor(fname);
+            m_instance.initialize();
+        }
+        
+        return(m_instance);
+    }
+    
+    /**
+     * This method loads the choreography description associated
+     * with the supplied filename, and then monitors it, before
+     * returning it to the caller.
+     * 
+     * @param filename The choreography description filename
+     * @return The choreography description being monitored
+     * @throws java.io.IOException Failed to load
+     * @throws ServiceException Failed to monitor
+     */
+    public org.pi4soa.cdl.Package monitor(String filename)
+                        throws java.io.IOException, ServiceException {
+        org.pi4soa.cdl.Package ret=
+            org.pi4soa.cdl.CDLManager.load(filename);
+        
+        monitor(ret);
+        
+        return(ret);
+    }
+    
+    /**
+     * This method initializes the correlator with the choreography
+     * description to be monitored.
+     * 
+     * @param cdl The choreography description
+     * @exception ServiceException Failed to monitor choreography
+     *                         description
+     */
+    public void monitor(org.pi4soa.cdl.Package cdl)
+                        throws ServiceException {        
+        m_correlator.register(cdl);
+    }
+    
+    /**
+     * This method disassociates the correlator from the choreography
+     * description being monitored.
+     * 
+     * @param cdl The choreography description
+     * @exception ServiceException Failed to stop monitor choreography
+     *                         description
+     */
+    public void unmonitor(org.pi4soa.cdl.Package cdl)
+                        throws ServiceException {        
+        m_correlator.unregister(cdl);
+    }
+    
+    /**
+     * @param args - the first argument in args is the location of the
+     * CDM file that will be used to drive the monitoring.
+     */
+    public static void main(String[] args) 
+    {
+        // TODO Auto-generated method stub
+        String s = "Constructing a monitor for " + args[0];
+        logger.fine(s);
+        
+        try {
+        	TxnMonitor mon = TxnMonitor.getInstance(args[0]);
+        } catch(Exception e) {
+        	e.printStackTrace();
+        }
+    }
+
+    /**
+     * This method will return an existing list, associated with the
+     * supplied session, or if not found, will create one - unless
+     * the session's event list has previously been removed and
+     * therefore a null will be returned (i.e. events to be
+     * ignored).
+     * 
+     * @param session The session
+     * @return The list, or null if session to be ignored
+     */
+    protected java.util.List createEventList(CorrelationSession session) {
+        java.util.List ret=null;
+        
+        logger.fine("createEventList for session - " + session);
+        
+        synchronized(m_eventLists) {
+            ret = (java.util.List)m_eventLists.get(session);
+        
+            if (ret == null) {
+                ret = new java.util.Vector();
+
+                logger.fine("Creating event list for session: "+session);
+                
+                m_eventLists.put(session, ret);
+            }
+        }
+        
+        logger.fine("createEventList returning - " + ret);
+
+        return(ret);
+    }
+    
+    /**
+     * This method will remove the event list associated with
+     * the supplied session, and add the session to the list
+     * of sessions to be ignored from now on.
+     * 
+     * @param session The session
+     */
+    protected void removeEventList(CorrelationSession session) {
+        
+        synchronized(m_eventLists) {
+
+            logger.fine("Remove correlation session: "+session);
+            
+            m_eventLists.remove(session);
+        }
+    }
+
+    protected void fireSessionStarted(CorrelationSession session) {
+            System.err.println(">>>> fireSessionStarted");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.correlationSessionStarted(session);
+        }
+            System.err.println(">>>> finished fireSessionStarted");
+    }
+    
+    protected void fireSessionFinished(CorrelationSession session) {
+            System.err.println(">>>> fireSessionFinished");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.correlationSessionFinished(session);
+        }
+            logger.fine(">>>> finished fireSessionFinished");
+    }
+    
+    protected void fireUpdatedSession(CorrelationSession session) {
+            logger.fine(">>>> fireSessionUpdated");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+                        //            l.correlationSessionUpdated(session);
+        }
+            logger.fine(">>>> finished fireSessionUpdated");
+    }
+
+
+    protected void fireAddedExchangeEvent(ExchangeEvent exchangeEvent) {
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.exchangeEventAdded(exchangeEvent);
+        }
+    }
+
+    protected void fireUpdatedExchangeEvent(ExchangeEvent exchangeEvent) {
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.exchangeEventUpdated(exchangeEvent);
+        }
+    }
+    
+    protected void fireAddedUnexpectedExchangeEvent(ExchangeEvent exchangeEvent,
+    				String serviceName) {
+    	logger.fine(">>>> fireAddedUnexpectedExchangeEvent");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.unexpectedExchangeEventAdded(exchangeEvent, serviceName);
+        }
+    	logger.fine("<<<< fireAddedUnexpectedExchangeEvent");
+    }
+    
+    protected void fireErrorEvent(CorrelationSession session,
+    				String mesg, String exception, String serviceName) {
+    	logger.fine(">>>> fireErrorEvent");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.error(session, mesg, exception, serviceName);
+        }
+    	logger.fine("<<<< fireErrorEvent");
+    }
+    
+    protected void fireWarningEvent(CorrelationSession session,
+    					String mesg, String exception, String serviceName) {
+    	logger.fine(">>>> fireWarningEvent");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.warning(session, mesg, exception, serviceName);
+        }
+    	logger.fine("<<<< fireWarningEvent");
+    }
+    
+    protected void fireInformationEvent(CorrelationSession session,
+    						String mesg, String serviceName) {
+    	logger.fine(">>>> fireInformationEvent");
+        for (int i=0; i < m_listeners.size(); i++) {
+            CorrelationManagerListener l=
+                    (CorrelationManagerListener)m_listeners.get(i);
+            
+            l.information(session, mesg, serviceName);
+        }
+    	logger.fine("<<<< fireInformationEvent");
+    }
+    
+    public void addCorrelationManagerListener(CorrelationManagerListener l) {
+            logger.fine(">>>> addCorrelationManagerListener");
+        m_listeners.add(l);
+    }
+    
+    public void removeCorrelationManagerListener(CorrelationManagerListener l) {
+            logger.fine(">>>> removeCorrelationManagerListener");
+        m_listeners.remove(l);
+    }
+    
+    private static Logger logger = Logger.getLogger("org.savara.tools.monitor");
+    
+    private static TxnMonitor m_instance=null;
+    private ServiceCorrelator m_correlator=null;
+    private JMSServiceTrackerClient m_trackerClient=null;
+    private java.util.Hashtable m_eventLists=new java.util.Hashtable();
+    private java.util.Vector m_listeners=new java.util.Vector();
+    private String m_cdlFile = null;
+    
+    
+    public class CorrelatorListener implements ServiceCorrelatorListener {
+        
+        /**
+         * This method indicates that the supplied choreography
+         * description has been registered with the service
+         * correlator.
+         * 
+         * @param cdlpack The choreography description
+         */
+        public void choreographyDescriptionRegistered(org.pi4soa.cdl.Package cdlpack) {
+                    logger.fine(">>>> choreographyDescriptionRegistered");            
+        }
+        
+        /**
+         * This method indicates that the supplied choreography
+         * description has been unregistered from the service
+         * correlator.
+         * 
+         * @param cdlpack The choreography description
+         */
+        public void choreographyDescriptionUnregistered(org.pi4soa.cdl.Package cdlpack) {
+                    logger.fine(">>>> choreographyDescriptionUnregistered");                        
+        }
+        
+        /**
+         * This method indicates that a new correlated session has
+         * been started.
+         * 
+         * @param session The session
+         */
+        public void sessionStarted(CorrelationSession session) {
+                    logger.fine(">>>> sessionStarted");
+            fireSessionStarted(session);
+        }
+        
+        /**
+         * This method indicates that a correlated session has
+         * been finished.
+         * 
+         * @param session The session
+         */
+        public void sessionFinished(CorrelationSession session) {
+                    logger.fine(">>>> sessionFinished");
+            fireSessionFinished(session);
+        }
+        
+        /**
+         * This method is invoked to indicate that a choreography
+         * exchange has been initiated by one participant.
+         * 
+         * @param exchange The exchange details
+         * @param channel The channel associated with the exchange
+         * @param session The session
+         * @param serviceDescriptionName The name of the service
+         *                 description that caused this exchange to
+         *                 be initiated
+         */
+        public synchronized void exchangeInitiated(ExchangeDetails exchange,
+                Channel channel, Message message, CorrelationSession session,
+                        String serviceDescriptionName) {
+
+            logger.fine(">>>> exchangeInitiated");
+
+            java.util.List list = createEventList(session);
+            
+            if(list != null){
+                ExchangeEvent event = new ExchangeEvent(exchange, channel, session, serviceDescriptionName, message);
+                int index = 0;
+                boolean f_updated=false;
+                
+                if ((index=list.indexOf(event)) == -1) {
+                    logger.fine("Add new event '"+event+ "' to correlation session "+session);
+                    list.add(event);
+                } 
+                else{
+                    logger.fine("Retrieve existing event for index "+index);
+                    ExchangeEvent existingEvent=
+                    		(ExchangeEvent)list.get(index);
+                    
+                    if (existingEvent.getInitiated() == false) {
+                    	event = existingEvent;
+                    	
+                    	// Remove event from list
+                    	list.remove(index);
+                    	
+                    	if (list.size() == 0) {
+                    		// Remove list
+                    		removeEventList(session);
+                    	}
+                    	
+                    	f_updated = true;
+                    } else {
+                        logger.fine("Add new event '"+event+ "' to correlation session "+session);
+                        list.add(event);
+                    }
+                }
+                
+                event.initiated();
+                logger.fine("EXCHANGE INITIATED: ");
+                logger.fine("    CHANNEL DETAILS: " + channel + " (" + channel.getName() + ") session " + session);
+                logger.fine("    EXCHANGE DETAILS: " + exchange);
+
+                if(f_updated == false){
+                    fireAddedExchangeEvent(event);
+                }
+                else{
+                    fireUpdatedExchangeEvent(event);
+                }
+                //                fireUpdatedSession(session);
+            }
+        }
+
+        /**
+         * This method is invoked to indicate that a choreography
+         * exchange has been completed by the target participant.
+         * 
+         * @param exchange The exchange details
+         * @param channel The channel associated with the exchange
+         * @param session The session
+         * @param serviceDescriptionName The name of the service
+         *                 description that caused this exchange to
+         *                 be completed
+         */
+        public synchronized void exchangeCompleted(ExchangeDetails exchange,
+                Channel channel, Message message, CorrelationSession session,
+                        String serviceDescriptionName) {
+
+            logger.fine(">>>> exchangeCompleted");
+            
+            java.util.List list=createEventList(session);
+            
+            if (list != null) {
+                ExchangeEvent event=new ExchangeEvent(exchange, channel, session, serviceDescriptionName, message);
+                
+                int index = 0;
+                
+                if ((index=list.indexOf(event)) == -1) {
+                    logger.fine("Add new event '"+event+ "' to correlation session "+session);
+                    list.add(event);
+                } 
+                else{
+                    logger.fine("Retrieve existing event for index "+index);
+                    ExchangeEvent existingEvent=
+                    		(ExchangeEvent)list.get(index);
+                    
+                    if (existingEvent.getCompleted() == false) {
+                    	event = existingEvent;
+                    	
+                    	// Remove event from list
+                    	list.remove(index);
+                    	
+                    	if (list.size() == 0) {
+                    		// Remove list
+                    		removeEventList(session);
+                    	}
+                    } else {
+                        logger.fine("Add new event '"+event+ "' to correlation session "+session);
+                        list.add(event);
+                    }
+                }
+                
+                event.completed();
+                logger.fine("EXCHANGE COMPLETED: ");
+                                //                logger.fine("    CHANNEL DETAILS: " + channel);
+                logger.fine("    CHANNEL DETAILS: " + channel + " (" + channel.getName() + ") session " + session);
+                logger.fine("    EXCHANGE DETAILS: " + exchange);
+
+                if(index == -1){
+                    fireAddedExchangeEvent(event);
+                }
+                else{
+                    fireUpdatedExchangeEvent(event);
+                }
+                //                fireUpdatedSession(session);
+                logger.fine("<<<< exchangeCompleted");
+            }
+        }
+        
+        /**
+         * This method is invoked to indicate that a message
+         * was unexpected at a participant.
+         * 
+         * @param message The message
+         * @param session The session
+         * @param serviceDescriptionName The name of the service
+         *                 description that caused this unexpected
+         *                 message error
+         */
+        public synchronized void unexpectedMessage(Message message,
+                CorrelationSession session, String serviceDescriptionName) {
+
+            logger.fine(">>>> unexpectedMessage");
+            logger.fine("MESSAGE: " + message + " SESSION: " + session + " SERVICE: " + serviceDescriptionName);
+            logger.fine("MESSAGE: " + message);
+            logger.fine("Identities: " + message.getChannelIdentity());
+            //java.util.List list = createEventList(session);
+
+            //if(list != null){
+                ExchangeDetails exchange = null;
+                Channel channel = null;
+
+                logger.fine(">>>> creating unexpected event");
+
+                ExchangeEvent event = new ExchangeEvent(exchange, channel, session, serviceDescriptionName, message);
+
+                logger.fine(">>>> created unexpected event");
+                
+                logger.fine("Add unexpected new event '"+event+ "' to correlation session "+session);
+                //list.add(event);
+ 
+                logger.fine(">>>> UNEXPECTED EVENT for session: " + session);
+                
+                fireAddedUnexpectedExchangeEvent(event, serviceDescriptionName);
+
+
+                logger.fine(">>>> HANDLED UNEXPECTED EVENT for session: " + session);
+            //}
+            logger.fine("<<<< unexpectedMessage");
+        }
+        
+        /**
+         * An error occurred related to the specified correlation
+         * session.
+         * 
+         * @param mesg The error message
+         * @param exception The optional exception details
+         * @param session The correlation session
+         * @param serviceDescriptionName The service name
+         */
+        public void error(String mesg, String exception,
+        		CorrelationSession session, String serviceDescriptionName) {
+            logger.fine(">>>> error");
+
+            fireErrorEvent(session, mesg, exception, serviceDescriptionName);
+
+            logger.fine("<<<< error");
+        }
+        
+        /**
+         * A warning occurred related to the specified correlation
+         * session.
+         * 
+         * @param mesg The warning message
+         * @param exception The optional exception details
+         * @param session The correlation session
+         * @param serviceDescriptionName The service name
+         */
+        public void warning(String mesg, String exception,
+        		CorrelationSession session, String serviceDescriptionName) {
+            logger.fine(">>>> warning");
+
+            fireWarningEvent(session, mesg, exception, serviceDescriptionName);
+
+            logger.fine("<<<< warning");
+        }
+        
+        /**
+         * An information event occurred related to the specified correlation
+         * session.
+         * 
+         * @param mesg The information message
+         * @param session The correlation session
+         * @param serviceDescriptionName The service name
+         */
+        public void information(String mesg, CorrelationSession session,
+    			String serviceDescriptionName) {
+            logger.fine(">>>> information");
+
+            fireInformationEvent(session, mesg, serviceDescriptionName);
+
+            logger.fine("<<<< information");
+        }
+    }
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.pi4soa.common.eclipse.BundleUtil;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tools.monitor";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	
+	static {		
+		BundleUtil.registerClasspathEntries(PLUGIN_ID, false);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorAction.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorAction.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorAction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.pi4soa.common.resource.eclipse.ResourceUtil;
+import org.savara.tools.monitor.preferences.MonitorPreferences;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.Launch;
+import org.eclipse.debug.core.DebugPlugin;
+
+/**
+ * This class invokes the monitor action on the selected
+ * choreography file.
+ * 
+ */
+public class MonitorAction implements IObjectActionDelegate {
+
+	private static final String SET_LIBRARY_PATHS = "Need to set library paths. See Window->Preferences->Savara->Monitor.";
+	/**
+	 * This method implements the action's run method.
+	 * 
+	 * @param action The action
+	 */
+	public void run(IAction action) {
+		
+		if (m_selection instanceof StructuredSelection) {
+			StructuredSelection sel=(StructuredSelection)m_selection;
+			
+			IResource res=(IResource)sel.getFirstElement();
+			
+            // Make sure there are no markers associated
+            // with the resource
+			if (ResourceUtil.hasErrors(res) == false) {
+			
+				if (MonitorPreferences.isLibraryPathsDefined()) {
+					launch(res.getProject().getName(),
+							res.getProjectRelativePath().toString());
+				} else {
+					error(SET_LIBRARY_PATHS);
+				}
+							
+			} else {
+				error(ERRORS_NO_TEST);
+			}
+		}
+	}
+	
+	/**
+	 * This method invokes the launch action.
+	 * 
+	 * @param project The project
+	 * @param relativePath The relative path within the project
+	 */
+	protected void launch(String project, String relativePath) {
+		
+		MonitorLauncher launcher=new MonitorLauncher();
+				
+		try {
+			ILaunchManager manager =
+				DebugPlugin.getDefault().getLaunchManager();
+			
+			ILaunchConfigurationType type =
+				manager.getLaunchConfigurationType(
+			      	MonitorLaunchConfigurationConstants.LAUNCH_CONFIG_TYPE);
+			ILaunchConfiguration[] configurations =
+			      manager.getLaunchConfigurations(type);
+			
+			for (int i = 0; i < configurations.length; i++) {
+				ILaunchConfiguration configuration = configurations[i];
+				if (configuration.getName().equals(CHOREOGRAPHY_MONITOR)) {
+					configuration.delete();
+					break;
+				}
+			}
+			
+			ILaunchConfigurationWorkingCopy workingCopy =
+			      type.newInstance(null, CHOREOGRAPHY_MONITOR);
+
+			workingCopy.setAttribute(MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME,
+					project);
+			workingCopy.setAttribute(MonitorLaunchConfigurationConstants.ATTR_CHOREOGRAPHY_DESCRIPTION,
+					relativePath);
+			
+			ILaunchConfiguration configuration=workingCopy.doSave();
+		
+
+			Launch launch=new Launch(configuration, LAUNCH_MODE, null);
+			
+			launcher.launch(configuration, LAUNCH_MODE, launch, null);
+
+		} catch(Exception e) {
+			logger.severe("Failed to launch monitor: "+e);
+			
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * This method is used to report an error.
+	 * 
+	 * @param mesg The error message
+	 */
+	public void error(String mesg) {
+		
+		logger.severe("Error occurred: "+mesg);
+		
+		MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+				SWT.ICON_ERROR|SWT.OK);
+		
+		if (mesg == null) {
+			mesg = "Null pointer exception has occurred";
+		}
+
+		mbox.setMessage(mesg);
+		mbox.open();
+	}
+	
+	/**
+	 * This method indicates that the selection has changed.
+	 * 
+	 * @param action The action
+	 * @param selection The selection
+	 */
+	public void selectionChanged(IAction action,
+            ISelection selection) {
+		m_selection = selection;
+	}
+
+	/**
+	 * This method sets the currently active workbench part.
+	 * 
+	 * @param action The action
+	 * @param targetPart The active workbench part
+	 */
+	public void setActivePart(IAction action,
+            IWorkbenchPart targetPart) {
+		m_targetPart = targetPart;
+	}
+	
+	private static Logger logger = Logger.getLogger("org.savara.tools.monitor.eclipse");
+
+	private ISelection m_selection=null;
+    private IWorkbenchPart m_targetPart=null;
+
+	private static final String ERRORS_NO_TEST = "Choreography Description has errors, so cannot run monitor";
+
+	private static final String LAUNCH_MODE = "run";
+	private static final String CHOREOGRAPHY_MONITOR = "Choreography Monitor";
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLaunchConfigurationConstants.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLaunchConfigurationConstants.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLaunchConfigurationConstants.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+/**
+ * This interface defines the constants for the monitor
+ * launch configuration.
+ */
+public interface MonitorLaunchConfigurationConstants {
+
+	public static final String ATTR_PROJECT_NAME="project";
+	
+	public static final String ATTR_CHOREOGRAPHY_DESCRIPTION="choreography";
+	
+	public static final String LAUNCH_CONFIG_TYPE=
+			"org.savara.tools.monitor.eclipse.MonitorLauncher";
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLauncher.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLauncher.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorLauncher.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,482 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.IStreamListener;
+import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
+import org.eclipse.jdt.launching.ExecutionArguments;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.jst.server.core.internal.GenericRuntime;
+import org.eclipse.jst.server.generic.core.internal.GenericServerRuntime;
+import org.eclipse.osgi.util.ManifestElement;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.pi4soa.common.eclipse.BundleUtil;
+import org.savara.tools.monitor.preferences.MonitorPreferences;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * This class is responsible for launching a monitor against
+ * a choreography description.
+ */
+public class MonitorLauncher
+			extends AbstractJavaLaunchConfigurationDelegate {
+
+	/**
+	 * This is the default constructor.
+	 *
+	 */
+	public MonitorLauncher() {
+	}
+	
+	/**
+	 * This method launches the monitor.
+	 * 
+	 * @param configuration The launch configuration
+	 * @param mode The mode (run or debug)
+	 * @param launch The launch object
+	 * @param monitor The optional progress monitor
+	 */
+	public void launch(ILaunchConfiguration configuration,
+            String mode, ILaunch launch, IProgressMonitor monitor)
+						throws CoreException {
+		
+		if (monitor == null) {
+			monitor = new NullProgressMonitor();
+		}
+		
+		monitor.beginTask(MessageFormat.format("{0}...", new String[]{configuration.getName()}), 3); //$NON-NLS-1$
+		// check for cancellation
+		if (monitor.isCanceled()) {
+			return;
+		}
+		
+		monitor.subTask("Verifying launch configuration....");
+						
+		String mainTypeName = org.savara.tools.monitor.ui.Monitor.class.getName(); 
+
+		IVMInstall vm = verifyVMInstall(configuration);
+
+		IVMRunner runner = vm.getVMRunner(mode);
+		if (runner == null) {
+			abort("VM runner does not exist",
+					null, IJavaLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST); //$NON-NLS-1$
+		}
+
+		File workingDir = verifyWorkingDirectory(configuration);
+		String workingDirName = null;
+		if (workingDir != null) {
+			workingDirName = workingDir.getAbsolutePath();
+		}
+		
+		// Environment variables
+		String[] envp= DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration);
+		
+		// Program & VM args
+		String filename=configuration.getAttribute(
+				MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, "")+
+				"/"+configuration.getAttribute(
+				MonitorLaunchConfigurationConstants.ATTR_CHOREOGRAPHY_DESCRIPTION, "");
+		
+		String pgmArgs="\""+getPathForResource(filename);
+		
+		logger.fine("Launching monitor with args: "+pgmArgs);
+			
+		String vmArgs = getVMArguments(configuration);
+		
+		vmArgs += " -Djava.naming.factory.initial="+MonitorPreferences.getJNDIFactoryInitial();
+		vmArgs += " -Djava.naming.provider.url="+MonitorPreferences.getJNDIProviderURL();
+		
+		String pkgs=MonitorPreferences.getJNDIFactoryInitial();
+		
+		if (pkgs != null && pkgs.trim().length() > 0) {
+			vmArgs += " -Djava.naming.factory.url.pkgs="+MonitorPreferences.getJNDIFactoryURLPackages();
+		}
+		
+		vmArgs += " -Djava.messaging.factory="+MonitorPreferences.getJMSFactory();
+		vmArgs += " -Djava.messaging.destination="+MonitorPreferences.getJMSDestination();
+		
+		ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
+		
+		// VM-specific attributes
+		Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
+		
+		// Classpath
+		String[] classpath = getClasspath(configuration);
+			
+		// Create VM config
+		VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
+		runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
+		runConfig.setEnvironment(envp);
+		runConfig.setVMArguments(execArgs.getVMArgumentsArray());
+		runConfig.setWorkingDirectory(workingDirName);
+		runConfig.setVMSpecificAttributesMap(vmAttributesMap);
+
+		// Bootpath
+		runConfig.setBootClassPath(getBootpath(configuration));
+				
+		// check for cancellation
+		if (monitor.isCanceled()) {
+			return;
+		}		
+		
+		// stop in main
+		prepareStopInMain(configuration);
+		
+		// done the verification phase
+		monitor.worked(1);
+		
+		// Launch the configuration - 1 unit of work
+		runner.run(runConfig, launch, monitor);
+		
+		IProcess[] processes=launch.getProcesses();
+		if (processes.length > 0) {
+			processes[0].getStreamsProxy().getOutputStreamMonitor().
+						addListener(new IStreamListener() {
+				public void streamAppended(String str, IStreamMonitor mon) {
+					handleResults(str, false);
+				}
+			});
+			processes[0].getStreamsProxy().getErrorStreamMonitor().
+						addListener(new IStreamListener() {
+				public void streamAppended(String str, IStreamMonitor mon) {
+					handleResults(str, true);
+				}
+			});
+		}
+		
+		// check for cancellation
+		if (monitor.isCanceled()) {
+			return;
+		}	
+		
+		monitor.done();
+	}
+	
+	/**
+	 * This method handles the results produced by the launched
+	 * monitor.
+	 * 
+	 * @param results The results
+	 * @param errorStream Whether the results are from the error
+	 * 						stream
+	 */
+	protected void handleResults(String results, boolean errorStream) {
+		//System.out.println(results);
+	}
+	
+	/**
+	 * This method returns the full path to the resource.
+	 * 
+	 * @param relativePath The is the resource path beginning at
+	 * 					the project
+	 * @return The full path
+	 */
+	protected String getPathForResource(String relativePath) {
+		String ret=null;
+		
+		IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(relativePath));
+		if (file != null && file.exists()) {
+			ret = file.getLocation().toString();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method derives the classpath required to run the 
+	 * Monitor.
+	 * 
+	 * @param configuration The launch configuation
+	 * @return The list of classpath entries
+	 */
+	/*
+	public String[] getClasspath(ILaunchConfiguration configuration) {
+		String[] ret=null;
+		Vector classpathEntries=new Vector();
+					
+		// Add classpath entry for current Java project
+		try {
+			String projname=configuration.getAttribute(
+				MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+		
+			IProject project=
+				ResourcesPlugin.getWorkspace().getRoot().getProject(projname);
+
+			IJavaProject jproject=JavaCore.create(project); 
+			
+			// Add output location
+			IPath outputLocation=jproject.getOutputLocation();
+			
+			IFolder folder=
+				ResourcesPlugin.getWorkspace().getRoot().getFolder(outputLocation);
+			
+			String path=folder.getLocation().toString();
+
+			classpathEntries.add(path);
+			
+			// Add other libraries to the classpath
+			IClasspathEntry[] curclspath=jproject.getRawClasspath();
+			for (int i=0; curclspath != null &&
+						i < curclspath.length; i++) {
+				
+				if (curclspath[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+					IFile file=
+						ResourcesPlugin.getWorkspace().
+							getRoot().getFile(curclspath[i].getPath());
+
+					if (file.exists()) {
+						// Library is within the workspace
+						classpathEntries.add(file.getLocation().toString());
+					} else {
+						// Assume library is external to workspace
+						classpathEntries.add(curclspath[i].getPath().toString());
+					}
+					
+				} else if (curclspath[i].getEntryKind() ==
+								IClasspathEntry.CPE_CONTAINER) {
+					// Container's not currently handled - but
+					// problem need to retrieve from project and
+					// iterate over container entries
+				}
+			}
+			
+		} catch(Exception e) {
+			// TODO: report error
+		}
+		
+		String[] cpes=BundleUtil.getClasspathEntries();
+		
+		for (int i=0; i < cpes.length; i++) {
+			classpathEntries.add(cpes[i]);
+		}
+		
+		ret = new String[classpathEntries.size()];
+		classpathEntries.copyInto(ret);
+		
+		return(ret);
+	}
+	*/
+	
+	public String[] getClasspath(ILaunchConfiguration configuration) {
+		String[] ret=null;
+		java.util.Vector<String> classpathEntries=new java.util.Vector<String>();
+					
+		// Add classpath entry for current Java project
+		try {
+			String projname=configuration.getAttribute(
+					MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+		
+			IProject project=
+				ResourcesPlugin.getWorkspace().getRoot().getProject(projname);
+
+			IJavaProject jproject=JavaCore.create(project); 
+			
+			// Add output location
+			IPath outputLocation=jproject.getOutputLocation();
+			
+			IFolder folder=
+				ResourcesPlugin.getWorkspace().getRoot().getFolder(outputLocation);
+			
+			String path=folder.getLocation().toString();
+
+			classpathEntries.add(path);
+			
+			// Add other libraries to the classpath
+			IClasspathEntry[] curclspath=jproject.getRawClasspath();
+			for (int i=0; curclspath != null &&
+						i < curclspath.length; i++) {
+				
+				if (curclspath[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+					IFile file=
+						ResourcesPlugin.getWorkspace().
+							getRoot().getFile(curclspath[i].getPath());
+
+					if (file.exists()) {
+						// Library is within the workspace
+						classpathEntries.add(file.getLocation().toString());
+					} else {
+						// Assume library is external to workspace
+						classpathEntries.add(curclspath[i].getPath().toString());
+					}
+					
+				} else if (curclspath[i].getEntryKind() ==
+								IClasspathEntry.CPE_CONTAINER) {
+					// Container's not currently handled - but
+					// problem need to retrieve from project and
+					// iterate over container entries
+				}
+			}
+			
+		} catch(Exception e) {
+			// TODO: report error
+			//e.printStackTrace();
+		}
+		
+		buildClassPath("org.savara.tools.monitor", classpathEntries);
+		buildClassPath("org.pi4soa.service", classpathEntries);
+		buildClassPath("org.pi4soa.common", classpathEntries);
+		buildClassPath("org.pi4soa.cdl", classpathEntries);
+		buildClassPath("org.eclipse.emf.ecore", classpathEntries);
+		buildClassPath("org.eclipse.emf.ecore.xmi", classpathEntries);
+		buildClassPath("org.eclipse.emf.common", classpathEntries);
+		buildClassPath("org.apache.xalan", classpathEntries);
+		buildClassPath("org.apache.xml.serializer", classpathEntries);
+		
+		// Access library paths to include all found jars
+		String paths=MonitorPreferences.getLibraryPaths();
+		
+		java.util.StringTokenizer st=new java.util.StringTokenizer(paths, ":");
+		
+		while (st.hasMoreTokens()) {
+			String libpath=st.nextToken();
+			
+			java.io.File f=new java.io.File(libpath);
+			java.io.File[] childFiles=f.listFiles();
+			
+			for (int i=0; i < childFiles.length; i++) {
+				if (childFiles[i].isFile() && childFiles[i].getName().endsWith(".jar")) {
+					classpathEntries.add(childFiles[i].getAbsolutePath());
+				}
+			}
+		}
+
+		// Return entries as an array
+		ret = new String[classpathEntries.size()];
+		classpathEntries.copyInto(ret);
+		
+		if (logger.isLoggable(Level.FINEST)) {
+			logger.finest("Scenario Simulation Classpath:");
+			for (int i=0; i < ret.length; i++) {
+				logger.finest("    ["+i+"] "+ret[i]);
+			}
+		}
+		
+		return(ret);
+	}
+	
+	protected void buildClassPath(String bundleId, java.util.List<String> entries) {
+		Bundle bundle= Platform.getBundle(bundleId);
+		if (bundle != null) {
+			java.net.URL installLocation= bundle.getEntry("/");
+			java.net.URL local= null;
+			try {
+				local= Platform.asLocalURL(installLocation);
+			} catch (java.io.IOException e) {
+				e.printStackTrace();
+			}
+			
+			String baseLocation = local.getFile();
+
+			try {
+				String requires = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
+				ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, requires);
+				
+				for (int i=0; elements != null && i < elements.length; i++) {
+					
+					String path=baseLocation+elements[i].getValue();
+					
+					// Check if path is for a Jar and that the
+					// file exists - if not see if a classes
+					// directory exists
+					if (path.endsWith(".jar")) {
+						
+						if ((new File(path)).exists() == false) {
+							if ((new File(baseLocation+"classes")).exists()) {
+								path = baseLocation+"classes";
+							}
+						}
+					}
+					
+					if (entries.contains(path) == false) {
+						if (logger.isLoggable(Level.FINE)) {
+							logger.fine("Adding classpath entry '"+
+									path+"'");
+						}
+						entries.add(path);
+						
+						if (elements[i].getValue().equals(".")) {
+							if ((new File(baseLocation+"classes")).exists()) {
+								path = baseLocation+"classes";
+								
+								entries.add(path);
+							}
+						}
+					}
+				}
+				
+				if (elements == null) {
+					if (logger.isLoggable(Level.FINE)) {
+						logger.fine("Adding classpath entry '"+
+								baseLocation+"'");
+					}
+					entries.add(baseLocation);
+				}
+				
+				/*
+				requires = (String)bundle.getHeaders().get(Constants.REQUIRE_BUNDLE);
+			    elements = ManifestElement.parseHeader(Constants.REQUIRE_BUNDLE, requires);
+
+				for (int i=0; recursive &&
+						elements != null && i < elements.length; i++) {
+					buildClasspathEntries(elements[i].getValue(),
+							entries, false);
+				}
+				*/
+				
+			} catch(Exception e) {
+				logger.severe("Failed to construct classpath: "+e);
+				e.printStackTrace();
+			}
+		}
+	}
+
+	private static Logger logger = Logger.getLogger("org.savara.tools.monitor.eclipse");
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorMainTab.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorMainTab.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorMainTab.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,516 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+/**
+ * This class represents the first main tab within the tab group
+ * associated with the monitor launch configuration.
+ */
+public class MonitorMainTab extends AbstractLaunchConfigurationTab {
+	
+	/**
+	 * @see ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createControl(Composite parent) {		
+		Composite comp = new Composite(parent, SWT.NONE);
+		setControl(comp);
+
+		GridLayout topLayout = new GridLayout();
+		topLayout.numColumns= 3;
+		comp.setLayout(topLayout);		
+		
+		Label label = new Label(comp, SWT.NONE);
+		GridData gd = new GridData();
+		gd.horizontalSpan = 3;
+		label.setLayoutData(gd);
+		
+		createChoreographySection(comp);
+		
+		label = new Label(comp, SWT.NONE);
+		gd = new GridData();
+		gd.horizontalSpan = 3;
+		label.setLayoutData(gd);
+		
+		Dialog.applyDialogFont(comp);
+		validatePage();
+	}
+	
+	/**
+	 * This method creates the GUI components for the
+	 * monitor tab.
+	 * 
+	 * @param comp The composite
+	 */
+	protected void createChoreographySection(Composite comp) {
+		GridData gd = new GridData();
+		gd.horizontalSpan = 3;
+		
+		m_projectLabel = new Label(comp, SWT.NONE);
+		m_projectLabel.setText("Project");
+		gd= new GridData();
+		gd.horizontalIndent = 25;
+		m_projectLabel.setLayoutData(gd);
+		
+		m_project= new Text(comp, SWT.SINGLE | SWT.BORDER);
+		m_project.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		m_project.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent evt) {
+				validatePage();
+				updateLaunchConfigurationDialog();				
+				m_choreographySearch.setEnabled(m_project.getText().length() > 0);
+			}
+		});
+			
+		m_projectButton = new Button(comp, SWT.PUSH);
+		m_projectButton.setText("Browse");
+		m_projectButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent evt) {
+				handleProjectButtonSelected();
+			}
+		});
+		setButtonGridData(m_projectButton);
+		
+		m_choreographyLabel = new Label(comp, SWT.NONE);
+		gd = new GridData();
+		gd.horizontalIndent = 25;
+		m_choreographyLabel.setLayoutData(gd);
+		m_choreographyLabel.setText("Choreography");
+		
+		m_choreography = new Text(comp, SWT.SINGLE | SWT.BORDER);
+		m_choreography.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		m_choreography.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent evt) {
+				validatePage();
+				updateLaunchConfigurationDialog();
+			}
+		});
+		
+		m_choreographySearch = new Button(comp, SWT.PUSH);
+		m_choreographySearch.setEnabled(m_project.getText().length() > 0);		
+		m_choreographySearch.setText("Search");
+		m_choreographySearch.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent evt) {
+				handleSearchButtonSelected();
+			}
+		});
+		setButtonGridData(m_choreographySearch);
+	}
+
+	protected static Image createImage(String path) {
+		return null;
+	}
+
+
+	/**
+	 * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
+	 */
+	public void initializeFrom(ILaunchConfiguration config) {
+		String projectName= "";
+		String choreography= "";
+
+		try {
+			projectName = config.getAttribute(MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
+		} catch (CoreException ce) {
+		}
+		m_project.setText(projectName);
+		
+		try {
+			choreography = config.getAttribute(MonitorLaunchConfigurationConstants.ATTR_CHOREOGRAPHY_DESCRIPTION, ""); //$NON-NLS-1$
+		} catch (CoreException ce) {			
+		}
+		m_choreography.setText(choreography);
+	}
+
+	/**
+	 * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
+	 */
+	public void performApply(ILaunchConfigurationWorkingCopy config) {
+	}
+
+	/**
+	 * @see ILaunchConfigurationTab#dispose()
+	 */
+	public void dispose() {
+		super.dispose();
+	}
+
+	/**
+	 * @see AbstractLaunchConfigurationTab#getImage()
+	 */
+	public Image getImage() {
+		return(null);
+	}
+
+	/**
+	 * This method sets the grid data for the button.
+	 * 
+	 * @param button The button
+	 */
+	protected void setButtonGridData(Button button) {
+		GridData gridData= new GridData();
+		button.setLayoutData(gridData);
+		//SWTUtil.setButtonDimensionHint(button);
+	}
+
+	/**
+	 * Show a dialog that lists all choreography files within the
+	 * selected project
+	 */
+	protected void handleSearchButtonSelected() {
+		
+		IProject project = getProject();
+
+		ILabelProvider labelProvider=new LabelProvider() {
+			public String getText(Object obj) {
+				String ret="<unknown>";
+				if (obj instanceof IResource) {
+					String filename=((IResource)obj).getName();
+					if (filename.endsWith(org.pi4soa.cdl.CDLDefinitions.CDL_FILE_EXTENSION)) {
+						filename = filename.substring(0, filename.length()-
+								org.pi4soa.cdl.CDLDefinitions.CDL_FILE_EXTENSION.length()-1);
+					}
+					ret = filename+" ["+
+						((IResource)obj).getParent().
+						getProjectRelativePath()+"]";
+				}
+				return(ret);
+			}
+		};
+		
+		IResource[] choreos=null;
+		
+		if (project.exists() == false) {
+			choreos = new IResource[0];
+		} else {
+			choreos = getChoreographies(project);
+		}
+
+		ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
+		dialog.setTitle("Choreographies");
+		dialog.setMessage("Select the relevant choreography");
+		dialog.setElements(choreos);
+		
+		if (dialog.open() == Window.OK) {			
+			IResource file=(IResource)dialog.getFirstResult();
+			m_choreography.setText(file.getProjectRelativePath().toString());
+		}
+	}
+	
+	/**
+	 * This method returns the list of choreography resource files within
+	 * the supplied project.
+	 * 
+	 * @param project The project
+	 * @return The list of choreography resource files
+	 */
+	protected IResource[] getChoreographies(IProject project) {
+		IResource[] ret=null;
+		final java.util.Vector list=new java.util.Vector();
+		
+		try {
+			project.accept(new org.eclipse.core.resources.IResourceVisitor() {
+				public boolean visit(IResource res) {
+
+					if (res.getFileExtension() != null &&
+							res.getFileExtension().equals(
+									org.pi4soa.cdl.CDLDefinitions.CDL_FILE_EXTENSION)) {
+						list.add(res);
+					}
+
+					return(true);
+				}
+			});
+			
+			ret = new IResource[list.size()];
+			list.copyInto(ret);
+			
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+		
+		return(ret);
+	}
+		
+	/**
+	 * Show a dialog that lets the user select a project.  This in turn provides
+	 * context for the main type, allowing the user to key a main type name, or
+	 * constraining the search for main types to the specified project.
+	 */
+	protected void handleProjectButtonSelected() {
+		IProject project = chooseProject();
+		if (project == null) {
+			return;
+		}
+		
+		String projectName = project.getName();
+		m_project.setText(projectName);		
+	}
+	
+	/**
+	 * Realize a Java Project selection dialog and return the first selected project,
+	 * or null if there was none.
+	 */
+	protected IProject chooseProject() {
+		IProject[] projects;
+		try {
+			projects= getWorkspaceRoot().getProjects();
+		} catch (Exception e) {
+			projects= new IProject[0];
+		}
+		
+		ILabelProvider labelProvider=new LabelProvider() {
+			public String getText(Object obj) {
+				String ret="<unknown>";
+				if (obj instanceof IResource) {
+					ret = ((IResource)obj).getName();
+				}
+				return(ret);
+			}
+		};
+
+		ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
+		dialog.setTitle("Projects");
+		dialog.setMessage("Select the relevant project");
+		dialog.setElements(projects);
+		
+		IProject project = getProject();
+		if (project != null) {
+			dialog.setInitialSelections(new Object[] { project });
+		}
+		if (dialog.open() == Window.OK) {			
+			return (IProject) dialog.getFirstResult();
+		}			
+		return null;		
+	}
+	
+	/**
+	 * Return the IProject corresponding to the project name in the project name
+	 * text field, or null if the text does not match a project name.
+	 */
+	protected IProject getProject() {
+		String projectName = m_project.getText().trim();
+		if (projectName.length() < 1) {
+			return null;
+		}
+		return(getWorkspaceRoot().getProject(projectName));
+	}
+	
+	/**
+	 * Convenience method to get the workspace root.
+	 */
+	private IWorkspaceRoot getWorkspaceRoot() {
+		return ResourcesPlugin.getWorkspace().getRoot();
+	}
+	
+	/**
+	 * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
+	 */
+	public boolean isValid(ILaunchConfiguration config) {		
+		return getErrorMessage() == null;
+	}
+	
+	/**
+	 * This method validates the page.
+	 *
+	 */
+	private void validatePage() {
+		setErrorMessage(null);
+		setMessage(null);
+		
+		String projectName = m_project.getText().trim();
+		if (projectName.length() == 0) {
+			setErrorMessage("Project name not specified");
+			return;
+		}
+			
+		IProject project = getWorkspaceRoot().getProject(projectName);
+		if (!project.exists()) {
+			setErrorMessage("Project '"+projectName+"' does not exist");
+			return;
+		}
+		
+		try {
+			String choreographyName = m_choreography.getText().trim();
+			if (choreographyName.length() == 0) {
+				setErrorMessage("Choreography has not been defined");
+				return;
+			}
+			IResource resource = project.findMember(choreographyName);
+			if (resource == null) {
+				setErrorMessage("Could not find choreography '"+choreographyName+"'");
+			} else {
+				
+				// TODO: Check is valid choreography model
+			}
+		} catch (Exception e) {
+		}
+	}
+
+	/**
+	 * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
+	 */
+	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+		
+		IResource resource = getContext();
+		if (resource != null) {
+			initializeProject(resource, config);
+		} else {
+			config.setAttribute(MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+			config.setAttribute(MonitorLaunchConfigurationConstants.ATTR_CHOREOGRAPHY_DESCRIPTION, "");
+		}
+		initializeTestAttributes(resource, config);
+	}
+
+	/**
+	 * This method identifies the context associated with the
+	 * monitor.
+	 * 
+	 * @return The context resource
+	 */
+	protected IResource getContext() {
+		IResource ret=null;
+		IWorkbenchPage page =
+			org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+				
+		if (page != null) {
+			ISelection selection = page.getSelection();
+			if (selection instanceof IStructuredSelection) {
+				IStructuredSelection ss = (IStructuredSelection)selection;
+				if (!ss.isEmpty()) {
+					Object obj = ss.getFirstElement();
+					if (obj instanceof IResource) {
+						ret = (IResource)obj;
+					}
+				}
+			}
+			
+			if (ret == null) {
+				IEditorPart part = page.getActiveEditor();
+				if (part != null) {
+					IEditorInput input = part.getEditorInput();
+					ret =(IResource)input.getAdapter(IResource.class);
+				}
+			}
+		}
+		
+		return(ret);
+	}
+
+	/**
+	 * This method initializes the project details.
+	 * 
+	 * @param resource The resource
+	 * @param config The configuration
+	 */
+	protected void initializeProject(IResource resource, ILaunchConfigurationWorkingCopy config) {
+		IProject project = resource.getProject();
+		String name = null;
+		if (project != null && project.exists()) {
+			name = project.getName();
+		}
+		config.setAttribute(MonitorLaunchConfigurationConstants.ATTR_PROJECT_NAME, name);
+	}
+	
+	/**
+	 * This method initializes the choreography details.
+	 * 
+	 * @param resource The selected resource
+	 * @param config The configuration
+	 */
+	private void initializeTestAttributes(IResource resource, ILaunchConfigurationWorkingCopy config) {
+		if (resource != null && (resource.getType() == IResource.FOLDER ||
+				(resource.getType() == IResource.FILE &&
+				resource.getFileExtension().equals(
+						org.pi4soa.cdl.CDLDefinitions.CDL_FILE_EXTENSION)))) {
+			
+			config.setAttribute(MonitorLaunchConfigurationConstants.ATTR_CHOREOGRAPHY_DESCRIPTION,
+					resource.getProjectRelativePath().toString());
+		
+			initializeName(config, resource.getName());
+		}
+	}
+
+	/**
+	 * This method initializes the launch configuration name.
+	 * 
+	 * @param config The configuration
+	 * @param name The name
+	 */
+	private void initializeName(ILaunchConfigurationWorkingCopy config, String name) {
+		if (name == null) {
+			name= "";
+		}
+		if (name.length() > 0) {
+			
+			int index = name.lastIndexOf('.');
+			if (index > 0) {
+				name = name.substring(0, index);
+			}
+			name= getLaunchConfigurationDialog().generateName(name);
+			config.rename(name);
+		}
+	}
+
+	/**
+	 * @see ILaunchConfigurationTab#getName()
+	 */
+	public String getName() {
+		return("Monitor");
+	}
+
+	private Label m_projectLabel=null;
+	private Text m_project=null;
+	private Button m_projectButton=null;
+	private Label m_choreographyLabel=null;
+	private Text m_choreography=null;
+	private Button m_choreographySearch=null;	
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorTabGroup.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorTabGroup.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/eclipse/MonitorTabGroup.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.savara.tools.monitor.eclipse;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+
+/**
+ * This class represents the UI tab group for the Scenario Test
+ * launcher.
+ */
+public class MonitorTabGroup extends
+			AbstractLaunchConfigurationTabGroup {
+
+	/**
+	 * The default constructor for the scenario type tab group.
+	 */
+	public MonitorTabGroup() {
+	}
+
+	/**
+	 * This method creates the tabs for the scenario test launch
+	 * configuration.
+	 * 
+	 * @param dialog The launch configuration dialog
+	 * @param mode The mode
+	 */
+	public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+		ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+			new MonitorMainTab(),
+			new JavaJRETab(),
+			new CommonTab()
+		};
+		setTabs(tabs);
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferencePage.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferencePage.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferencePage.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-10 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 30 March 2010 : Initial version created by gary
+ */
+package org.savara.tools.monitor.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By 
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to 
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class MonitorPreferencePage
+	extends FieldEditorPreferencePage
+	implements IWorkbenchPreferencePage {
+
+	public MonitorPreferencePage() {
+		super(GRID);
+		setPreferenceStore(org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore());
+		setDescription("Preferences for the SAVARA Choreography Monitor");
+	}
+	
+	/**
+	 * Creates the field editors. Field editors are abstractions of
+	 * the common GUI blocks needed to manipulate various types
+	 * of preferences. Each field editor knows how to save and
+	 * restore itself.
+	 */
+	public void createFieldEditors() {
+		addField(new PathEditor(
+				MonitorPreferences.MONITOR_LIBRARIES,
+				"&Library Paths", "Library paths required to monitor target platform", getFieldEditorParent()));
+		
+		addField(new StringFieldEditor(MonitorPreferences.JNDI_FACTORY_INITIAL,
+				"JNDI Initial Context Factory", getFieldEditorParent()));
+		addField(new StringFieldEditor(MonitorPreferences.JNDI_PROVIDER_URL,
+				"JNDI Provider URL", getFieldEditorParent()));
+		addField(new StringFieldEditor(MonitorPreferences.JNDI_FACTORY_URL_PKGS,
+				"JNDI Factory URL Packages", getFieldEditorParent()));
+		addField(new StringFieldEditor(MonitorPreferences.JMS_FACTORY,
+				"JMS Connection Factory", getFieldEditorParent()));
+		addField(new StringFieldEditor(MonitorPreferences.JMS_DESTINATION,
+				"JMS Destination", getFieldEditorParent()));
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+	}
+	
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferences.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferences.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/MonitorPreferences.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tools.monitor.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class MonitorPreferences {
+
+	public static final String MONITOR_LIBRARIES="savara.monitor.libraries";
+	public static final String JNDI_FACTORY_INITIAL="savara.monitor.jndi.factory.initial";
+	public static final String JNDI_PROVIDER_URL="savara.monitor.jndi.provider.url";
+	public static final String JNDI_FACTORY_URL_PKGS="savara.monitor.jndi.factory.url.pkgs";
+	public static final String JMS_FACTORY="savara.monitor.jms.factory";
+	public static final String JMS_DESTINATION="savara.monitor.jms.destination";
+	
+	public static String getLibraryPaths() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(MONITOR_LIBRARIES));
+	}
+	
+	public static boolean isLibraryPathsDefined() {
+		boolean ret=false;
+		
+		IPreferenceStore prefs=
+			org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		String paths=prefs.getString(MONITOR_LIBRARIES);
+		
+		if (paths != null && paths.length() > 0) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+
+	public static String getJNDIFactoryInitial() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(JNDI_FACTORY_INITIAL));
+	}
+	
+
+	public static String getJNDIProviderURL() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(JNDI_PROVIDER_URL));
+	}
+
+	public static String getJNDIFactoryURLPackages() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(JNDI_FACTORY_URL_PKGS));
+	}
+
+	public static String getJMSFactory() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(JMS_FACTORY));
+	}
+
+	public static String getJMSDestination() {
+		IPreferenceStore prefs=
+				org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(JMS_DESTINATION));
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/PreferenceInitializer.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/PreferenceInitializer.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/preferences/PreferenceInitializer.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.tools.monitor.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+	 */
+	public void initializeDefaultPreferences() {
+		IPreferenceStore store = org.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		store.setDefault(MonitorPreferences.JNDI_FACTORY_INITIAL, "org.jnp.interfaces.NamingContextFactory");
+		store.setDefault(MonitorPreferences.JNDI_PROVIDER_URL, "jnp://localhost:1099");
+		store.setDefault(MonitorPreferences.JNDI_FACTORY_URL_PKGS, "org.jboss.naming:org.jnp.interfaces");
+		store.setDefault(MonitorPreferences.JMS_FACTORY, "ConnectionFactory");
+		store.setDefault(MonitorPreferences.JMS_DESTINATION, "topic/tracker");
+	}
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ChannelJPanel.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ChannelJPanel.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ChannelJPanel.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,558 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.logging.Logger;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.pi4soa.service.Identity;
+import org.pi4soa.service.correlator.CorrelationSession;
+
+
+/**
+ * The left hand pane contains a tree whose root is the
+ * choreography, and whose leaves are channels and transactions.
+ *
+ * Selecting a channel filters the exchange events list (or should
+ * do).
+ */
+public class ChannelJPanel extends JPanel{
+
+    public final static String UNEXPECTED_MESSAGES_NAME = "Unexpected Messages";
+    public final static String ERROR_NAME="Errors";
+    public final static String WARNING_NAME="Warnings";
+    public final static String INFORMATION_NAME="Information";
+    
+    private static Logger 	logger = Logger.getLogger("org.savara.tools.monitor.ui");
+  
+    JTree 					tree = null;
+    TreeSelectionListener 	listener = null;
+    JScrollPane 			treeView = null;
+
+    ImageIcon 				channelLeafIcon = null;
+    ImageIcon 				channelOpenIcon = null;
+    ImageIcon 				channelClosedIcon = null;
+    ImageIcon 				channelEmptyIcon = null;
+    ImageIcon 				errorsLeafIcon = null;
+    ImageIcon 				unexpectedLeafIcon = null;
+    ImageIcon 				warningsLeafIcon = null;
+    ImageIcon 				issuesOpenIcon = null;
+    ImageIcon 				issuesClosedIcon = null;
+    ImageIcon 				issuesEmptyIcon = null;
+    ImageIcon 				txnLeafIcon = null;
+    ImageIcon 				txnOpenIcon = null;
+    ImageIcon 				txnClosedIcon = null;
+    ImageIcon 				txnEmptyIcon = null;
+    
+    //    Vector exchangeEvents = null;
+    ExchangeEventsData 		exchangeEventsData = null;
+    
+    DefaultTreeModel 		treeModel = null;
+    DefaultMutableTreeNode 	rootNode = null;
+    
+    //DefaultMutableTreeNode  channelRoot = null;
+    DefaultMutableTreeNode  issuesRoot = null;
+    DefaultMutableTreeNode  errorsRoot = null;
+    DefaultMutableTreeNode  warningsRoot = null;
+    DefaultMutableTreeNode  unexpectedMessagesRoot = null;
+    DefaultMutableTreeNode  sessionRoot = null;
+    
+    String	sessionRootName = "Sessions";
+    String	channelRootName = "Channels";
+    String	unexpectedMessagesRootName = UNEXPECTED_MESSAGES_NAME;
+    String 	errorsRootName = ERROR_NAME;
+    String 	warningsRootName = WARNING_NAME;
+    String 	issuesRootName = "Issues";
+    
+
+
+    /**
+     * Creates a new ChannelJPanel.
+     *
+     * @param listener The listener for tree selection changes.
+     */
+    public ChannelJPanel(TreeSelectionListener listener){
+
+        this.listener = listener;
+        this.setBackground(Color.white);
+        this.setLayout(new BorderLayout());
+    }
+    
+    public ChannelJPanel(ExchangeEventsData eed, TreeSelectionListener listener){
+        this.listener = listener;
+        this.setBackground(Color.white);
+        this.setLayout(new BorderLayout());
+        exchangeEventsData = eed;
+    }
+
+    ////////////////////////////////////////////
+
+    static public String getUnexpectedMessagesName()
+    {	
+    	return UNEXPECTED_MESSAGES_NAME;
+    }
+    
+    static public String getErrorName() {
+    	return(ERROR_NAME);
+    }
+    
+    static public String getWarningName() {
+    	return(WARNING_NAME);
+    }
+    
+    static public String getInformationName() {
+    	return(INFORMATION_NAME);
+    }
+    
+    public void addedSession(CorrelationSession s)
+    {
+    	logger.fine("ADD SESSION TO PANEL " + s);
+    	logger.fine("rootNote child count is: " + rootNode.getChildCount());
+    	String name = ChannelJPanel.getSessionIdentity(s);
+    	if (name == null)
+    	{
+    		name = "Session :" + s.toString().substring(s.getClass().getName().length());
+    	}
+		logger.info("ADDING SESSION FOR TXN: " + name);
+		
+		addObject(sessionRoot,new ProxyTreeNode(name, s),true);
+    }
+     
+    static public String getSessionIdentity(CorrelationSession s)
+    {
+    	String identityString = null;
+    	java.util.List<Identity> messageIdentityArray = s.getIdentities();
+    	if (messageIdentityArray != null)
+    		logger.info("sessionIdentArray length is: " + messageIdentityArray.size());
+    	else
+    		logger.info("messageIdentityArray was null");
+        if(messageIdentityArray == null || messageIdentityArray.size() == 0)
+        {
+                return identityString;
+        } else {
+                Identity firstMessageIdentity = messageIdentityArray.get(0);
+                //                    messageIdentityString = firstMessageIdentity.toText();
+                String tokens[] = firstMessageIdentity.getTokens();
+                // value
+                Object values_obj[] = firstMessageIdentity.getValues();
+                
+                String[] values = new String[values_obj.length];
+                
+                for (int values_index=0; values_index < values_obj.length; values_index++)
+                {
+                	values[values_index] = values_obj[values_index].toString();
+                	if (values_obj[values_index] instanceof String) 
+                	{
+                	    values[values_index] = (String)values_obj[values_index];
+                	} 
+                	else if (values_obj[values_index] instanceof java.util.List) 
+                	{
+                		java.util.List list = (java.util.List)values_obj[values_index];
+                	    values[values_index] = "{";
+                	    for (int i=0; (i < list.size()); i++ ) 
+                	    {
+                	    	values[values_index] += (String)list.get(i);
+                	    }
+                	    values[values_index] += "}";
+                	} else {
+                		logger.severe("Problem creating an identity string, values is of unknown type.");
+                	}
+
+                }
+
+                if(tokens == null || values == null)
+                {
+                    if(tokens == null)
+                    {
+                        logger.fine("identity.getTokens() returned null");
+                        //                        messageIdentityString = "null tokens";
+                    }
+
+                    if(values == null)
+                    {
+                        logger.fine("identity.getValues() returned null");
+                        //                        messageIdentityString = "null values";
+                    }
+
+                    identityString = firstMessageIdentity.toString();
+                } else {
+                    if(tokens != null && values != null && tokens.length == values.length)
+                    {
+                        identityString = "";
+                        for(int i = 0; i < tokens.length - 1; i++)
+                        {
+                            identityString += values[i] + " (" + tokens[i] + "), ";
+                        }
+                        identityString += values[tokens.length - 1] + " (" + tokens[tokens.length - 1]+")";
+                    } else {
+                        identityString = "tokens/values mismatch";
+                    }
+                }
+        }
+        
+        return identityString;
+    }
+    
+    /**
+     * Adds the channel nodes to the tree, sorted in name order.
+     */
+    public void createAndAddTree(org.pi4soa.cdl.Package choreography){        
+        if(tree != null){
+            // remove the current tree ...
+            this.remove(treeView);
+            treeView = null;
+            tree = null;
+        }
+        
+        rootNode = new DefaultMutableTreeNode(choreography.getName());
+    	if (treeModel == null){
+    		treeModel = new DefaultTreeModel(rootNode);
+    		treeModel.addTreeModelListener(new MonitorTreeModelListener());
+    	}
+    	
+        createChannelNodes(treeModel, choreography);
+
+        tree = new JTree(treeModel); // instead of rootNode instead of treeModel
+        ChannelTreeCellRenderer renderer = new ChannelTreeCellRenderer();
+
+        if(txnLeafIcon == null) txnLeafIcon = MonitorMainPanel.createImageIcon("icons/txnleaf.png");
+        if(txnOpenIcon == null) txnOpenIcon = MonitorMainPanel.createImageIcon("icons/txnopen.png");
+        if(txnClosedIcon == null) txnClosedIcon = MonitorMainPanel.createImageIcon("icons/txnclosed.png");
+        if(txnEmptyIcon == null) txnEmptyIcon = MonitorMainPanel.createImageIcon("icons/txnempty.png");
+        if(channelLeafIcon == null) channelLeafIcon = MonitorMainPanel.createImageIcon("icons/channelleaf.png");
+        if(channelOpenIcon == null) channelOpenIcon = MonitorMainPanel.createImageIcon("icons/channelopen.png");
+        if(channelClosedIcon == null) channelClosedIcon = MonitorMainPanel.createImageIcon("icons/channelclosed.png");
+        if(channelEmptyIcon == null) channelEmptyIcon = MonitorMainPanel.createImageIcon("icons/channelempty.png");
+        if(errorsLeafIcon == null) errorsLeafIcon = MonitorMainPanel.createImageIcon("icons/errorsleaf.png");
+        if(warningsLeafIcon == null) warningsLeafIcon = MonitorMainPanel.createImageIcon("icons/warningsleaf.png");
+        if(unexpectedLeafIcon == null) unexpectedLeafIcon = MonitorMainPanel.createImageIcon("icons/unexpectedleaf.png");
+        if(issuesOpenIcon == null) issuesOpenIcon = MonitorMainPanel.createImageIcon("icons/issuesopen.png");
+        if(issuesClosedIcon == null) issuesClosedIcon = MonitorMainPanel.createImageIcon("icons/issuesclosed.png");
+        if(issuesEmptyIcon == null) issuesEmptyIcon = MonitorMainPanel.createImageIcon("icons/issuesempty.png");
+
+        tree.setCellRenderer(renderer);
+        
+        tree.setRootVisible(false);
+
+        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+
+        // Listen for when the selection changes.
+        tree.addTreeSelectionListener(listener);
+
+        treeView = new JScrollPane(this.tree);
+        this.add(treeView, BorderLayout.CENTER);
+
+        // hack.
+        this.revalidate();
+    }
+    
+    /**
+     * Adds the channel nodes to the tree, sorted in name order.
+     */
+    private void createChannelNodes(DefaultTreeModel t, org.pi4soa.cdl.Package choreography){
+
+        issuesRoot = addObject(null, issuesRootName);
+        unexpectedMessagesRoot = addObject(issuesRoot,unexpectedMessagesRootName); // was nullChannel
+        errorsRoot = addObject(issuesRoot,errorsRootName); // was nullChannel
+        warningsRoot = addObject(issuesRoot,warningsRootName); // was nullChannel
+
+        sessionRoot = addObject(null,sessionRootName); // was sessionRoot   
+    	    	
+    	logger.fine("createChannelNodes(new)");
+    	
+    	//channelRoot = addObject(null,channelRootName); // was channelRoot
+
+        org.pi4soa.cdl.TypeDefinitions typeDefinitions = choreography.getTypeDefinitions();
+        org.eclipse.emf.common.util.EList channelTypes = typeDefinitions.getChannelTypes();
+
+        // we would like to sort the list of channels first
+
+        org.eclipse.emf.common.util.ECollections.sort(channelTypes, new Comparator() {
+                public int compare(Object o1, Object o2) {
+                    return ((org.pi4soa.cdl.ChannelType) o1).getName().compareTo(
+                                             ((org.pi4soa.cdl.ChannelType) o2).getName()
+                                             );
+                }
+            });
+
+        /*
+        Iterator listIterator = channelTypes.iterator();
+        while(listIterator.hasNext()){
+            org.pi4soa.cdl.ChannelType channelType = (org.pi4soa.cdl.ChannelType) listIterator.next();
+            ProxyTreeNode node = new ProxyTreeNode(channelType.getName(),
+            					channelType);
+            logger.fine("Adding channel type to tree: " + channelType.getName());
+            addObject(channelRoot,node);
+        }
+        */
+    }
+    
+    
+    /** Add child to the currently selected node. */
+    public DefaultMutableTreeNode addObject(Object child) {
+    	logger.fine("addObject " + child.toString() + " to child");
+        DefaultMutableTreeNode parentNode = null;
+        TreePath parentPath = tree.getSelectionPath();
+
+        if (parentPath == null) {
+            parentNode = rootNode;
+        } else {
+            parentNode = (DefaultMutableTreeNode)
+                         (parentPath.getLastPathComponent());
+        }
+
+        return addObject(parentNode, child, true);
+    }
+
+    public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
+                                            Object child) {
+    	logger.fine("addObject " + child.toString() + " to parent");
+        return addObject(parent, child, false);
+    }
+
+    public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
+                                            Object child, 
+                                            boolean shouldBeVisible) {
+    	logger.fine("addObject " + child.toString() + " to parent with visibility " + shouldBeVisible);
+        DefaultMutableTreeNode childNode = 
+                new DefaultMutableTreeNode(child);
+
+        if (parent == null) {
+            parent = rootNode;
+        }
+
+        treeModel.insertNodeInto(childNode, parent, 
+                                 parent.getChildCount());
+
+        //Make sure the user can see the lovely new node.
+        if (shouldBeVisible) {
+            tree.scrollPathToVisible(new TreePath(childNode.getPath()));
+        }
+        return childNode;
+    }
+
+
+    /**
+     * Adds the channel nodes to the tree, sorted in name order.
+     */
+    public void setChannelSelectionOn(boolean channelSelection){
+        if(channelSelection == true){
+            tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        }
+        else{
+
+        }
+    }
+
+
+    /**
+     *
+     */
+    public JTree getTree(){
+        return tree;
+    }
+
+
+    /**
+     *
+     */
+    public void redraw(){
+        tree.setSelectionPaths(tree.getSelectionPaths());
+        tree.revalidate();
+        tree.repaint();
+    }
+    
+    public class ProxyTreeNode {
+    	
+    	public ProxyTreeNode(String label, Object obj) {
+    		m_label = label;
+    		m_object = obj;
+    	}
+    	
+    	public String getLabel() {
+    		return(m_label);
+    	}
+    	
+    	public Object getObject() {
+    		return(m_object);
+    	}
+    	
+    	public String toString() {
+    		return(m_label);
+    	}
+    	
+    	private String m_label=null;
+    	private Object m_object=null;
+    }
+    
+    public class ChannelTreeCellRenderer extends DefaultTreeCellRenderer{
+
+        private Color originalTextNonSelectionColor = null;
+        private Color originalTextSelectionColor = null;
+
+        /**
+         *
+         */
+        public Component getTreeCellRendererComponent(JTree tree,
+                                                      Object value,
+                                                      boolean selected,
+                                                      boolean expanded,
+                                                      boolean leaf,
+                                                      int row,
+                                                      boolean hasFocus){
+        	
+        	logger.fine("getTreeCellRendererComponent(" + value.toString() + ")");
+
+            if(originalTextNonSelectionColor == null) originalTextNonSelectionColor = this.getTextNonSelectionColor();
+            if(originalTextSelectionColor == null) originalTextSelectionColor = this.getTextSelectionColor();
+
+            boolean nodeHasErrors = false;
+            boolean nodeHasWarnings = false;
+            boolean nodeHasUnexpectedMessage = false;
+
+            if(leaf == true){
+                if(exchangeEventsData.getHasErrorsForChannel(value.toString()) == true ||
+                		exchangeEventsData.getHasErrorsForSession(value.toString())) {
+                    nodeHasErrors = true;
+                }
+                else if(exchangeEventsData.getHasWarningsForChannel(value.toString()) == true ||
+                		exchangeEventsData.getHasWarningsForSession(value.toString())) {
+                    nodeHasWarnings = true;
+                }
+                else if (exchangeEventsData.getHasUnexpectedExchangeEventsForChannel(value.toString()) == true ||
+                		exchangeEventsData.getHasUnexpectedExchangeEventsForSession(value.toString())) {
+                	nodeHasUnexpectedMessage = true;
+                }
+            }
+            else{
+                //nodeHasErrors = exchangeEventsData.getHasErrors();
+                //nodeHasWarnings = exchangeEventsData.getHasWarnings();
+                //nodeHasUnexpectedMessage = exchangeEventsData.getHasUnexpectedMessages();
+            }
+
+            //
+            // Sets the left panel colors
+            //
+            if(nodeHasErrors == true){
+            	logger.fine("hasErrors - dark red");
+                this.setTextNonSelectionColor(Color.red.darker());
+                this.setTextSelectionColor(Color.red.darker());
+            }
+            else if(nodeHasWarnings == true){
+            	logger.fine("hasWarnings - orange");
+                this.setTextNonSelectionColor(Color.orange);
+                this.setTextSelectionColor(Color.orange);
+            }
+            else if (nodeHasUnexpectedMessage == true) {
+            	logger.fine("hasUnexpectedMessages - red");
+                this.setTextNonSelectionColor(Color.red);
+                this.setTextSelectionColor(Color.red);            	
+            }
+            else{
+            	logger.fine("hasOkay");
+                this.setTextNonSelectionColor(originalTextNonSelectionColor);
+                this.setTextSelectionColor(originalTextSelectionColor);
+            }
+
+            if (value instanceof DefaultMutableTreeNode) {
+                m_lastValue = ((DefaultMutableTreeNode)value).getUserObject();
+            } else {
+                m_lastValue = value;
+            }
+            
+            return super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+        }
+
+        public Icon getOpenIcon() {
+        	Icon ret=super.getOpenIcon();
+        	
+        	if (m_lastValue.toString().equals(sessionRootName)) {
+        		ret = txnOpenIcon;
+        	} else if (m_lastValue.toString().equals(channelRootName)) {
+        		ret = channelOpenIcon;
+        	} else if (m_lastValue.toString().equals(issuesRootName)) {
+        		ret = issuesOpenIcon;
+        	}
+        	
+        	logger.info("Returning open icon for "+m_lastValue);
+        	return(ret);
+        }
+
+        public Icon getClosedIcon() {
+        	Icon ret=super.getClosedIcon();
+
+        	if (m_lastValue.toString().equals(sessionRootName)) {
+        		ret = txnClosedIcon;
+        	} else if (m_lastValue.toString().equals(channelRootName)) {
+        		ret = channelClosedIcon;
+        	} else if (m_lastValue.toString().equals(issuesRootName)) {
+        		ret = issuesClosedIcon;
+        	}
+        	
+        	logger.info("Returning closed icon for "+m_lastValue);
+        	return(ret);
+        }
+
+        public Icon getLeafIcon() {
+        	Icon ret=super.getLeafIcon();
+
+        	if (m_lastValue instanceof ProxyTreeNode) {
+        		if (((ProxyTreeNode)m_lastValue).getObject() instanceof CorrelationSession) {
+        			ret = txnLeafIcon;
+        		} else if (((ProxyTreeNode)m_lastValue).getObject()
+        					instanceof org.pi4soa.cdl.ChannelType) {
+        			ret = channelLeafIcon;
+        		}
+        	} else if (m_lastValue.toString().equals(sessionRootName)) {
+        		ret = txnEmptyIcon;
+        	} else if (m_lastValue.toString().equals(channelRootName)) {
+        		ret = channelEmptyIcon;
+        	} else if (m_lastValue.toString().equals(unexpectedMessagesRootName)) {
+        		ret = unexpectedLeafIcon;
+        	} else if (m_lastValue.toString().equals(errorsRootName)) {
+        		ret = errorsLeafIcon;
+        	} else if (m_lastValue.toString().equals(warningsRootName)) {
+        		ret = warningsLeafIcon;
+        	}
+        	logger.info("Returning leaf icon for "+m_lastValue+" of type "+m_lastValue.getClass());
+        	return(ret);
+        }
+        
+        private Object m_lastValue=null;
+    }
+    
+}
+

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventWrapper.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventWrapper.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventWrapper.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,797 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+
+import org.pi4soa.cdl.Interaction;
+import org.pi4soa.cdl.RoleType;
+import org.pi4soa.cdl.Variable;
+
+import org.pi4soa.service.Message;
+import org.pi4soa.service.Identity;
+
+import org.pi4soa.service.correlator.CorrelationSession;
+import org.savara.tools.monitor.ExchangeEvent;
+
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.ObjectInputStream;
+import java.util.logging.Logger;
+
+
+
+/**
+ *
+ */
+public class ExchangeEventWrapper implements Serializable{
+	
+    Integer index = null;
+
+    String realSessionName = null;
+    String sessionName = null;
+    String description = null;
+    String toRoleTypeName = null;
+    String fromRoleTypeName = null;
+    String serviceName=null;
+    String sendVariableString = null;
+    String sendVariableTypeString = null;
+    String messageTypeString = "";
+    String messageTypeNoNamespaceString = "";
+    String operationString = null;
+    String messageValueString = null;
+    String exceptionValueString = null;
+    String messageIdentityString = null;
+    String channelType = null;
+    String correlationSessionString = null;
+
+    // don't serialize this one ...
+    transient private ExchangeEvent exchangeEvent = null;
+
+    String status = null;
+    boolean hasFrozenStatus = false;
+
+    boolean hasSetErrorsAndWarnings = false;
+    boolean isError = false;
+    boolean isWarning = false;
+    
+    boolean isErrorMessage=false;
+    boolean isWarningMessage=false;
+    boolean isInformationMessage=false;
+
+    boolean isFault = false;
+    boolean hasSetIsFault = false;
+
+    boolean isRequest;
+    
+    boolean isUnexpected = false;
+    
+    private static Logger logger = Logger.getLogger("org.savara.tools.monitor.ui");
+
+    public ExchangeEventWrapper(CorrelationSession session,
+    		Integer index, String mesgValue, String exception){
+        this.index = index;
+
+        correlationSessionString = (session == null?
+    			"<unknown>":session.toString());
+        
+        setMessageValue(mesgValue);
+        
+        if (messageValueString == null) {
+        	messageValueString = "";
+        }
+        
+       	exceptionValueString = exception;
+        
+        messageIdentityString = "";
+        operationString = "";
+        description = "";
+        sendVariableString="";
+
+        setRealSessionName(session);
+        setSessionName(session);
+    }
+    
+    /**
+     *
+     */
+    public ExchangeEventWrapper(ExchangeEvent event, Integer index){
+        this.index = index;
+        this.exchangeEvent = event;
+
+        correlationSessionString = (event.getCorrelationSession() == null?
+        			"<unknown>":event.getCorrelationSession().toString());
+
+        Message message = exchangeEvent.getMessage();
+        if(message != null){
+        	
+        	if (exchangeEvent.getExchange() != null) {
+        		isRequest = (exchangeEvent.getExchange().getAction()
+        					== org.pi4soa.cdl.ExchangeActionType.REQUEST);
+        	} else {
+        		isRequest = message.isRequest();
+        	}
+            
+            messageTypeString = message.getType();
+            
+            messageTypeNoNamespaceString = 
+            	org.pi4soa.common.xml.NameSpaceUtil.getLocalPart(message.getType());
+
+        }
+        else{
+            logger.fine(">>>> Null message");
+            isRequest = true;
+        }
+
+        setRealSessionName(event.getCorrelationSession());
+        setSessionName(event.getCorrelationSession());
+        setDescription(event);
+        setFromRoleTypeName(event);
+        setToRoleTypeName(event);
+        setSendVariableName(event);
+        setSendVariableTypeName(event);
+        setOperationString(event);
+        setMessageValue(event);
+        setMessageIdentity(event);
+        setChannelType(event);
+    }
+
+    /**
+     *
+     */
+    public Integer getIndex(){ return index; }
+
+
+    /**
+     * 
+     */
+    public String getRealSessionName() { return realSessionName; }
+    public String getSessionName() { return sessionName; }
+    
+    /**
+     * 
+     */
+    public void setRealSessionName(CorrelationSession s){
+    	
+    	if (s == null) {
+    		realSessionName = "Session:unknown";
+    	} else {
+    		realSessionName = "Session:" + s.toString().substring(s.getClass().getName().length());
+    	}
+    	
+    	logger.fine("Set real session name in wrapper: " + realSessionName);
+    }
+    
+    public void setSessionName(CorrelationSession s){
+    	
+    	if (s == null) {
+    		sessionName = "unknown";
+    	} else {
+    		sessionName = ChannelJPanel.getSessionIdentity(s);
+    	}
+    	
+    	logger.fine("Set session name alias in wrapper: " + sessionName);
+    }
+    /**
+     *
+     */
+    public String getDescription(){ return description; }
+
+    /**
+     *
+     */
+    protected void setDescription(ExchangeEvent exchangeEvent){
+        if(exchangeEvent == null || exchangeEvent.getExchange() == null){
+            description = "null exchange";
+        }
+        else{
+            description = exchangeEvent.getExchange().getDescription();
+            if(description != null){
+                String newDescription = description.replaceAll("\\s+", " ");
+                description = newDescription;
+            }
+            else{
+                description = "";
+            }
+        }
+    }
+
+
+    /**
+     *
+     */
+    public String getStatus(){
+        String returnValue = null;
+        if(hasFrozenStatus == true){
+            returnValue = status;
+        } else {
+        	if (exchangeEvent == null) {
+        		returnValue = "";
+        	} else if (exchangeEvent.getChannel() == null) {
+        		returnValue = "Unexpected";
+        	} else if(exchangeEvent.isExchangeComplete()) {
+                returnValue = "Completed";
+            } else{
+                returnValue = "Initiated";
+            }
+        }
+
+        return returnValue;
+    }
+
+
+    /**
+     *
+     */
+    public void freezeStatus(){
+        status = getStatus();
+        hasFrozenStatus = true;
+    }
+
+
+    /**
+     *
+     */
+    public boolean equals(Object object){
+        boolean result = false;
+
+        if (object != null && object instanceof ExchangeEventWrapper) {
+            ExchangeEventWrapper other = (ExchangeEventWrapper) object;
+            if(other.exchangeEvent != null && this.exchangeEvent != null){
+                if(other.exchangeEvent.equals(this.exchangeEvent)){
+                    result = true;
+                }
+            }
+            else{
+                result = other.getDescription().equals(this.getDescription()) &&
+                    other.getFromRoleTypeName().equals(this.getFromRoleTypeName()) &&
+                    other.getToRoleTypeName().equals(this.getToRoleTypeName()) &&
+                    other.getSendVariableName().equals(this.getSendVariableName()) &&
+                    other.getOperationString().equals(this.getOperationString()) &&
+                    other.getMessageValue().equals(this.getMessageValue()) &&
+                    other.getMessageIdentity().equals(this.getMessageIdentity()) &&
+                    other.getChannelType().equals(this.getChannelType());
+            }
+
+        }
+
+        return result;
+    }
+
+
+
+    /**
+     *
+     */
+    public String getFromRoleTypeName(){
+    	if (exchangeEvent == null || exchangeEvent.getChannel() == null)
+    	{
+    		return(""); // "Unknown From Role";
+    	}
+        if(isRequest){
+            return fromRoleTypeName;
+        }
+        else{
+            return toRoleTypeName;
+        }
+    }
+
+
+    /**
+     *
+     */
+    protected void setFromRoleTypeName(ExchangeEvent exchangeEvent){
+        if(exchangeEvent.getExchange() == null){
+            fromRoleTypeName = ""; //"Unknown From Role";
+        }
+        else{
+            Interaction interaction = exchangeEvent.getExchange().getInteraction();
+            if(interaction != null){
+                RoleType fromRoleType = interaction.getFromRoleType();
+                if(fromRoleType != null){
+                    fromRoleTypeName = fromRoleType.getName() != null ? fromRoleType.getName() : "";
+                }
+                else{
+                    fromRoleTypeName = ""; //"null fromRoleType";
+                }
+            }
+            else{
+                fromRoleTypeName = ""; //"null interaction";
+            }
+        }
+    }
+    
+    protected void setServiceName(String name) {
+    	serviceName = name;
+    }
+    
+    public String getServiceName() { return serviceName; }
+
+    /**
+     *
+     */
+    public String getToRoleTypeName(){
+    	if (exchangeEvent == null || exchangeEvent.getChannel() == null)
+    	{
+    		return(""); // "Unknown To Role";
+    	}
+        if(isRequest){
+            return toRoleTypeName;
+        }
+        else{
+            return fromRoleTypeName;
+        }
+    }
+
+
+    /**
+     *
+     */
+    protected void setToRoleTypeName(ExchangeEvent exchangeEvent){
+        if(exchangeEvent == null || exchangeEvent.getExchange() == null){
+            toRoleTypeName = ""; //"Unknown To Role";
+        }
+        else{
+            Interaction interaction = exchangeEvent.getExchange().getInteraction();
+            if(interaction != null){
+                RoleType toRoleType = interaction.getToRoleType();
+                if(toRoleType != null){
+                    toRoleTypeName = toRoleType.getName() != null ? toRoleType.getName() : "";
+                }
+                else{
+                    toRoleTypeName = ""; //"null toRoleType";
+                }
+            }
+            else{
+                toRoleTypeName = ""; //"null interaction";
+            }
+        }
+    }
+
+
+    /**
+     *
+     */
+    public String getSendVariableName(){ return sendVariableString; }
+    public String getSendVariableTypeName() { return sendVariableTypeString; }
+
+    /**
+     * 
+     */
+    protected void setSendVariableTypeName(ExchangeEvent exchangeEvent)
+    {
+        if(exchangeEvent.getExchange() == null){
+        	if (exchangeEvent.getMessage().getType() != null) {
+        		String tmp = exchangeEvent.getMessage().getType();
+        		sendVariableTypeString = tmp.substring(tmp.indexOf("}")+1);
+        		// Need to abberivate after the last "{"
+        	} else {
+        		sendVariableTypeString = "Unknown type";
+        	}
+        }
+        else{
+            Variable sendVariable = exchangeEvent.getExchange().getSendVariable();
+            if(sendVariable != null){
+            	//sendVariableString = sendVariable.getName() != null ? sendVariable.getName()  : "Type: " + sendVariable.getType().getName();
+                sendVariableTypeString = sendVariable.getType().getName();
+            }
+        }
+    }
+    /**
+     *
+     */
+    protected void setSendVariableName(ExchangeEvent exchangeEvent){
+        if(exchangeEvent.getExchange() == null){
+        	if (exchangeEvent.getMessage().getType() != null) {
+        		String tmp = exchangeEvent.getMessage().getType();
+        		sendVariableString = "None : " + tmp.substring(tmp.indexOf("}")+1);
+        		// Need to abberivate after the last "{"
+        	} else
+        		sendVariableString = "null exchange";
+        }
+        else{
+            Variable sendVariable = exchangeEvent.getExchange().getSendVariable();
+            if(sendVariable != null){
+            	//sendVariableString = sendVariable.getName() != null ? sendVariable.getName()  : "Type: " + sendVariable.getType().getName();
+                sendVariableString = sendVariable.getName() != null ? sendVariable.getName()  : " : " + sendVariable.getType().getName();
+            }
+            else{
+            	sendVariableString = "None : " + exchangeEvent.getExchange().getType().getName();
+                //sendVariableString = "null sendVariable";
+            }
+        }
+    }
+
+
+    /**
+     *
+     */
+    public String getOperationString(){ return operationString; }
+
+
+
+    /**
+     *
+     */
+    protected void setOperationString(ExchangeEvent exchangeEvent){
+        if(exchangeEvent.getExchange() == null){
+        	operationString = ""; //"Unknown Operation";
+        }
+        Message message = exchangeEvent.getMessage();
+        if(message == null){
+            operationString = ""; //"null message";
+        }
+        else{
+            operationString = message.getOperationName();
+            if(operationString == null){
+                operationString = ""; //"null operation";
+            }
+        }
+    }
+
+    public String getMessageSummary() {
+    	String ret="";
+    	
+    	if (exchangeEvent != null) {
+	    	String op=getOperationString();
+	    	if (op != null && op.trim().length() > 0) {
+	    		ret += op+"(";
+	        }
+	
+	    	ret += getMessageTypeNoNamespace();
+	    	if (op != null && op.trim().length() > 0) {
+	    		ret += ")";
+	    	}
+    	} else {
+    		ret = getMessageValue();
+    	}
+    	
+    	if (ret != null && ret.length() > 0 &&
+    			ret.charAt(0) == '<') {
+    		ret = getChannelType()+" ...";
+    	}
+    	
+    	return(ret);
+    }
+
+    /**
+     *
+     */
+    public String getMessageValue(){ return messageValueString; }
+
+    public String getExceptionValue() { return exceptionValueString; }
+
+    /**
+     *
+     */
+    protected void setMessageValue(ExchangeEvent exchangeEvent){
+        logger.fine("**** Setting message value");
+        messageValueString = "";
+        Message message = exchangeEvent.getMessage();
+        if(message == null){
+            logger.fine("**** null message");
+            messageValueString = "null message";
+        }
+        else{
+            Serializable messageValue = message.getValue();
+            if(messageValue == null){
+                messageValueString = "null message value";
+                logger.fine("**** null message value");
+            }
+            else{
+                setMessageValue(messageValue.toString());
+            }
+        }
+    }
+    
+    protected void setMessageValue(String originalMessageValueString) {
+        logger.fine("**** original message = " + originalMessageValueString);
+
+        logger.fine("**** prettifying");
+
+        messageValueString = XmlPrettyPrinter.prettify(originalMessageValueString);
+
+        logger.fine("**** prettified");
+
+        logger.fine(messageValueString);
+
+        if(messageValueString == null) {
+
+            logger.fine("**** prettified string was null");
+
+            // messageValueString = originalMessageValueString;
+            //                        messageValueString = "prettyprinting failed";
+            messageValueString = originalMessageValueString.replaceAll("[ \\t]+", " ");
+
+            logger.fine("**** reprettified");
+            logger.fine(messageValueString);
+        }
+    }
+
+
+    /**
+     *
+     */
+    public String getMessageIdentity(){ return messageIdentityString; }
+
+    public String getMessageType() { return messageTypeString; }
+    
+    public String getMessageTypeNoNamespace() { return messageTypeNoNamespaceString; }
+
+    /**
+     *
+     */
+    protected void setMessageIdentity(ExchangeEvent exchangeEvent){
+        Message message = exchangeEvent.getMessage();
+        if(message == null){
+            messageIdentityString = "null message";
+        }
+        else{
+        	java.util.List<Identity> messageIdentityArray=message.getMessageIdentities();
+            if(messageIdentityArray == null || messageIdentityArray.size() == 0){
+                messageIdentityString = "no identities";
+            }
+            else{
+                Identity firstMessageIdentity = messageIdentityArray.get(0);
+                //                    messageIdentityString = firstMessageIdentity.toText();
+                String tokens[] = firstMessageIdentity.getTokens();
+                // valu
+                Object values_obj[] = firstMessageIdentity.getValues();
+                
+                String[] values = new String[values_obj.length];
+                
+                for (int values_index=0; values_index < values_obj.length; values_index++)
+                {
+                	values[values_index] = values_obj[values_index].toString();
+                }
+
+                if(tokens == null || values == null){
+                    if(tokens == null){
+                        logger.fine("identity.getTokens() returned null");
+                        //                        messageIdentityString = "null tokens";
+                    }
+
+                    if(values == null){
+                        logger.fine("identity.getValues() returned null");
+                        //                        messageIdentityString = "null values";
+                    }
+
+                    messageIdentityString = firstMessageIdentity.toString();
+                }
+                else{
+                    if(tokens != null && values != null && tokens.length == values.length){
+                        messageIdentityString = "";
+                        for(int i = 0; i < tokens.length - 1; i++){
+                            messageIdentityString += values[i] + " (" + tokens[i] + "), ";
+                        }
+                        messageIdentityString += values[tokens.length - 1] + " (" + tokens[tokens.length - 1]+")";
+                    }
+                    else{
+                        messageIdentityString = "tokens/values mismatch";
+                    }
+                }
+            }
+        }
+    }
+    
+    public void setMessageIdentity(String ident)
+    {
+    	messageIdentityString = ident;
+    }
+
+
+    /**
+     *
+     */
+    public boolean isFault(){
+        if(hasSetIsFault == false){
+            if(exchangeEvent != null && exchangeEvent.getExchange() != null){
+                isFault = exchangeEvent.getExchange().isFault();
+            }
+            //else{
+            //    isFault = true;
+            //}
+            hasSetIsFault = true;
+        }
+        return isFault;
+    }
+
+
+    /**
+     *
+     */
+    private void setErrorsAndWarnings(){
+        if(hasSetErrorsAndWarnings == false){
+            if(getToRoleTypeName().toLowerCase().matches("exception")){
+                if(getOperationString().toLowerCase().matches("fatal")){
+                    isError = true;
+                }
+                else{
+                    isWarning = true;
+                }
+            }
+            else if(getFromRoleTypeName().toLowerCase().matches("exception")){
+                if(isFault()){
+                    isError = true;
+                }
+            }
+            else{
+                if(exchangeEvent != null && exchangeEvent.getExchange() == null){
+                	isUnexpected = true;
+                }
+                else if(isFault()){
+                    isWarning = true;
+                }
+
+                // if the session was terminated early. color me red.
+            }
+            hasSetErrorsAndWarnings = true;
+        }
+    }
+
+    public void setErrorMessage(boolean b) {
+    	isErrorMessage = b;
+    	
+    	if (b) {
+    		channelType = ChannelJPanel.getErrorName();
+    	}
+    }
+    
+    public boolean isErrorMessage() {
+    	return(isErrorMessage);
+    }
+
+    public void setWarningMessage(boolean b) {
+    	isWarningMessage = b;
+    	
+    	if (b) {
+    		channelType = ChannelJPanel.getWarningName();
+    	}
+    }
+    
+    public boolean isWarningMessage() {
+    	return(isWarningMessage);
+    }
+
+    public void setInformationMessage(boolean b) {
+    	isInformationMessage = b;
+    	
+    	if (b) {
+    		channelType = ChannelJPanel.getInformationName();
+    	}
+    }
+    
+    public boolean isInformationMessage() {
+    	return(isInformationMessage);
+    }
+
+    /**
+     *
+     */
+    public boolean isError(){
+        if(hasSetErrorsAndWarnings == false){
+            setErrorsAndWarnings();
+        }
+        return(isError || isErrorMessage());
+    }
+
+    public boolean isUnexpected(){
+    	return isUnexpected;
+    }
+    
+    public void setUnexpected(boolean b){
+    	isUnexpected = b;
+    }
+
+    /**
+     *
+     */
+    public boolean isWarning(){
+        if(hasSetErrorsAndWarnings == false){
+            setErrorsAndWarnings();
+        }
+        return(isWarning || isWarningMessage());
+    }
+
+
+    /**
+     *
+     */
+    public String getChannelType(){ return channelType; }
+
+    protected void setChannelType(String ctype) {
+    	channelType = ctype;
+    }
+    
+    /**
+     *
+     */
+    public String getCorrelationSession(){ return correlationSessionString; }
+
+    /**
+     *
+     */
+    public String toString()
+    {
+        String s = "EXCHANGE EVENT WRAPPER: " +
+				"<sessionName = " + sessionName + ">" +
+				"<realSessionName = " + realSessionName + ">" +
+				"<serviceName = " + serviceName + ">" +
+				"<description = " + description + ">" +
+				"<toRoleTypeName = " + toRoleTypeName + ">" +
+				"<fromRoleTypeName = " + fromRoleTypeName + ">" +
+				"<sendVariableString = " + sendVariableString + ">" +
+				"<operationString = " + operationString + ">" +
+				"<messageValueString = " + messageValueString + ">" +
+				"<messageIdentityString = " + messageIdentityString + ">" +
+				"<channelType = " + channelType + ">" +
+				"<correlationSessionString = " + correlationSessionString + ">" +
+				"<status = " + status + ">" +
+				"<hasFrozenStatus = " + hasFrozenStatus + ">" +
+				"<hasSetErrorsAndWarnings = " + hasSetErrorsAndWarnings + ">" +
+				"<isError = " + isError + ">" +
+				"<isWarning = " + isWarning + ">" +
+				"<isFault = " + isFault + ">" +
+				"<hasSetIsFault = " + hasSetIsFault + ">" +
+				"<isRequest = " + isRequest + ">" +
+				"<isUnexpected = " + isUnexpected + ">";
+        
+        return s;
+    }
+    /**
+     * 
+     */
+    
+    protected void setChannelType(ExchangeEvent exchangeEvent){
+        if(exchangeEvent.getChannel() == null){
+            channelType = ChannelJPanel.getUnexpectedMessagesName();
+        }
+        else{
+            channelType = exchangeEvent.getExchange().getInteraction().getChannelVariable().getType().getName(); // Not getType
+        	logger.fine("Channel type name: " + channelType);
+        	logger.fine("Channel service type name: " + exchangeEvent.getChannel().getServiceType());
+        	logger.fine("Channel instance name: " + exchangeEvent.getChannel().getName());
+        	logger.fine("OR Channel instance name: " + exchangeEvent.getExchange().getInteraction().getChannelVariable().getType().getName());
+        }
+    }
+
+    // Serialization support
+
+
+    /**
+     *
+     */
+    private void writeObject(ObjectOutputStream out) throws IOException{
+        // to make sure that this has been set.
+        boolean myIsError = this.isError();
+        boolean myIsFault = this.isFault();
+        freezeStatus();
+        out.defaultWriteObject();
+    }
+
+
+    /**
+     *
+     */
+    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException{
+        in.defaultReadObject();
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventsData.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventsData.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/ExchangeEventsData.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,449 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import java.util.Vector;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.logging.Logger;
+
+import java.io.FileOutputStream;
+import java.io.ObjectOutputStream;
+
+import java.io.FileInputStream;
+import java.io.ObjectInputStream;
+
+
+import org.pi4soa.service.correlator.CorrelationSession;
+import org.savara.tools.monitor.ExchangeEvent;
+
+/**
+ *
+ */
+public class ExchangeEventsData{
+
+	private static Logger logger = Logger.getLogger("org.savara.tools.monitor.ui");
+	
+    Vector exchangeEvents = null;
+
+    Vector warningAndErrorExchangeEvents = null;
+
+    Vector errorExchangeEvents = null;
+
+    Vector warningExchangeEvents = null;
+    
+    Vector unexpectedExchangeEvents = null;
+
+    Hashtable exchangeEventsByChannelTable = null;
+    
+    Hashtable exchangeEventsBySessionTable = null;
+
+    Hashtable sessionHasErrorsTable = null;
+    Hashtable sessionHasWarningsTable = null;    
+    Hashtable sessionHasUnexpectedMessagesTable = null;
+    Hashtable channelHasErrorsTable = null;
+    Hashtable channelHasWarningsTable = null;    
+    Hashtable channelHasUnexpectedMessagesTable = null;
+
+    Hashtable exchangeEventToWrapperMap = null;
+
+    boolean hasErrors = false;
+
+    boolean hasWarnings = false;
+    
+    boolean hasUnexpectedMessages = false;
+
+    /**
+     *
+     */
+    public ExchangeEventsData(){
+        exchangeEvents = new Vector();
+        warningAndErrorExchangeEvents = new Vector();
+        errorExchangeEvents = new Vector();
+        warningExchangeEvents = new Vector();
+        unexpectedExchangeEvents = new Vector();
+        exchangeEventsByChannelTable = new Hashtable();
+        exchangeEventsBySessionTable = new Hashtable();
+        exchangeEventToWrapperMap = new Hashtable();
+        channelHasErrorsTable = new Hashtable();
+        channelHasUnexpectedMessagesTable = new Hashtable();
+        channelHasWarningsTable = new Hashtable();
+        sessionHasErrorsTable = new Hashtable();
+        sessionHasUnexpectedMessagesTable = new Hashtable();
+        sessionHasWarningsTable = new Hashtable();
+    }
+
+
+
+    /**
+     *
+     */
+    public void clear(){
+        exchangeEvents.clear();
+        exchangeEventsByChannelTable.clear();
+        exchangeEventsBySessionTable.clear();
+        exchangeEventToWrapperMap.clear();
+        warningAndErrorExchangeEvents.clear();
+        errorExchangeEvents.clear();
+        warningExchangeEvents.clear();
+        unexpectedExchangeEvents.clear();
+        channelHasErrorsTable.clear();
+        channelHasWarningsTable.clear();
+        channelHasUnexpectedMessagesTable.clear();
+        sessionHasErrorsTable.clear();
+        sessionHasWarningsTable.clear();
+        sessionHasUnexpectedMessagesTable.clear();
+        hasErrors = false;
+        hasWarnings = false;
+    }
+
+
+    /**
+     *
+     */
+    public boolean exportEvents(String path){
+        try{
+            FileOutputStream fileOutputStream = new FileOutputStream(path);
+            ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
+            objectOutputStream.writeObject(exchangeEvents);
+            objectOutputStream.close();
+        }
+        catch(Exception e){
+            logger.severe("Exception: " + e);
+            return false;
+        }
+
+        return true;
+    }
+
+
+
+    /**
+     *
+     */
+    public boolean importEvents(String path){
+        clear();
+
+        Vector v = null;
+
+        try{
+            FileInputStream fileInputStream = new FileInputStream(path);
+            ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
+            v = (Vector) objectInputStream.readObject();
+            objectInputStream.close();
+        }
+        catch(Exception e){
+            logger.severe("Exception: " + e);
+            return false;
+        }
+
+        Iterator iterator = v.iterator();
+        int i = 0;
+        while(iterator.hasNext()){
+            ExchangeEventWrapper wrapper = (ExchangeEventWrapper) iterator.next();
+
+            logger.fine("Getting wrapper message value");
+
+            String wrapperMessageValue = wrapper.getMessageValue();
+
+            logger.fine("Imported event wrapper message value = " + wrapperMessageValue);
+
+            Integer key = new Integer(i);
+            i++;
+            exchangeEventToWrapperMap.put(key, wrapper);
+            addExchangeEvent(wrapper);
+        }
+
+        return true;
+    }
+
+
+
+
+    /**
+     *
+     */
+    public ExchangeEventWrapper createExchangeEventWrapper(ExchangeEvent exchangeEvent){
+        ExchangeEventWrapper wrapper=null;
+        
+        logger.fine(">>>> creating new wrapper");
+        wrapper = new ExchangeEventWrapper(exchangeEvent, new Integer(exchangeEvents.size()));
+        logger.fine(">>>> created new wrapper");
+    	
+        java.util.List list=(java.util.List)
+        		exchangeEventToWrapperMap.get(exchangeEvent);
+        	
+        if (list == null) {
+        	list = new java.util.Vector();
+        	exchangeEventToWrapperMap.put(exchangeEvent, list);
+    		logger.fine("Added new list for map entry: "+exchangeEvent);
+        }
+        
+        list.add(wrapper);
+    	
+        return wrapper;
+    }
+
+    public ExchangeEventWrapper matchExchangeEventWrapper(ExchangeEvent exchangeEvent){
+    	logger.info("getExchangeEventWrapper for " + exchangeEvent);
+        logger.fine(">>>> looking for pre-existing wrapper for " + exchangeEvent);
+        
+        java.util.List list=
+        	(java.util.List)exchangeEventToWrapperMap.get(exchangeEvent);
+ 
+        ExchangeEventWrapper wrapper=null;
+        
+        if (list != null && list.size() > 0) {
+        	wrapper = (ExchangeEventWrapper)list.remove(0);
+        	
+        	if (list.size() == 0) {
+        		exchangeEventToWrapperMap.remove(exchangeEvent);
+        		
+        		logger.fine("Cleaned up map entry for: "+exchangeEvent);
+        	}
+        }
+        
+        if(wrapper == null){
+            logger.severe(">>>> Failed to find existing wrapper: "+exchangeEvent);
+        }
+        else{
+            logger.fine(">>>> found old wrapper");
+            
+            // Remove from map
+            exchangeEventToWrapperMap.remove(exchangeEvent);
+        }
+        
+        return wrapper;
+    }
+
+    public ExchangeEventWrapper errorExchangeEventWrapper(ExchangeEvent exchangeEvent){
+        ExchangeEventWrapper wrapper=null;
+        
+        logger.fine(">>>> creating new error wrapper");
+        wrapper = new ExchangeEventWrapper(exchangeEvent, new Integer(exchangeEvents.size()));
+        logger.fine(">>>> created new error wrapper");
+    	
+        return wrapper;
+    }
+
+    public ExchangeEventWrapper simpleWrapper(CorrelationSession session,
+    			String text, String exception) {
+        ExchangeEventWrapper wrapper=null;
+        
+        logger.fine(">>>> creating new empty wrapper");
+        wrapper = new ExchangeEventWrapper(session,
+        		new Integer(exchangeEvents.size()), text, exception);
+        logger.fine(">>>> created new empty wrapper");
+    	
+        return wrapper;
+    }
+
+    /**
+     *
+     */
+    public void addExchangeEvent(ExchangeEventWrapper wrapper){
+
+        String channelType = wrapper.getChannelType();
+        String sessionName = wrapper.getSessionName();   
+        
+        Vector exchangeEventsByChannel = (Vector) exchangeEventsByChannelTable.get(channelType);
+        Vector exchangeEventsBySession = (Vector) exchangeEventsBySessionTable.get(sessionName);
+
+
+        if(exchangeEventsByChannel == null){
+            exchangeEventsByChannel = new Vector();
+        }
+        logger.info("addExchangeEvent for CHANNEL TYPE: " + channelType);
+        exchangeEventsByChannel.add(wrapper);
+
+        if (exchangeEventsBySession == null){
+        	exchangeEventsBySession = new Vector();
+        }
+        logger.info("addExchangeEvent for SESSION: " + sessionName);
+        exchangeEventsBySession.add(wrapper);
+        
+        // is this necessary if we already had an entry?
+        exchangeEventsByChannelTable.put(channelType, exchangeEventsByChannel);
+        exchangeEventsBySessionTable.put(sessionName, exchangeEventsBySession);
+        
+        exchangeEvents.add(wrapper);
+
+        logger.fine(">>>> added to exchange events list. size = " + exchangeEvents.size());
+
+        // OLD fault handling.
+        //        if(wrapper.isFault() == true){
+        //            channelHasErrorsTable.put(channelType, new Boolean(true));
+        //            hasErrors = true;
+        //        }
+
+        // NEW fault handling.
+logger.warning("Checking if error....");        
+        if(wrapper.isWarning() == true || wrapper.isError() == true || wrapper.isUnexpected() == true){
+            //            channelHasErrorsTable.put(channelType, new Boolean(true));
+            //            hasErrors = true;
+
+            warningAndErrorExchangeEvents.add(wrapper);
+
+        	if (wrapper.isError() == true) {
+        		errorExchangeEvents.add(wrapper);
+logger.warning("RECORD ERROR channel="+channelType);                
+				channelHasErrorsTable.put(channelType, new Boolean(true));
+				sessionHasErrorsTable.put(sessionName, new Boolean(true));
+				hasErrors = true;
+        	} else if(wrapper.isWarning() == true){
+                warningExchangeEvents.add(wrapper);
+                channelHasWarningsTable.put(channelType, new Boolean(true));
+				sessionHasWarningsTable.put(sessionName, new Boolean(true));
+logger.warning("RECORD WARNING channel="+channelType);                
+                hasWarnings = true;
+            } else if (wrapper.isUnexpected() == true) {
+            	unexpectedExchangeEvents.add(wrapper);
+            	channelHasUnexpectedMessagesTable.put(channelType, new Boolean(true));
+				sessionHasUnexpectedMessagesTable.put(sessionName, new Boolean(true));
+            	hasUnexpectedMessages = true;
+            	logger.info("ADDED UNEXPECTED WRAPPER TO ExchangeEventData for channelType " + channelType);
+            }
+logger.warning("Checked");            
+        }
+    }
+
+
+    /**
+     *
+     */
+    public ExchangeEventWrapper getWrapper(int i){ return (ExchangeEventWrapper) exchangeEvents.elementAt(i); }
+
+
+
+    /**
+     *
+     */
+    public Vector getExchangeEventsForChannel(String channel){
+        return (Vector) exchangeEventsByChannelTable.get(channel);
+    }
+    
+    public Vector getExchangeEventsForSession(String session) {
+    	return (Vector)exchangeEventsBySessionTable.get(session);
+    }
+
+
+    /**
+     *
+     */
+    public Vector getExchangeEvents(){ return exchangeEvents; }
+
+    /**
+     *
+     */
+    public Vector getWarningAndErrorExchangeEvents(){ return warningAndErrorExchangeEvents; }
+
+    /**
+     *
+     */
+    public Vector getErrorExchangeEvents(){ return errorExchangeEvents; }
+
+    /**
+     *
+     */
+    public Vector getWarningExchangeEvents(){ return warningExchangeEvents; }
+
+    /**
+     * 
+     */
+    public Vector getUnexpectedExchangeEvents() { return unexpectedExchangeEvents; }
+
+    /**
+     * 
+     */
+    public boolean getHasUnexpectedExchangeEventsForChannel(String channel){
+        if(hasUnexpectedMessages == true){
+            Boolean hasUnexpectedMessagesForChannel = (Boolean) channelHasUnexpectedMessagesTable.get(channel);
+            if (hasUnexpectedMessagesForChannel != null) return true;
+        }
+        return false;
+    }
+
+    public boolean getHasUnexpectedExchangeEventsForSession(String session){
+        if(hasUnexpectedMessages == true){
+            Boolean hasUnexpectedMessagesForSession = (Boolean) sessionHasUnexpectedMessagesTable.get(session);
+            if (hasUnexpectedMessagesForSession != null) return true;
+        }
+        return false;
+    }
+
+    /**
+     *
+     */
+    public boolean getHasErrorsForChannel(String channel){
+        if(hasErrors == true){
+            Boolean hasErrorsForChannel = (Boolean) channelHasErrorsTable.get(channel);
+            if (hasErrorsForChannel != null) return true;
+        }
+        return false;
+    }
+
+    public boolean getHasErrorsForSession(String session){
+        if(hasErrors == true){
+            Boolean hasErrorsForSession = (Boolean) sessionHasErrorsTable.get(session);
+            if (hasErrorsForSession != null) return true;
+        }
+        return false;
+    }
+
+    /**
+     *
+     */
+    public boolean getHasWarningsForChannel(String channel){
+        if(hasWarnings == true){
+            Boolean hasWarningsForChannel = (Boolean) channelHasWarningsTable.get(channel);
+            if (hasWarningsForChannel != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean getHasWarningsForSession(String session){
+        if(hasWarnings == true){
+            Boolean hasWarningsForSession = (Boolean) sessionHasWarningsTable.get(session);
+            if (hasWarningsForSession != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    /**
+     * 
+     */
+    public boolean getHasUnexpectedMessages(){ return hasUnexpectedMessages; }
+    /**
+     *
+     */
+    public boolean getHasErrors(){ return hasErrors; }
+
+
+    /**
+     *
+     */
+    public boolean getHasWarnings(){ return hasWarnings; }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/Monitor.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/Monitor.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/Monitor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,503 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import javax.swing.*;
+
+import java.awt.BorderLayout;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.pi4soa.service.correlator.CorrelationSession;
+import org.savara.tools.monitor.CorrelationManagerListener;
+import org.savara.tools.monitor.ExchangeEvent;
+import org.savara.tools.monitor.TxnMonitor;
+
+/**
+ * Monitor user interface class.
+ */
+public class Monitor extends JApplet implements CorrelationManagerListener /* , TreeSelectionListener */{
+
+	private static final long serialVersionUID = -4323114698930604980L;
+
+	private static Logger logger = Logger.getLogger("org.savara.tools.monitor.ui");
+    
+    static final int NEW_FRAME_WIDTH = 800;
+    static final int NEW_FRAME_HEIGHT = 600;
+
+    MonitorMainPanel smPanel = null;
+
+    String choreographyPath = null;
+
+    org.pi4soa.cdl.Package choreography = null;
+
+    TxnMonitor txnMonitor = null;
+
+    ExchangeEventsData exchangeEventsData = null;
+
+    boolean isMonitoring = false;
+    boolean choreographyProvided = false;
+
+    /**
+     * Initialisation.
+     */
+    public Monitor(boolean choreoProvided) {
+
+        exchangeEventsData = new ExchangeEventsData();
+
+        smPanel = new MonitorMainPanel(exchangeEventsData, choreoProvided);
+
+        this.getContentPane().setLayout(new BorderLayout());
+        this.getContentPane().add(smPanel, BorderLayout.CENTER);
+
+        smPanel.setApplet(this);
+    }
+
+
+    /**
+     * Initialisation.
+     */
+    public void init() {
+        // hack to get around system event queue check - which doesn't work, of course
+        this.getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
+    }
+
+
+    /**
+     * Returns info about the acceptable parameters
+     */
+    public String[][] getParameterInfo()
+    {
+        String pinfo[][] = {
+            // actual parameters might include
+            // ip address, directories, colors
+            // etc.
+
+            // properties should be used for
+            // most stuff
+
+            {"parameter1", "String", "A String."},
+            {"parameter2", "String",    "Another String."},
+            {"parameter3", "integer",    "An integer."},
+        };
+
+        return pinfo;
+    }
+
+    /**
+     *
+     */
+    public static void main(String args[]){
+        Monitor monitor = new Monitor(args.length > 0);
+        JFrame jFrame = new JFrame("SAVARA Monitor");
+        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        jFrame.getContentPane().setLayout(new BorderLayout());
+        jFrame.getContentPane().add(monitor, BorderLayout.CENTER);
+        monitor.init();
+
+        jFrame.setIconImage(MonitorMainPanel.createImageIcon("icons/monitor.png").getImage());
+        
+        jFrame.setSize(NEW_FRAME_WIDTH, NEW_FRAME_HEIGHT);
+
+        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
+        java.awt.Dimension frameSize = jFrame.getSize();
+        if (frameSize.height > screenSize.height) {
+          frameSize.height = screenSize.height;
+        }
+        if (frameSize.width > screenSize.width) {
+          frameSize.width = screenSize.width;
+        }
+        jFrame.setLocation( (screenSize.width - frameSize.width) / 2,
+                         (screenSize.height - frameSize.height) / 2);
+        jFrame.setVisible(true);
+        
+        if(args.length > 0){
+            if(monitor.loadChoreography(args[0])){
+                monitor.startMonitoring();
+            } else {
+            	System.exit(1);
+            }
+        }
+    }
+
+    //////////////////////////
+
+
+    /**
+     *
+     */
+    public boolean isMonitoring(){ return isMonitoring; }
+
+    public boolean isChoreographyLoaded() { return choreography!=null; }
+
+    /**
+     *
+     */
+    public void setIsMonitoring(boolean isMonitoring){ this.isMonitoring = isMonitoring; }
+
+    public void close() {
+    	this.destroy();
+    	System.exit(0);
+    }
+
+    /**
+     *
+     */
+    public boolean loadChoreography(String choreographyPath){
+
+        logger.info("Loading " + choreographyPath);
+        smPanel.setStatus("Loading " + choreographyPath);
+
+        // try and read the new one ...
+        org.pi4soa.cdl.Package newChoreography = null;
+
+        try{
+            newChoreography = org.pi4soa.cdl.CDLManager.load(choreographyPath);
+        }
+        catch(IOException e){
+            logger.severe("Exception: " + e);
+            smPanel.setStatus("Failed to load " + choreographyPath);
+
+            JOptionPane.showMessageDialog(null,
+            		"Failed to load "+choreographyPath,
+            		 "Error", JOptionPane.ERROR_MESSAGE);
+            
+            return false;
+        }
+
+        // ok, we were successful ...
+        if(this.choreographyPath != null){
+            if(this.isMonitoring() == true){
+                // stop monitoring
+            }
+
+            exchangeEventsData.clear();
+        }
+
+        this.choreographyPath = choreographyPath;
+        this.choreography = newChoreography;
+
+        // tell the panel we loaded a new choreography ...
+        smPanel.loadedChoreography(choreography);
+
+        return true;
+    }
+
+
+    /**
+     *
+     */
+    public boolean startMonitoring(){
+
+        logger.info("Starting monitoring");
+
+        if(this.isMonitoring() == true){
+            logger.info("Already monitoring");
+            return false;
+        }
+
+        if(this.choreography == null){
+            logger.info("No choreography to monitor");
+            return false;
+        }
+
+        smPanel.setStatus("Trying to monitor " + choreography.getName());
+        logger.info("Trying to monitor " + choreography.getName());
+
+        try{
+            this.txnMonitor = TxnMonitor.getInstance(choreographyPath);
+            this.txnMonitor.addCorrelationManagerListener(this);
+        }
+        catch(Exception e){
+            // hack
+            logger.log(Level.SEVERE, "Exception while trying to monitor choreography " + e, e);
+            
+            JOptionPane.showMessageDialog(null,
+            		"Failed to initialize monitor: "+e.getLocalizedMessage(),
+            		 "Error", JOptionPane.ERROR_MESSAGE);
+        }
+
+        logger.fine("Past txnMonitor calls");
+
+        this.setIsMonitoring(true);
+
+        // tell the panel
+        smPanel.startedMonitoring();
+
+        return true;
+    }
+
+
+    /**
+     *
+     */
+    public boolean stopMonitoring(){
+        if(this.isMonitoring() == false){
+            logger.info("Not monitoring");
+            return false;
+        }
+
+        this.txnMonitor.removeCorrelationManagerListener(this);
+
+        try{
+            this.txnMonitor.unmonitor(this.choreography);
+        }
+        catch(Exception e){
+            logger.severe("Exception: " + e);
+            return false;
+        }
+
+        this.setIsMonitoring(false);
+
+        // tell the panel
+        smPanel.stoppedMonitoring();
+
+        return true;
+    }
+
+
+    /**
+     *
+     */
+    public boolean importEvents(String path){
+        boolean result = exchangeEventsData.importEvents(path);
+        smPanel.importedEvents();
+        return result;
+    }
+
+
+    /**
+     *
+     */
+    public boolean exportEvents(String path){
+        return exchangeEventsData.exportEvents(path);
+        //
+        //        try{
+        //            FileOutputStream fileOutputStream = new FileOutputStream(path);
+        //            ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
+        //            objectOutputStream.writeObject(exchangeEvents);
+        //            objectOutputStream.close();
+        //        }
+        //        catch(Exception e){
+        //            System.err.println("Exception: " + e);
+        //            return false;
+        //        }
+        //
+        //        return true;
+    }
+
+
+    // CorrelationManagerListener interface
+
+   /**
+    * This method indicates that a correlation session has
+    * started.
+    *
+    * @param session The correlation session
+    */
+    public void correlationSessionStarted(CorrelationSession session){
+        logger.info(">>>> CORRELATION SESSION STARTED: " + session );
+        
+        // TO DO: Need to add something to the sessionPanel at this point.
+        ChannelJPanel cp = smPanel.getChannelPanel();
+        cp.addedSession(session);
+    }
+
+
+    /**
+     * This method indicates that a correlation session has
+     * finished.
+     *
+     * @param session The correlation session
+     */
+    public void correlationSessionFinished(CorrelationSession session){
+        logger.info(">>>> CORRELATION SESSION FINSIHED: " + session);
+        smPanel.getChannelPanel().addedSession(session);
+        // TO DO: Need to change colour for the same session item in the session Panel
+    }
+
+
+    /**
+     * A new exchange event has been added to a correlation session.
+     *
+     * @param exchangeEvent The exchange event.
+     */
+    public void exchangeEventAdded(ExchangeEvent exchangeEvent){
+    	logger.fine(">>>> ADDING EXCHANGE EVENT" + exchangeEvent);
+        // System.err.println(">>>> Adding exchange event");
+        //        System.err.println(">>>> Getting correlation session");
+        CorrelationSession session = exchangeEvent.getCorrelationSession();
+        logger.fine("Identity for new exchange is: " + ChannelJPanel.getSessionIdentity(exchangeEvent.getCorrelationSession()));
+        //        System.err.println(">>>> Getting wrapper");
+        ExchangeEventWrapper wrapper = exchangeEventsData.createExchangeEventWrapper(exchangeEvent);
+        //        System.err.println(">>>> Adding to data");
+        exchangeEventsData.addExchangeEvent(wrapper);
+        //        System.err.println(">>>> updating smPanel");
+        smPanel.addedExchangeEvent(wrapper);
+        logger.fine(">>>> ADDED EXCHANGE EVENT FOR SESSION: " + session);
+    }
+
+
+    /**
+     * An exchange event has been updated.
+     *
+     * @param exchangeEvent The exchange event.
+     */
+    public void exchangeEventUpdated(ExchangeEvent exchangeEvent){
+        ExchangeEventWrapper wrapper = exchangeEventsData.matchExchangeEventWrapper(exchangeEvent);
+        logger.fine("Identity for updated exchange is: " + ChannelJPanel.getSessionIdentity(exchangeEvent.getCorrelationSession()));
+        smPanel.updatedExchangeEvent(wrapper);
+    }
+    
+    /**
+     * An unexpcted exchange event has occured
+     * 
+     * @param exchangeEvent. The exchange event.
+     * @param serviceName The service reporting the error
+     */
+    public void unexpectedExchangeEventAdded(ExchangeEvent exchangeEvent,
+    						String serviceName)
+    {
+    	logger.info(">>>> unexpectedExchangeEventAdded");
+    	
+    	//CorrelationSession session = exchangeEvent.getCorrelationSession();
+    	String ident = null;
+    	
+    	if (exchangeEvent.getCorrelationSession() != null) {
+    		ident = ChannelJPanel.getSessionIdentity(exchangeEvent.getCorrelationSession());
+    	}
+    	
+    	logger.info("Identity for unexpected is: " + ident);
+        ExchangeEventWrapper wrapper = exchangeEventsData.errorExchangeEventWrapper(exchangeEvent);
+        wrapper.setUnexpected(true);
+        wrapper.setMessageIdentity(ident);
+        wrapper.setServiceName(serviceName);
+        exchangeEventsData.addExchangeEvent(wrapper);
+        smPanel.addedUnexpectedExchangeEvent(wrapper);
+        
+    	logger.fine("<<<< unexpectedExchangeEventAdded");
+    }
+    
+    /**
+     * An error occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The error message
+     * @param exception The optional exception
+     * @param serviceName The service reporting the error
+     */
+    public void error(CorrelationSession session, String mesg,
+    					String exception, String serviceName) {
+    	logger.info(">>>> error");
+    	
+    	//CorrelationSession session = exchangeEvent.getCorrelationSession();
+    	String ident = null;
+    	
+    	if (session != null) {
+    		ident = ChannelJPanel.getSessionIdentity(session);
+    	}
+    	
+    	logger.info("Identity for unexpected is: " + ident);
+        ExchangeEventWrapper wrapper =
+        		exchangeEventsData.simpleWrapper(session, mesg,
+        					exception);
+        wrapper.setErrorMessage(true);
+        wrapper.setMessageIdentity(ident);
+        wrapper.setChannelType(ChannelJPanel.getErrorName());
+        wrapper.setServiceName(serviceName);
+        exchangeEventsData.addExchangeEvent(wrapper);
+        smPanel.addedErrorEvent(wrapper);
+        
+    	logger.fine("<<<< error");
+    }
+    
+    /**
+     * A warning occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The warning message
+     * @param exception The optional exception
+     * @param serviceName The service reporting the warning
+     */
+    public void warning(CorrelationSession session, String mesg,
+    				String exception, String serviceName) {
+    	logger.info(">>>> warning");
+    	
+    	//CorrelationSession session = exchangeEvent.getCorrelationSession();
+    	String ident = null;
+    	
+    	if (session != null) {
+    		ident = ChannelJPanel.getSessionIdentity(session);
+    	}
+    	
+    	logger.info("Identity for unexpected is: " + ident);
+        ExchangeEventWrapper wrapper =
+        		exchangeEventsData.simpleWrapper(session, mesg,
+        					exception);
+        wrapper.setWarningMessage(true);
+        wrapper.setMessageIdentity(ident);
+        wrapper.setChannelType(ChannelJPanel.getWarningName());
+        wrapper.setServiceName(serviceName);
+        exchangeEventsData.addExchangeEvent(wrapper);
+        smPanel.addedErrorEvent(wrapper);
+        
+    	logger.fine("<<<< warning");
+    }
+    
+    /**
+     * An information event occurred related to the specified correlation
+     * session.
+     * 
+     * @param session The correlation session
+     * @param mesg The information message
+     * @param serviceName The service reporting the information
+     */
+    public void information(CorrelationSession session, String mesg,
+    					String serviceName) {
+    	logger.info(">>>> information");
+    	
+    	//CorrelationSession session = exchangeEvent.getCorrelationSession();
+    	String ident = null;
+    	
+    	if (session != null) {
+    		ident = ChannelJPanel.getSessionIdentity(session);
+    	}
+    	
+    	logger.info("Identity for unexpected is: " + ident);
+        ExchangeEventWrapper wrapper =
+        		exchangeEventsData.simpleWrapper(session, mesg, null);
+        wrapper.setInformationMessage(true);
+        wrapper.setMessageIdentity(ident);
+        wrapper.setChannelType(ChannelJPanel.getInformationName());
+        wrapper.setServiceName(serviceName);
+        exchangeEventsData.addExchangeEvent(wrapper);
+        smPanel.addedErrorEvent(wrapper);
+        
+    	logger.fine("<<<< information");
+    }
+    
+
+} // End of Applet
+
+// EOF

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorExchangeEvent.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorExchangeEvent.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorExchangeEvent.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+
+import java.util.Date;
+
+import org.pi4soa.cdl.ExchangeDetails;
+import org.pi4soa.service.Channel;
+import org.pi4soa.cdl.ExchangeActionType;
+
+/**
+ * Convenience class for representing an exchange, and providing
+ * convenient access to data for display.
+ */
+public class MonitorExchangeEvent {
+
+    Date initiatedDate = null;
+    Date completedDate = null;
+
+    Channel channel = null;
+    ExchangeDetails exchangeDetails = null;
+
+    /**
+     *
+     */
+    public MonitorExchangeEvent(Channel channel, ExchangeDetails exchangeDetails){
+        this.channel = channel;
+        this.exchangeDetails = exchangeDetails;
+    }
+
+    /**
+     *
+     */
+    public String getChannelName(){
+        return channel.getName();
+    }
+
+    /**
+     *
+     */
+    public String getAction(){
+        if(exchangeDetails.getAction() == ExchangeActionType.REQUEST) return "Request";
+        else return "Response";
+    }
+
+
+    /**
+     *
+     */
+    public String getName(){
+        return exchangeDetails.getName();
+    }
+
+
+    /**
+     *
+     */
+    public String getDescription(){
+        return exchangeDetails.getDescription();
+    }
+
+
+    /**
+     *
+     */
+    public Date getInitiatedDate(){
+        return initiatedDate;
+    }
+
+
+    /**
+     *
+     */
+    public Date getCompletedDate(){
+        return completedDate;
+    }
+
+
+    /**
+     *
+     */
+    public String getStatus(){
+        if(completedDate != null) return "Completed";
+        else return "Initiated";
+    }
+
+
+    /**
+     *
+     */
+    public int hashCode(){
+        return exchangeDetails.hashCode();
+    }
+    
+
+    /**
+     *
+     */
+    public boolean equals(Object object){
+        boolean result = false;
+        
+        if(object instanceof MonitorExchangeEvent){
+            MonitorExchangeEvent other = (MonitorExchangeEvent) object;
+        
+            if(other.exchangeDetails == this.exchangeDetails &&
+               other.getChannelName().equals(this.getChannelName())){
+                   /*                    other.getCorrelationSession() == m_session) { */
+                result = true;
+            }
+        }
+        
+        return result;
+    }
+
+
+} // End of class

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorFileFilter.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorFileFilter.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorFileFilter.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Enumeration;
+import javax.swing.filechooser.*;
+
+/**
+ * A convenience implementation of FileFilter that filters out
+ * all files except for those type extensions that it knows about.
+ *
+ * Extensions are of the type ".foo", which is typically found on
+ * Windows and Unix boxes, but not on Macinthosh. Case is ignored.
+ *
+ * Example - create a new filter that filerts out all files
+ * but gif and jpg image files:
+ *
+ *     JFileChooser chooser = new JFileChooser();
+ *     ExampleFileFilter filter = new ExampleFileFilter(
+ *                   new String{"gif", "jpg"}, "JPEG & GIF Images")
+ *     chooser.addChoosableFileFilter(filter);
+ *     chooser.showOpenDialog(this);
+ *
+ * @version 1.9 04/23/99
+ * @author Jeff Dinkins
+ */
+public class MonitorFileFilter extends FileFilter {
+
+    //private static String TYPE_UNKNOWN = "Type Unknown";
+    //private static String HIDDEN_FILE = "Hidden File";
+
+    private Hashtable filters = null;
+    private String description = null;
+    private String fullDescription = null;
+    private boolean useExtensionsInDescription = true;
+
+    /**
+     * Creates a file filter. If no filters are added, then all
+     * files are accepted.
+     *
+     * @see #addExtension
+     */
+    public MonitorFileFilter() {
+        this.filters = new Hashtable();
+    }
+
+    /**
+     * Creates a file filter that accepts files with the given extension.
+     * Example: new ExampleFileFilter("jpg");
+     *
+     * @see #addExtension
+     */
+    public MonitorFileFilter(String extension) {
+        this(extension,null);
+    }
+
+    /**
+     * Creates a file filter that accepts the given file type.
+     * Example: new ExampleFileFilter("jpg", "JPEG Image Images");
+     *
+     * Note that the "." before the extension is not needed. If
+     * provided, it will be ignored.
+     *
+     * @see #addExtension
+     */
+    public MonitorFileFilter(String extension, String description) {
+        this();
+        if(extension!=null) addExtension(extension);
+        if(description!=null) setDescription(description);
+    }
+
+    /**
+     * Creates a file filter from the given string array.
+     * Example: new ExampleFileFilter(String {"gif", "jpg"});
+     *
+     * Note that the "." before the extension is not needed adn
+     * will be ignored.
+     *
+     * @see #addExtension
+     */
+    public MonitorFileFilter(String[] filters) {
+        this(filters, null);
+    }
+
+    /**
+     * Creates a file filter from the given string array and description.
+     * Example: new ExampleFileFilter(String {"gif", "jpg"}, "Gif and JPG Images");
+     *
+     * Note that the "." before the extension is not needed and will be ignored.
+     *
+     * @see #addExtension
+     */
+    public MonitorFileFilter(String[] filters, String description) {
+        this();
+        for (int i = 0; i < filters.length; i++) {
+            // add filters one by one
+            addExtension(filters[i]);
+        }
+        if(description!=null) setDescription(description);
+    }
+
+    /**
+     * Return true if this file should be shown in the directory pane,
+     * false if it shouldn't.
+     *
+     * Files that begin with "." are ignored.
+     *
+     * @see #getExtension
+     * @see FileFilter#accepts
+     */
+    public boolean accept(File f) {
+        if(f != null) {
+            if(f.isDirectory()) {
+                return true;
+            }
+            String extension = getExtension(f);
+            if(extension != null && filters.get(getExtension(f)) != null) {
+                return true;
+            };
+        }
+        return false;
+    }
+
+    /**
+     * Return the extension portion of the file's name .
+     *
+     * @see #getExtension
+     * @see FileFilter#accept
+     */
+    public String getExtension(File f) {
+        if(f != null) {
+            String filename = f.getName();
+            int i = filename.lastIndexOf('.');
+            if(i>0 && i<filename.length()-1) {
+                return filename.substring(i+1).toLowerCase();
+            };
+        }
+        return null;
+    }
+
+    /**
+     * Adds a filetype "dot" extension to filter against.
+     *
+     * For example: the following code will create a filter that filters
+     * out all files except those that end in ".jpg" and ".tif":
+     *
+     *   ExampleFileFilter filter = new ExampleFileFilter();
+     *   filter.addExtension("jpg");
+     *   filter.addExtension("tif");
+     *
+     * Note that the "." before the extension is not needed and will be ignored.
+     */
+    public void addExtension(String extension) {
+        if(filters == null) {
+            filters = new Hashtable(5);
+        }
+        filters.put(extension.toLowerCase(), this);
+        fullDescription = null;
+    }
+
+
+    /**
+     * Returns the human readable description of this filter. For
+     * example: "JPEG and GIF Image Files (*.jpg, *.gif)"
+     *
+     * @see setDescription
+     * @see setExtensionListInDescription
+     * @see isExtensionListInDescription
+     * @see FileFilter#getDescription
+     */
+    public String getDescription() {
+        if(fullDescription == null) {
+            if(description == null || isExtensionListInDescription()) {
+                fullDescription = description==null ? "(" : description + " (";
+                // build the description from the extension list
+                Enumeration extensions = filters.keys();
+                if(extensions != null) {
+                    fullDescription += "." + (String) extensions.nextElement();
+                    while (extensions.hasMoreElements()) {
+                        fullDescription += ", " + (String) extensions.nextElement();
+                    }
+                }
+                fullDescription += ")";
+            } else {
+                fullDescription = description;
+            }
+        }
+        return fullDescription;
+    }
+
+    /**
+     * Sets the human readable description of this filter. For
+     * example: filter.setDescription("Gif and JPG Images");
+     *
+     * @see setDescription
+     * @see setExtensionListInDescription
+     * @see isExtensionListInDescription
+     */
+    public void setDescription(String description) {
+        this.description = description;
+        fullDescription = null;
+    }
+
+    /**
+     * Determines whether the extension list (.jpg, .gif, etc) should
+     * show up in the human readable description.
+     *
+     * Only relevent if a description was provided in the constructor
+     * or using setDescription();
+     *
+     * @see getDescription
+     * @see setDescription
+     * @see isExtensionListInDescription
+     */
+    public void setExtensionListInDescription(boolean b) {
+        useExtensionsInDescription = b;
+        fullDescription = null;
+    }
+
+    /**
+     * Returns whether the extension list (.jpg, .gif, etc) should
+     * show up in the human readable description.
+     *
+     * Only relevent if a description was provided in the constructor
+     * or using setDescription();
+     *
+     * @see getDescription
+     * @see setDescription
+     * @see setExtensionListInDescription
+     */
+    public boolean isExtensionListInDescription() {
+        return useExtensionsInDescription;
+    }
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMainPanel.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMainPanel.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMainPanel.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,1038 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import java.awt.Component;
+
+import java.util.Vector;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Comparator;
+import java.util.Hashtable;
+import java.util.logging.Logger;
+
+import javax.swing.JTree;
+import javax.swing.JTable;
+import javax.swing.JScrollPane;
+import javax.swing.JLabel;
+import javax.swing.JSplitPane;
+import javax.swing.JPanel;
+import javax.swing.ImageIcon;
+import javax.swing.JTextArea;
+import javax.swing.JEditorPane;
+
+import javax.swing.ListSelectionModel;
+import javax.swing.SpringLayout;
+import javax.swing.JCheckBox;
+//import javax.swing.JPopupMenu;
+import javax.swing.JComboBox;
+
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.ListSelectionEvent;
+
+import javax.swing.event.ListSelectionListener;
+
+import javax.swing.tree.TreeSelectionModel;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
+
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableCellRenderer;  
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Dimension;
+import java.awt.Color;
+
+import java.awt.event.ItemListener;
+import java.awt.event.ItemEvent;
+
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import java.io.StringWriter;
+import java.io.StringReader;
+
+//import org.pi4soa.cdl.ExchangeDetails;
+import org.pi4soa.service.correlator.CorrelationSession;
+import org.pi4soa.cdl.ExchangeActionType;
+import org.savara.tools.monitor.ExchangeEvent;
+import org.savara.tools.monitor.ui.table.TableSorter;
+
+
+/**
+ * This is the main user interface for the swing monitor.
+ *
+ * It comprises a three-panel display, listing Channels, Exchange
+ * Events, and Exchange Event Details.
+ *
+ * @author Martin Redington
+ */
+public class MonitorMainPanel extends JPanel{
+
+    private static Logger logger = Logger.getLogger("org.savara.tools.monitor.ui");
+
+    //    Vector exchangeEvents = null;
+    ExchangeEventsData exchangeEventsData = null;
+    
+    MonitorMenuBar menuBar =null;
+
+    ControlPanel controlPanel = null;
+
+    ChannelJPanel channelPanel = null;
+    StatusPanel statusPanel = null;
+
+    ExchangeEventsTableModel exchangeEventsTableModel = null;
+    TableSorter sorter = null;
+
+    String choreographyName = null;
+
+    ExchangeJPanel exchangePanel = null;
+
+    public static final Comparator INTEGER_COMPARATOR = new Comparator() {
+            public int compare(Object o1, Object o2) {
+                return ((Integer) o1).intValue() - ((Integer) o2).intValue();
+            }
+        };
+
+    /**
+     * Constructor.
+     */
+    public MonitorMainPanel(ExchangeEventsData exchangeEventsData,
+    					boolean choreoProvided){
+
+    	this.menuBar = new MonitorMenuBar(choreoProvided);
+    	
+        this.exchangeEventsData = exchangeEventsData;
+
+        this.setLayout(new BorderLayout());
+        this.add(menuBar, BorderLayout.PAGE_START);
+
+        JPanel layoutPanel = new JPanel();
+        layoutPanel.setLayout(new BorderLayout());
+
+        controlPanel = new ControlPanel();
+        layoutPanel.add(controlPanel, BorderLayout.PAGE_START);
+
+        MessageJPanel exchangeDetailPanel = null;
+
+        if(true){
+            exchangeDetailPanel = new MessageJPanel(true);
+        }
+
+        exchangeDetailPanel.setPreferredSize(new Dimension(600, 100));
+        exchangeDetailPanel.setMinimumSize(new Dimension(400, 100));
+
+        exchangePanel = new ExchangeJPanel(exchangeDetailPanel);
+        exchangePanel.setPreferredSize(new Dimension(600, 350));
+        exchangePanel.setMinimumSize(new Dimension(400, 200));
+
+        channelPanel = new ChannelJPanel(this.exchangeEventsData,exchangeEventsTableModel);
+        channelPanel.setPreferredSize(new Dimension(200, 580));
+        channelPanel.setMinimumSize(new Dimension(180, 400));
+
+        statusPanel = new StatusPanel();
+
+
+        JSplitPane otherPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, exchangePanel, exchangeDetailPanel);
+        JSplitPane mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, channelPanel, otherPanel);
+        layoutPanel.add(mainPanel, BorderLayout.CENTER);
+        layoutPanel.add(statusPanel, BorderLayout.SOUTH);
+
+        this.add(layoutPanel, BorderLayout.CENTER);
+    }
+
+    ////////////////////////////////////////////////////////////
+    
+    /** Returns the Channel Panel **/
+    public ChannelJPanel getChannelPanel()
+    {
+    	return channelPanel;
+    }
+
+    /** Returns an ImageIcon, or null if the path was invalid. */
+    protected static ImageIcon createImageIcon(String path) {
+        java.net.URL imgURL = MonitorMainPanel.class.getResource(path);
+        if (imgURL != null) {
+            return new ImageIcon(imgURL);
+        } else {
+            System.err.println("Couldn't find file: " + path);
+            return null;
+        }
+    }
+
+    ////////////////////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public void loadedChoreography(org.pi4soa.cdl.Package choreography){
+        channelPanel.createAndAddTree(choreography);
+        exchangeEventsTableModel.fireTableDataChanged();
+        menuBar.loadedChoreography();
+        choreographyName = choreography.getName();
+        setStatus("Loaded " + choreographyName);
+    }
+
+    ////////////////////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public void startedMonitoring(){
+        menuBar.startedMonitoring();
+        setStatus("Monitoring " + choreographyName);
+    }
+
+    ////////////////////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public void stoppedMonitoring(){
+        menuBar.stoppedMonitoring();
+        setStatus("Stopped monitoring " + choreographyName);
+    }
+
+    ////////////////////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public void importedEvents(){
+        exchangeEventsTableModel.cancelFiltering();
+        exchangeEventsTableModel.fireTableDataChanged();
+    }
+
+    ////////////////////////////////////////////////////////////
+
+    /**
+     * Can't remember what this is for.
+     */
+    public void setApplet(Monitor applet) {
+        //        ui.setApplet(applet);
+        menuBar.setMonitor(applet);
+    }
+    
+
+
+    ////////////////////////////////////////////
+
+    /**
+     * Called by the SwingMonitor when a new exchange event occurs.
+     *
+     * The event will already have been added to the vector or
+     * exchange events.
+     */
+    public void addedExchangeEvent(ExchangeEventWrapper wrapper){
+    	logger.fine(">>>> addedExchangeEvent");
+
+        String selectedChannelName = (String) exchangeEventsTableModel.getSelectedChannelName();
+        logger.fine("channel is: " + selectedChannelName);
+
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+        	logger.fine("fix flickering ...");
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+            	logger.fine("inner ...");
+                // This might not work when we hack the table ...
+                //                exchangeEventsTableModel.fireTableRowsInserted(index, index);
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsInserted(newIndex, newIndex);
+            }
+        }
+
+        updateTreeIfEventIsFault(wrapper);
+        logger.fine("<<<< addedExchangeEvent");
+    }
+    
+    ////////////////////////////////////////////
+
+    /**
+     * Called by the SwingMonitor when a new exchange event occurs.
+     *
+     * The event will already have been added to the vector or
+     * exchange events.
+     */
+    public void addedUnexpectedExchangeEvent(ExchangeEventWrapper wrapper){
+    	logger.fine(">>>> addedUnexpectedExchangeEvent");
+        String selectedChannelName = ChannelJPanel.getUnexpectedMessagesName();
+        logger.fine("channel is: " + selectedChannelName);
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+        	logger.fine("fix flickering ...");
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+                // This might not work when we hack the table ...
+                //                exchangeEventsTableModel.fireTableRowsInserted(index, index);
+            	logger.fine("inner ...");
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsInserted(newIndex, newIndex);
+            } else {
+            	exchangeEventsTableModel.fireTableDataChanged();
+            }
+        }
+        exchangeEventsTableModel.fireTableDataChanged();
+        updateTreeIfEventIsFault(wrapper);
+        
+    	logger.fine("<<<< addedUnexpectedExchangeEvent");
+    }
+
+    public void addedErrorEvent(ExchangeEventWrapper wrapper){
+    	logger.fine(">>>> addedErrorEvent");
+        String selectedChannelName = ChannelJPanel.getErrorName();
+        logger.fine("channel is: " + selectedChannelName);
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+        	logger.fine("fix flickering ...");
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+                // This might not work when we hack the table ...
+                //                exchangeEventsTableModel.fireTableRowsInserted(index, index);
+            	logger.fine("inner ...");
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsInserted(newIndex, newIndex);
+            } else {
+            	exchangeEventsTableModel.fireTableDataChanged();
+            }
+        }
+        exchangeEventsTableModel.fireTableDataChanged();
+        updateTreeIfEventIsFault(wrapper);
+        
+    	logger.fine("<<<< addedErrorEvent");
+    }
+
+    public void addedWarningEvent(ExchangeEventWrapper wrapper){
+    	logger.fine(">>>> addedErrorEvent");
+        String selectedChannelName = ChannelJPanel.getWarningName();
+        logger.fine("channel is: " + selectedChannelName);
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+        	logger.fine("fix flickering ...");
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+                // This might not work when we hack the table ...
+                //                exchangeEventsTableModel.fireTableRowsInserted(index, index);
+            	logger.fine("inner ...");
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsInserted(newIndex, newIndex);
+            } else {
+            	exchangeEventsTableModel.fireTableDataChanged();
+            }
+        }
+        exchangeEventsTableModel.fireTableDataChanged();
+        updateTreeIfEventIsFault(wrapper);
+        
+    	logger.fine("<<<< addedErrorEvent");
+    }
+
+    public void addedInformationEvent(ExchangeEventWrapper wrapper){
+    	logger.fine(">>>> addedErrorEvent");
+        String selectedChannelName = ChannelJPanel.getInformationName();
+        logger.fine("channel is: " + selectedChannelName);
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+        	logger.fine("fix flickering ...");
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+                // This might not work when we hack the table ...
+                //                exchangeEventsTableModel.fireTableRowsInserted(index, index);
+            	logger.fine("inner ...");
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsInserted(newIndex, newIndex);
+            } else {
+            	exchangeEventsTableModel.fireTableDataChanged();
+            }
+        }
+        exchangeEventsTableModel.fireTableDataChanged();
+        updateTreeIfEventIsFault(wrapper);
+        
+    	logger.fine("<<<< addedErrorEvent");
+    }
+    
+    ////////////////////////////////////////////
+
+    /**
+     * Called by the SwingMonitor when an existing exchange event is updated.
+     *
+     */
+    public void updatedExchangeEvent(ExchangeEventWrapper wrapper){
+
+        String selectedChannelName = (String) exchangeEventsTableModel.getSelectedChannelName();
+
+        // we are trying to fix the flickering updates here ...
+        if(selectedChannelName == null || wrapper.getChannelType().equals(selectedChannelName)){
+            int index = -1;
+            if((index = exchangeEventsTableModel.indexOfExchangeEventWrapperInFilteredList(wrapper)) != -1){
+                int newIndex = exchangeEventsTableModel.getRowCount() - 1 - index;
+                exchangeEventsTableModel.fireTableRowsUpdated(newIndex, newIndex);
+            }
+        }
+
+        updateTreeIfEventIsFault(wrapper);
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    void updateTreeIfEventIsFault(ExchangeEventWrapper wrapper){
+        if(wrapper.isFault()){
+            channelPanel.revalidate();
+            channelPanel.redraw();
+        }
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public void setStatus(String status){
+        statusPanel.setStatus(status);
+    }
+
+    ////////////////// Inner classes
+
+
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+  
+    ////////////////////////////////////////////
+
+    /**
+     * The upper pane contains a table listing the exchange events.
+     */
+    public class ExchangeJPanel extends JPanel{
+
+        /**
+         *
+         */
+        public ExchangeJPanel(ListSelectionListener listSelectionListener){
+
+            exchangeEventsTableModel = new ExchangeEventsTableModel();
+
+            final ExchangeEventRenderer exchangeEventRenderer = new ExchangeEventRenderer(true);
+            
+            JTable table = new JTable() {
+                public TableCellRenderer getCellRenderer(int row, int column) {
+                    return exchangeEventRenderer;
+                }
+            };
+            table.setModel(exchangeEventsTableModel);
+
+            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            table.setColumnSelectionAllowed(false);
+            table.getTableHeader().setReorderingAllowed(false);
+            
+            table.getColumnModel().getColumn(0).setPreferredWidth(40);
+            table.getColumnModel().getColumn(3).setPreferredWidth(200);
+            table.getColumnModel().getColumn(4).setPreferredWidth(40);
+            
+            ListSelectionModel rowSM = table.getSelectionModel();
+            rowSM.addListSelectionListener(listSelectionListener);
+
+            JScrollPane scrollpane = new JScrollPane(table);
+            this.setLayout(new BorderLayout());
+            this.add(scrollpane, BorderLayout.CENTER);
+        }
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public class ExchangeEventRenderer extends JLabel implements TableCellRenderer{
+
+        public ExchangeEventRenderer(boolean isBordered) {
+            //            this.isBordered = isBordered;
+            setOpaque(true); //MUST do this for background to show up.
+        }
+
+        public Component getTableCellRendererComponent(JTable table, Object object,
+                                                       boolean isSelected, boolean hasFocus,
+                                                       int row, int column) {
+            Integer index = exchangeEventsTableModel.getEventIndexForRow(row);
+
+            ExchangeEventWrapper wrapper = exchangeEventsData.getWrapper(index.intValue());
+            
+            logger.fine("RENDERING EXCHANGE:");
+            logger.fine("EXCHANGE IS: " + wrapper);
+
+            if(isSelected){
+                setForeground(table.getSelectionForeground());
+                setBackground(table.getSelectionBackground());
+            }
+            else{
+                setForeground(table.getForeground());
+                setBackground(table.getBackground());
+            }
+
+            if (object != null) {
+            	setText(object.toString());
+            } else {
+            	setText("");
+            }
+
+            //
+            // Sets the individual exchange color
+            //
+            if(wrapper.isError()){
+            	logger.info("isError - setting color dark red");
+                setForeground(Color.red.darker());
+            }
+            else if (wrapper.isUnexpected()){
+            	logger.info("isUnexpected - setting color red");
+            	setForeground(Color.red);
+            }
+            else if(wrapper.isWarning()){
+            	logger.info("isWarning - setting color orange");
+                setForeground(Color.orange);
+            }
+            else if(wrapper.isInformationMessage() && column == 3){
+            	logger.info("isInformationMessage - setting color blue");
+                setForeground(Color.blue);            	
+            }
+            if (wrapper.isUnexpected())
+            	setToolTipText("This message, '" + wrapper.getSendVariableTypeName()+ "' is invalid for this choreography.");
+            else
+            	setToolTipText(wrapper.getDescription()); //Discussed in the following section
+
+            return this;
+        }
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public class ExchangeEventsTableModel extends AbstractTableModel implements TreeSelectionListener{
+
+        String selectedChannelName = null;
+
+        Vector filteredExchangeEvents = null;
+
+        Vector emptyVector = new Vector();
+
+        boolean filterByChannel = true;
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public ExchangeEventsTableModel(){
+            this.filteredExchangeEvents = exchangeEventsData.getExchangeEvents();
+        }
+
+        ////////////////////////////////////////////
+
+        public int getColumnCount() {
+            return 5;
+        }
+
+        ////////////////////////////////////////////
+
+        public int getRowCount() {
+            return filteredExchangeEvents.size();
+        }
+
+        ////////////////////////////////////////////
+
+        public String getColumnName(int col) {
+            return getColumnNameSTP(col);
+        }
+
+        ////////////////////////////////////////////
+
+        public String getColumnNameSTP(int col) {
+            if(col == 0){ return "Session Id"; }
+            else if(col == 1){ return "From"; }
+            else if(col == 2){ return "To"; }
+            else if(col == 3){ return "Msg"; }
+            else return "Status";
+            //            else return "Priority";
+        }
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public Object getValueAt(int row, int col) {
+            return getValueAtSTP(row, col);
+        }
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public Class getColumnClass(int col) {
+            return Object.class;
+        }
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        protected ExchangeEventWrapper getWrapperForRow(int row) {
+            return (ExchangeEventWrapper) filteredExchangeEvents.elementAt(filteredExchangeEvents.size() - (row + 1));
+        }
+
+        ////////////////////////////////////////////
+
+
+        /**
+         *
+         */
+        public Integer getEventIndexForRow(int row) {
+            ExchangeEventWrapper wrapper = getWrapperForRow(row);
+            return wrapper.getIndex();
+        }
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public Object getValueAtSTP(int row, int col) {
+            ExchangeEventWrapper wrapper = getWrapperForRow(row);
+            //            ExchangeEvent exchangeEvent = wrapper.getExchangeEvent();
+
+            Object result = null;
+
+            switch(col){
+               case 0:
+                   result = wrapper.getMessageIdentity();
+                   break;
+               case 1:
+            	   result="";
+      
+            	   if (wrapper.getFromRoleTypeName() != null &&
+            			   wrapper.getFromRoleTypeName().trim().length() > 0) {
+            		   result = wrapper.getFromRoleTypeName();
+            	   } else if (wrapper.getServiceName() != null) {
+            		   result = org.pi4soa.common.xml.NameSpaceUtil.getLocalPart(
+            				   		wrapper.getServiceName());
+            	   }
+                   break;
+               case 2:
+            	   result="";
+            	      
+            	   if (wrapper.getToRoleTypeName() != null) {
+            		   result = wrapper.getToRoleTypeName();
+            	   }
+                   break;
+               case 3:
+                   result = wrapper.getMessageSummary();
+                   break;
+               case 4:
+                   result = wrapper.getStatus();
+                   break;
+               default:
+                   break;
+            }
+
+            return result;
+        }
+
+        ////////////////////////////////////////////
+
+
+        /**
+         *
+         */
+        public void cancelFiltering(){
+            JTree tree = channelPanel.getTree();
+
+            Vector exchangeEvents = exchangeEventsData.getExchangeEvents();
+            if(this.filteredExchangeEvents != exchangeEvents){
+                this.filteredExchangeEvents = exchangeEvents;
+            }
+            selectedChannelName = null;
+            fireTableDataChanged();
+            tree.clearSelection();
+        }
+
+        ////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public void setFilterByChannel(boolean filterByChannel){
+            this.filterByChannel = filterByChannel;
+            JTree tree = channelPanel.getTree();
+
+            if(filterByChannel == true){
+                valueChangedForTree(tree);
+            }
+            else{
+                Vector exchangeEvents = exchangeEventsData.getExchangeEvents();
+                if(this.filteredExchangeEvents != exchangeEvents){
+                    this.filteredExchangeEvents = exchangeEvents;
+                }
+                selectedChannelName = null;
+                fireTableDataChanged();
+
+                tree.clearSelection();
+            }
+        }
+
+        ////////////////////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public void setFilterByEventType(int index, ControlPanel controlPanel){
+
+            Vector oldFilteredExchangeEvents = filteredExchangeEvents;
+            Vector newFilteredExchangeEvents = null;
+
+            switch(index){
+               case 0:
+                   newFilteredExchangeEvents = exchangeEventsData.getExchangeEvents();
+                   break;
+               case 1:
+                   newFilteredExchangeEvents = exchangeEventsData.getWarningAndErrorExchangeEvents();
+                   break;
+               case 2:
+                   newFilteredExchangeEvents = exchangeEventsData.getErrorExchangeEvents();
+                   break;
+               case 3:
+                   newFilteredExchangeEvents = exchangeEventsData.getWarningExchangeEvents();
+                   break;
+              default:
+                // this ain't gonna happen
+                  return;
+                  //break;
+            }
+            /*
+            if(oldFilteredExchangeEvents != newFilteredExchangeEvents){
+                // we should also reset the enablement of the channel filtering ...
+                if(index == 0){
+                    controlPanel.setFilterEventsByChannelIsEnabled(true);
+                }
+                else{
+                    controlPanel.setFilterEventsByChannelIsEnabled(false);
+                }
+
+                this.filteredExchangeEvents = newFilteredExchangeEvents;
+                fireTableDataChanged();
+            }
+            */
+        }
+
+        ////////////////////////////////////////////////////////////
+
+        /**
+         * When the channel panel selection changes, we (should) filter
+         * the exchange event list.
+         *
+         * Right now, we simply print the selection name to stderr.
+         */
+        public void valueChanged(TreeSelectionEvent e) {
+
+        	logger.fine("valueChanged");
+            if(filterByChannel == false){
+                return;
+            }
+
+            JTree tree = (JTree) e.getSource();
+
+            valueChangedForTree(tree);
+        }
+
+
+        /**
+         *
+         */
+        public void valueChangedForTree(JTree tree) {
+        	logger.fine("valueChangedForTree");
+            DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
+
+            if(node == null) {
+                selectedChannelName = null;
+                return;
+            }
+
+            Vector oldFilteredExchangeEvents = filteredExchangeEvents;
+
+            if (node.isLeaf()) {
+            	logger.fine("Selected is: " + node.getUserObject().toString());
+            	selectedChannelName = (String) node.getUserObject().toString();
+                logger.fine("SelectedChannelName is " + selectedChannelName);
+                Vector newVector = exchangeEventsData.getExchangeEventsForChannel(selectedChannelName);
+
+                // avoid npe's
+                if(newVector == null) {
+                	newVector = exchangeEventsData.getExchangeEventsForSession(selectedChannelName);
+                    if (newVector == null) {
+                    	this.filteredExchangeEvents = emptyVector;
+                    	logger.fine("emptyVector");
+                    } else {
+                        this.filteredExchangeEvents = newVector;
+                        logger.fine("newVector (" + newVector.size() + ")");
+                    }
+                } else {
+                    this.filteredExchangeEvents = newVector;
+                    logger.fine("newVector (" + newVector.size() + ")");
+                }
+
+                
+
+            } else {
+                this.filteredExchangeEvents = exchangeEventsData.getExchangeEvents();
+                selectedChannelName = null;
+            }
+
+            if(oldFilteredExchangeEvents != filteredExchangeEvents) {
+                fireTableDataChanged();
+            }
+        }
+
+        ////////////////////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public String getSelectedChannelName(){
+            return selectedChannelName;
+        }
+
+        ////////////////////////////////////////////////////////////
+
+        /**
+         *
+         */
+        public int indexOfExchangeEventWrapperInFilteredList(Object o){
+            return filteredExchangeEvents.indexOf(o);
+        }
+    }
+
+    ////////////////////////////////////////////
+
+    public class StatusPanel extends JPanel{
+        JLabel statusJLabel = new JLabel();
+
+        public StatusPanel(){
+            this.setLayout(new BorderLayout());
+            this.add(statusJLabel, BorderLayout.LINE_START);
+            setStatus("No choreography loaded");
+        }
+
+        public void setStatus(String status){
+            statusJLabel.setText(status);
+        }
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    public class ControlPanel extends JPanel implements ItemListener, ActionListener{
+        //JCheckBox filterEventsByChannelJCheckBox = new JCheckBox("Filter by channel", true);
+
+        Object sessionItems[] = { "All sessions" };
+        //JComboBox sessionPopupMenu = new JComboBox(sessionItems);
+
+        // add the sessions to the jpopup menu ...
+        //        JComboBox sessionPopupMenu = new JComboBox(sessionItems);
+
+        //Object showItems[] = { "All Events", "Errors and Warnings", "Errors", "Warnings" };
+        //JComboBox showPopupMenu = new JComboBox(showItems);
+
+        //        JComboBox showPopupMenu = new JComboBox("Show: ");
+
+
+
+        /**
+         *
+         */
+        public ControlPanel(){
+            this.setLayout(new BorderLayout());
+            //this.add(filterEventsByChannelJCheckBox, BorderLayout.WEST);
+
+            //filterEventsByChannelJCheckBox.addItemListener(this);
+
+            //            this.add(sessionPopupMenu, BorderLayout.CENTER);
+            //JPanel layoutPanel = new JPanel();
+           // layoutPanel.setLayout(new FlowLayout());
+
+            //layoutPanel.add(new JLabel("Show: "));
+            //layoutPanel.add(showPopupMenu);
+            //showPopupMenu.addActionListener(this);
+
+            //this.add(layoutPanel, BorderLayout.EAST);
+        }
+
+
+        /**
+         *
+         *
+        public void itemStateChanged(ItemEvent e) {
+            Object source = e.getItemSelectable();
+            if(source == filterEventsByChannelJCheckBox){
+                boolean filterByChannel = filterEventsByChannelJCheckBox.isSelected();
+                exchangeEventsTableModel.setFilterByChannel(filterByChannel);
+            }
+        }
+	    */
+        public void itemStateChanged(ItemEvent e) {}
+        
+
+        /**
+         *
+         *
+        public void actionPerformed(ActionEvent e) {
+            Object source = e.getSource();
+            if(source == showPopupMenu){
+                int index = showPopupMenu.getSelectedIndex();
+                exchangeEventsTableModel.setFilterByEventType(index, this);
+            }
+        }
+        */
+        public void actionPerformed(ActionEvent e) {}
+        
+
+
+        /**
+         *
+         *
+        public void setFilterEventsByChannelIsEnabled(boolean setFilterEventsByChannelIsEnabled){
+            if(setFilterEventsByChannelIsEnabled == false){
+                filterEventsByChannelJCheckBox.setSelected(false);
+            }
+            filterEventsByChannelJCheckBox.setEnabled(setFilterEventsByChannelIsEnabled);
+        }
+        */
+        public void setFilterEventsByChannelIsEnabled(boolean setFilterEventsByChannelIsEnabled){}
+
+    }
+
+    ////////////////////////////////////////////
+
+    /**
+     *
+     */
+    //    public class MessageJPanel extends ExchangeDetailJPanel implements ListSelectionListener{
+    public class MessageJPanel extends JPanel implements ListSelectionListener{
+
+        JTextArea msgTextArea = null;
+
+        /**
+         *
+         */
+        public MessageJPanel(boolean dummy){
+            msgTextArea = new JTextArea();
+            msgTextArea.setEditable(false);
+            JScrollPane scrollpane = new JScrollPane(msgTextArea);
+            this.setLayout(new BorderLayout());
+            this.add(scrollpane, BorderLayout.CENTER);
+        }
+
+
+        public void valueChanged(ListSelectionEvent e) {
+
+            logger.fine(">>>> valueChanged - new message selected");
+
+            //Ignore extra messages.
+            if (e.getValueIsAdjusting()) {
+               logger.fine(">>>> just adjusting - returning early");
+               return;
+            }
+
+            ListSelectionModel lsm = (ListSelectionModel)e.getSource();
+
+            if (lsm.isSelectionEmpty()){
+               logger.fine(">>>> no rows selected");
+                // no rows are selected
+            }
+            else{
+                // selectedRow is selected
+                // harhar. grab the first value ...
+                int selectedRowIndex = lsm.getMinSelectionIndex();
+
+               logger.fine(">>>> selectedIndex = " + selectedRowIndex);
+
+                Integer index = (Integer) exchangeEventsTableModel.getEventIndexForRow(selectedRowIndex);
+
+                // ExchangeEventWrapper wrapper = (ExchangeEventWrapper) exchangeEvents.elementAt(index.intValue());
+                ExchangeEventWrapper wrapper = exchangeEventsData.getWrapper(index.intValue());
+
+
+                // avoid NPE's
+                if(wrapper != null){
+                    this.updateDetails(wrapper);
+                }
+                else{
+                    logger.fine(">>>> null exception wrapper");
+                }
+            }
+        }
+
+
+        /**
+         *
+         */
+        public void updateDetails(ExchangeEventWrapper exchangeEventWrapper){
+            String text = exchangeEventWrapper.getMessageValue();
+            logger.info("MESSAGE PAYLOAD: " + text);
+            
+            try {
+            	org.w3c.dom.Node node=org.pi4soa.common.xml.XMLUtils.getNode(text);
+            	
+            	text = org.pi4soa.common.xml.XMLUtils.getText(node, true);
+            	
+            } catch (Exception e) {
+            	//text = "Unable to display message\r\n\r\n"+e;
+            }
+            
+            if (exchangeEventWrapper.getExceptionValue() != null) {
+            	text += "\r\n\r\nException Trace:\r\n"+
+            			exchangeEventWrapper.getExceptionValue();
+            }
+            
+            msgTextArea.setText(text);
+            msgTextArea.setBackground(Color.lightGray);
+            msgTextArea.setCaretPosition(0);
+        }
+    }
+
+}
+
+
+// EOF

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMenuBar.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMenuBar.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorMenuBar.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import javax.swing.*;
+import java.awt.event.*;
+import java.io.*;
+
+/**
+ *
+ */
+public class MonitorMenuBar extends JMenuBar {
+
+    MonitorMenuBar menuBar = this;
+
+    static final int NEW_FRAME_WIDTH = 415;
+    static final int NEW_FRAME_HEIGHT = 330;    
+
+    JMenu fileMenu = new JMenu("File");
+    JMenu editMenu = new JMenu("Edit");
+    JMenu monitorMenu = new JMenu("Monitor");
+    JMenu helpMenu = new JMenu("Help");
+    
+    JMenuItem openItem = new JMenuItem("Open Choreography...");
+    JMenuItem importItem = new JMenuItem("Import Events...");
+    JMenuItem exportItem = new JMenuItem("Export Events...");
+    JMenuItem exitItem = new JMenuItem("Exit");
+    
+    JMenuItem undoItem = new JMenuItem("Undo");
+    JMenuItem cutItem = new JMenuItem("Cut");
+    JMenuItem copyItem = new JMenuItem("Copy");               
+    JMenuItem pasteItem = new JMenuItem("Paste");               
+    JMenuItem selectAllItem = new JMenuItem("Select All");               
+    JMenuItem clearItem = new JMenuItem("Clear");
+    JMenuItem preferencesItem = new JMenuItem("Preferences...");
+
+    JMenuItem startMonitoringItem = new JMenuItem("Start Monitoring");
+    JMenuItem stopMonitoringItem = new JMenuItem("Stop Monitoring");
+
+    JMenuItem helpItem = new JMenuItem("About Choreography Monitor");
+   
+    Monitor monitor;
+
+    /**
+     * 
+     */
+    public MonitorMenuBar(boolean choreoProvided){
+        setUpFileMenu(choreoProvided);
+        setUpEditMenu(choreoProvided);
+        setUpMonitorMenu(choreoProvided);
+        setUpHelpMenu(choreoProvided);        
+    }
+
+
+    /**
+     *
+     */
+    private void setUpFileMenu(boolean choreoProvided){
+        openItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.Event.META_MASK));
+        exitItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.Event.META_MASK));
+        
+        openItem.setEnabled(true);
+        importItem.setEnabled(true);
+        exportItem.setEnabled(false);
+        exitItem.setEnabled(true);
+
+        openItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                JFileChooser chooser = new JFileChooser();
+                chooser.setDialogTitle("Open Choreography");
+
+                // Note: source for ExampleFileFilter can be found in FileChooserDemo,
+                // under the demo/jfc directory in the Java 2 SDK, Standard Edition.
+                MonitorFileFilter filter = new MonitorFileFilter();
+                filter.addExtension("cdm");
+                filter.setDescription("CDM Files");
+                chooser.setFileFilter(filter);
+                int returnVal = chooser.showOpenDialog(menuBar);
+                if(returnVal == JFileChooser.APPROVE_OPTION) {
+                    File directory = chooser.getCurrentDirectory();
+                    String fileName = chooser.getSelectedFile().getName();
+                    File path = new File(directory, fileName);
+                    monitor.loadChoreography(path.getPath());
+
+                    // now that we've opened, start monitoring should be enabled.
+                }
+            }
+        });
+
+
+        importItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                JFileChooser chooser = new JFileChooser();
+                chooser.setDialogTitle("Import Events");
+
+                // Note: source for ExampleFileFilter can be found in FileChooserDemo,
+                // under the demo/jfc directory in the Java 2 SDK, Standard Edition.
+                MonitorFileFilter filter = new MonitorFileFilter();
+                filter.addExtension("data");
+                filter.setDescription("Exchange Events");
+                chooser.setFileFilter(filter);
+                int returnVal = chooser.showOpenDialog(menuBar);
+                if(returnVal == JFileChooser.APPROVE_OPTION) {
+                    File directory = chooser.getCurrentDirectory();
+                    String fileName = chooser.getSelectedFile().getName();
+                    File path = new File(directory, fileName);
+                    monitor.importEvents(path.getPath());
+                }
+            }
+        });
+
+
+        exportItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                JFileChooser chooser = new JFileChooser();
+                chooser.setDialogTitle("Export Events");
+
+                // Note: source for ExampleFileFilter can be found in FileChooserDemo,
+                // under the demo/jfc directory in the Java 2 SDK, Standard Edition.
+                //                ExampleFileFilter filter = new ExampleFileFilter();
+                //                filter.addExtension("data");
+                //                filter.setDescription("Exchange Events");
+                //                chooser.setFileFilter(filter);
+                int returnVal = chooser.showSaveDialog(menuBar);
+                if(returnVal == JFileChooser.APPROVE_OPTION) {
+                    File directory = chooser.getCurrentDirectory();
+                    String fileName = chooser.getSelectedFile().getName();
+                    File path = new File(directory, fileName);
+                    monitor.exportEvents(path.getPath());
+                }
+            }
+        });
+
+        exitItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+            	monitor.close();
+            }
+        });
+
+        if (!choreoProvided) {
+        	fileMenu.add(openItem);
+        	fileMenu.add(new JSeparator());
+        }
+        
+        // Disable import/export in this version
+        // If re-enabled, need to sort out message summary
+        // persistence, as it uses the exchange event which
+        // is transient
+        //fileMenu.add(importItem);                
+        //fileMenu.add(exportItem);                
+        //fileMenu.add(new JSeparator());                        
+        
+        fileMenu.add(exitItem);
+
+        this.add(fileMenu);
+    }
+
+
+    /**
+     *
+     */
+    private void setUpEditMenu(boolean choreoProvided){
+
+        undoItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.Event.META_MASK));
+        cutItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.Event.META_MASK));
+        copyItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.Event.META_MASK));
+        pasteItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.Event.META_MASK));
+        selectAllItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.Event.META_MASK));
+        preferencesItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P /* was VK_SEMICOLON */, 
+                                                              java.awt.Event.META_MASK));
+
+        undoItem.setEnabled(false);
+        cutItem.setEnabled(false);
+        copyItem.setEnabled(false);
+        pasteItem.setEnabled(false);
+        selectAllItem.setEnabled(false);
+        clearItem.setEnabled(false);
+        
+        // preferences menu implementation
+        preferencesItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                //                preferences.setVisible(true);
+            }
+        });
+        
+        editMenu.add(undoItem);
+        editMenu.add(new JSeparator());                        
+        editMenu.add(cutItem);
+        editMenu.add(copyItem);
+        editMenu.add(pasteItem);                                                
+        editMenu.add(selectAllItem);                                                        
+        editMenu.add(clearItem);
+        editMenu.add(new JSeparator());                        
+        editMenu.add(preferencesItem);
+
+        /*
+        this.add(editMenu);
+        */
+    }
+
+
+    /**
+     *
+     */
+    private void setUpMonitorMenu(boolean choreoProvided){
+        startMonitoringItem.setEnabled(false);
+        stopMonitoringItem.setEnabled(false);
+
+        startMonitoringItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                monitor.startMonitoring();
+            }
+        });
+
+        stopMonitoringItem.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                monitor.stopMonitoring();
+            }
+        });
+
+        monitorMenu.add(startMonitoringItem);
+        monitorMenu.add(stopMonitoringItem);
+
+        if (!choreoProvided) {
+        	this.add(monitorMenu);
+        }
+    }        
+
+
+    /**
+     *
+     */
+    private void setUpHelpMenu(boolean choreoProvided){
+        helpItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
+        helpMenu.add(helpItem);
+        helpItem.setEnabled(true);
+
+        helpItem.addActionListener(new ActionListener() {            
+            public void actionPerformed(ActionEvent e) {
+                JOptionPane.showMessageDialog(null,
+                		"pi4soa Choreography Monitor\r\n\r\n" +
+                		"Version 1\r\n\r\n" +
+                		"(c) Pi4 Technologies Ltd, 2005-8",
+                		"About ...", JOptionPane.INFORMATION_MESSAGE);
+            }
+        });
+
+        this.add(helpMenu);
+    }
+    
+
+    /**
+     * 
+     */
+    public void setMonitor(Monitor monitor) {
+        this.monitor = monitor;
+    }
+
+
+    /**
+     *
+     */
+    public void loadedChoreography(){
+        startMonitoringItem.setEnabled(true);
+    }
+
+
+    /**
+     *
+     */
+    public void startedMonitoring(){
+        openItem.setEnabled(false);
+        importItem.setEnabled(false);
+        exportItem.setEnabled(true);
+        startMonitoringItem.setEnabled(false);
+        stopMonitoringItem.setEnabled(true);
+    }
+
+
+    /**
+     *
+     */
+    public void stoppedMonitoring(){
+        openItem.setEnabled(true);
+        importItem.setEnabled(true);
+        exportItem.setEnabled(true);
+        startMonitoringItem.setEnabled(true);
+        stopMonitoringItem.setEnabled(false);
+    }
+
+    /**
+     *
+     */
+    public void importedEvents(){
+        exportItem.setEnabled(true);
+    }
+
+} // End of class
+
+
+// EOF

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorTreeModelListener.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorTreeModelListener.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/MonitorTreeModelListener.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import java.util.logging.Logger;
+
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.pi4soa.service.correlator.CorrelationSession;
+
+
+/**
+ * The left hand pane contains a tree whose root is the
+ * choreography, and whose leaves are channels.
+ *
+ * Selecting a channel filters the exchange events list (or should
+ * do).
+ */
+class MonitorTreeModelListener implements TreeModelListener {
+	
+	private static Logger logger = Logger.getLogger("org.savara.tools.monitor.ui");
+	  
+    public void treeNodesChanged(TreeModelEvent e) {
+        DefaultMutableTreeNode node;
+        node = (DefaultMutableTreeNode)
+                 (e.getTreePath().getLastPathComponent());
+
+        /*
+         * If the event lists children, then the changed
+         * node is the child of the node we've already
+         * gotten.  Otherwise, the changed node and the
+         * specified node are the same.
+         */
+        try {
+            int index = e.getChildIndices()[0];
+            node = (DefaultMutableTreeNode)
+                   (node.getChildAt(index));
+        } catch (NullPointerException exc) {}
+
+        logger.fine(">>> CHANGED NODE");
+        logger.fine("The user has finished editing the node.");
+        logger.fine("New value: " + node.getUserObject());
+    }
+    public void treeNodesInserted(TreeModelEvent e) {
+    	logger.fine(">>> INSERTED NODE");
+    }
+    public void treeNodesRemoved(TreeModelEvent e) {
+    	logger.fine(">>> REMOVED NODE");
+    }
+    public void treeStructureChanged(TreeModelEvent e) {
+    	logger.fine(">>> TREE STRUCTURE CHANGED");
+    }
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/SpringUtilities.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/SpringUtilities.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/SpringUtilities.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+import javax.swing.*;
+import javax.swing.SpringLayout;
+import java.awt.*;
+
+/**
+ * A 1.4 file that provides utility methods for
+ * creating form- or grid-style layouts with SpringLayout.
+ * These utilities are used by several programs, such as
+ * SpringBox and SpringCompactGrid.
+ */
+public class SpringUtilities {
+    /**
+     * A debugging utility that prints to stdout the component's
+     * minimum, preferred, and maximum sizes.
+     */
+    public static void printSizes(Component c) {
+        System.out.println("minimumSize = " + c.getMinimumSize());
+        System.out.println("preferredSize = " + c.getPreferredSize());
+        System.out.println("maximumSize = " + c.getMaximumSize());
+    }
+
+    /**
+     * Aligns the first <code>rows</code> * <code>cols</code>
+     * components of <code>parent</code> in
+     * a grid. Each component is as big as the maximum
+     * preferred width and height of the components.
+     * The parent is made just big enough to fit them all.
+     *
+     * @param rows number of rows
+     * @param cols number of columns
+     * @param initialX x location to start the grid at
+     * @param initialY y location to start the grid at
+     * @param xPad x padding between cells
+     * @param yPad y padding between cells
+     */
+    public static void makeGrid(Container parent,
+                                int rows, int cols,
+                                int initialX, int initialY,
+                                int xPad, int yPad) {
+        SpringLayout layout;
+        try {
+            layout = (SpringLayout)parent.getLayout();
+        } catch (ClassCastException exc) {
+            System.err.println("The first argument to makeGrid must use SpringLayout.");
+            return;
+        }
+
+        Spring xPadSpring = Spring.constant(xPad);
+        Spring yPadSpring = Spring.constant(yPad);
+        Spring initialXSpring = Spring.constant(initialX);
+        Spring initialYSpring = Spring.constant(initialY);
+        int max = rows * cols;
+
+        //Calculate Springs that are the max of the width/height so that all
+        //cells have the same size.
+        Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
+            getWidth();
+        Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
+            getWidth();
+        for (int i = 1; i < max; i++) {
+            SpringLayout.Constraints cons = layout.getConstraints(
+                                                                  parent.getComponent(i));
+
+            maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
+            maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
+        }
+
+        //Apply the new width/height Spring. This forces all the
+        //components to have the same size.
+        for (int i = 0; i < max; i++) {
+            SpringLayout.Constraints cons = layout.getConstraints(
+                                                                  parent.getComponent(i));
+
+            cons.setWidth(maxWidthSpring);
+            cons.setHeight(maxHeightSpring);
+        }
+
+        //Then adjust the x/y constraints of all the cells so that they
+        //are aligned in a grid.
+        SpringLayout.Constraints lastCons = null;
+        SpringLayout.Constraints lastRowCons = null;
+        for (int i = 0; i < max; i++) {
+            SpringLayout.Constraints cons = layout.getConstraints(
+                                                                  parent.getComponent(i));
+            if (i % cols == 0) { //start of new row
+                lastRowCons = lastCons;
+                cons.setX(initialXSpring);
+            } else { //x position depends on previous component
+                cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
+                                     xPadSpring));
+            }
+
+            if (i / cols == 0) { //first row
+                cons.setY(initialYSpring);
+            } else { //y position depends on previous row
+                cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
+                                     yPadSpring));
+            }
+            lastCons = cons;
+        }
+
+        //Set the parent's size.
+        SpringLayout.Constraints pCons = layout.getConstraints(parent);
+        pCons.setConstraint(SpringLayout.SOUTH,
+                            Spring.sum(
+                                       Spring.constant(yPad),
+                                       lastCons.getConstraint(SpringLayout.SOUTH)));
+        pCons.setConstraint(SpringLayout.EAST,
+                            Spring.sum(
+                                       Spring.constant(xPad),
+                                       lastCons.getConstraint(SpringLayout.EAST)));
+    }
+
+    /* Used by makeCompactGrid. */
+    private static SpringLayout.Constraints getConstraintsForCell(
+                                                                  int row, int col,
+                                                                  Container parent,
+                                                                  int cols) {
+        SpringLayout layout = (SpringLayout) parent.getLayout();
+        Component c = parent.getComponent(row * cols + col);
+        return layout.getConstraints(c);
+    }
+
+    /**
+     * Aligns the first <code>rows</code> * <code>cols</code>
+     * components of <code>parent</code> in
+     * a grid. Each component in a column is as wide as the maximum
+     * preferred width of the components in that column;
+     * height is similarly determined for each row.
+     * The parent is made just big enough to fit them all.
+     *
+     * @param rows number of rows
+     * @param cols number of columns
+     * @param initialX x location to start the grid at
+     * @param initialY y location to start the grid at
+     * @param xPad x padding between cells
+     * @param yPad y padding between cells
+     */
+    public static void makeCompactGrid(Container parent,
+                                       int rows, int cols,
+                                       int initialX, int initialY,
+                                       int xPad, int yPad) {
+        SpringLayout layout;
+        try {
+            layout = (SpringLayout)parent.getLayout();
+        } catch (ClassCastException exc) {
+            System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
+            return;
+        }
+
+        //Align all cells in each column and make them the same width.
+        Spring x = Spring.constant(initialX);
+        for (int c = 0; c < cols; c++) {
+            Spring width = Spring.constant(0);
+            for (int r = 0; r < rows; r++) {
+                width = Spring.max(width,
+                                   getConstraintsForCell(r, c, parent, cols).
+                                   getWidth());
+            }
+            for (int r = 0; r < rows; r++) {
+                SpringLayout.Constraints constraints =
+                    getConstraintsForCell(r, c, parent, cols);
+                constraints.setX(x);
+                constraints.setWidth(width);
+            }
+            x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
+        }
+
+        //Align all cells in each row and make them the same height.
+        Spring y = Spring.constant(initialY);
+        for (int r = 0; r < rows; r++) {
+            Spring height = Spring.constant(0);
+            for (int c = 0; c < cols; c++) {
+                height = Spring.max(height,
+                                    getConstraintsForCell(r, c, parent, cols).
+                                    getHeight());
+            }
+            for (int c = 0; c < cols; c++) {
+                SpringLayout.Constraints constraints =
+                    getConstraintsForCell(r, c, parent, cols);
+                constraints.setY(y);
+                constraints.setHeight(height);
+            }
+            y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
+        }
+
+        //Set the parent's size.
+        SpringLayout.Constraints pCons = layout.getConstraints(parent);
+        pCons.setConstraint(SpringLayout.SOUTH, y);
+        pCons.setConstraint(SpringLayout.EAST, x);
+    }
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/XmlPrettyPrinter.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/XmlPrettyPrinter.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/XmlPrettyPrinter.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui;
+
+
+import org.w3c.dom.Document;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.ParserConfigurationException;
+
+//import org.apache.xml.serialize.OutputFormat;
+//import org.apache.xml.serialize.XMLSerializer;
+
+import java.io.IOException;
+import java.io.StringBufferInputStream;
+import java.io.ByteArrayOutputStream;
+
+import org.xml.sax.SAXException;
+
+/**
+ *
+ */
+public class XmlPrettyPrinter{
+
+    /**
+     *
+     */
+    public static String prettify(String input){
+
+        // Find the implementation
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = null;
+
+        try{
+            builder = factory.newDocumentBuilder();
+        }
+        catch(ParserConfigurationException pce){
+            System.err.println("Exception: " + pce);
+            return null;
+        }
+
+        StringBufferInputStream stringBufferInputStream = new StringBufferInputStream(input);
+
+        Document doc = null;
+
+        try{
+            doc = builder.parse(stringBufferInputStream);
+        }
+        catch(SAXException se){
+            System.err.println("Exception: " + se);
+            return null;
+        }
+        catch(IOException ioe){
+            System.err.println("Exception: " + ioe);
+            return null;
+        }
+        
+        String text=null;
+        
+        try {
+        	text = org.pi4soa.common.xml.XMLUtils.getText(doc, true);
+        } catch(Exception e) {
+        	System.err.println("Exception: " + e);
+        }
+        
+        return(text);
+
+        /*
+        OutputFormat format = new OutputFormat(doc);
+        format.setLineWidth(65);
+        format.setIndenting(true);
+        format.setIndent(2);
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        XMLSerializer serializer = new XMLSerializer(byteArrayOutputStream, format);
+
+        try{
+            serializer.serialize(doc);
+        }
+        catch(IOException ioe){
+            System.err.println("Exception: " + ioe);
+            return null;
+        }
+
+        return byteArrayOutputStream.toString();
+        */
+    }
+
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelclosed.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelclosed.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelempty.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelempty.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelleaf.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelleaf.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelopen.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/channelopen.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/errorsleaf.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/errorsleaf.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesclosed.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesclosed.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesempty.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesempty.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesopen.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/issuesopen.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/monitor.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/monitor.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnclosed.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnclosed.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnempty.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnempty.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnleaf.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnleaf.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnopen.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/txnopen.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/unexpectedleaf.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/unexpectedleaf.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/warningsleaf.png
===================================================================
(Binary files differ)


Property changes on: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/icons/warningsleaf.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/table/TableSorter.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/table/TableSorter.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/monitor/ui/table/TableSorter.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,450 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 16 Jan, 2008 : Initial version created by martin
+ */
+package org.savara.tools.monitor.ui.table;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+import java.util.List;
+
+import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.*;
+
+public class TableSorter extends AbstractTableModel {
+    protected TableModel tableModel;
+
+    public static final int DESCENDING = -1;
+    public static final int NOT_SORTED = 0;
+    public static final int ASCENDING = 1;
+
+    private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
+
+    public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() {
+            public int compare(Object o1, Object o2) {
+                return ((Comparable) o1).compareTo(o2);
+            }
+        };
+    public static final Comparator LEXICAL_COMPARATOR = new Comparator() {
+            public int compare(Object o1, Object o2) {
+                return o1.toString().compareTo(o2.toString());
+            }
+        };
+
+    private Row[] viewToModel;
+    private int[] modelToView;
+
+    private JTableHeader tableHeader;
+    private MouseListener mouseListener;
+    private TableModelListener tableModelListener;
+    private Map columnComparators = new HashMap();
+    private List sortingColumns = new ArrayList();
+
+    public TableSorter() {
+        this.mouseListener = new MouseHandler();
+        this.tableModelListener = new TableModelHandler();
+    }
+
+    public TableSorter(TableModel tableModel) {
+        this();
+        setTableModel(tableModel);
+    }
+
+    public TableSorter(TableModel tableModel, JTableHeader tableHeader) {
+        this();
+        setTableHeader(tableHeader);
+        setTableModel(tableModel);
+    }
+
+    private void clearSortingState() {
+        viewToModel = null;
+        modelToView = null;
+    }
+
+    public TableModel getTableModel() {
+        return tableModel;
+    }
+
+    public void setTableModel(TableModel tableModel) {
+        if (this.tableModel != null) {
+            this.tableModel.removeTableModelListener(tableModelListener);
+        }
+
+        this.tableModel = tableModel;
+        if (this.tableModel != null) {
+            this.tableModel.addTableModelListener(tableModelListener);
+        }
+
+        clearSortingState();
+        fireTableStructureChanged();
+    }
+
+    public JTableHeader getTableHeader() {
+        return tableHeader;
+    }
+
+    public void setTableHeader(JTableHeader tableHeader) {
+        if (this.tableHeader != null) {
+            this.tableHeader.removeMouseListener(mouseListener);
+            TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
+            if (defaultRenderer instanceof SortableHeaderRenderer) {
+                this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
+            }
+        }
+        this.tableHeader = tableHeader;
+        if (this.tableHeader != null) {
+            this.tableHeader.addMouseListener(mouseListener);
+            this.tableHeader.setDefaultRenderer(
+                                                new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer()));
+        }
+    }
+
+    public boolean isSorting() {
+        return sortingColumns.size() != 0;
+    }
+
+    private Directive getDirective(int column) {
+        for (int i = 0; i < sortingColumns.size(); i++) {
+            Directive directive = (Directive)sortingColumns.get(i);
+            if (directive.column == column) {
+                return directive;
+            }
+        }
+        return EMPTY_DIRECTIVE;
+    }
+
+    public int getSortingStatus(int column) {
+        return getDirective(column).direction;
+    }
+
+    private void sortingStatusChanged() {
+        clearSortingState();
+        fireTableDataChanged();
+        if (tableHeader != null) {
+            tableHeader.repaint();
+        }
+    }
+
+    public void setSortingStatus(int column, int status) {
+        Directive directive = getDirective(column);
+        if (directive != EMPTY_DIRECTIVE) {
+            sortingColumns.remove(directive);
+        }
+        if (status != NOT_SORTED) {
+            sortingColumns.add(new Directive(column, status));
+        }
+        sortingStatusChanged();
+    }
+
+    protected Icon getHeaderRendererIcon(int column, int size) {
+        Directive directive = getDirective(column);
+        if (directive == EMPTY_DIRECTIVE) {
+            return null;
+        }
+        return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
+    }
+
+    private void cancelSorting() {
+        sortingColumns.clear();
+        sortingStatusChanged();
+    }
+
+    public void setColumnComparator(Class type, Comparator comparator) {
+        if (comparator == null) {
+            columnComparators.remove(type);
+        } else {
+            columnComparators.put(type, comparator);
+        }
+    }
+
+    protected Comparator getComparator(int column) {
+        Class columnType = tableModel.getColumnClass(column);
+        Comparator comparator = (Comparator) columnComparators.get(columnType);
+        if (comparator != null) {
+            return comparator;
+        }
+        if (Comparable.class.isAssignableFrom(columnType)) {
+            return COMPARABLE_COMAPRATOR;
+        }
+        return LEXICAL_COMPARATOR;
+    }
+
+    private Row[] getViewToModel() {
+        if (viewToModel == null) {
+            int tableModelRowCount = tableModel.getRowCount();
+            viewToModel = new Row[tableModelRowCount];
+            for (int row = 0; row < tableModelRowCount; row++) {
+                viewToModel[row] = new Row(row);
+            }
+
+            if (isSorting()) {
+                Arrays.sort(viewToModel);
+            }
+        }
+        return viewToModel;
+    }
+
+    public int modelIndex(int viewIndex) {
+        return getViewToModel()[viewIndex].modelIndex;
+    }
+
+    private int[] getModelToView() {
+        if (modelToView == null) {
+            int n = getViewToModel().length;
+            modelToView = new int[n];
+            for (int i = 0; i < n; i++) {
+                modelToView[modelIndex(i)] = i;
+            }
+        }
+        return modelToView;
+    }
+
+    // TableModel interface methods 
+
+    public int getRowCount() {
+        return (tableModel == null) ? 0 : tableModel.getRowCount();
+    }
+
+    public int getColumnCount() {
+        return (tableModel == null) ? 0 : tableModel.getColumnCount();
+    }
+
+    public String getColumnName(int column) {
+        return tableModel.getColumnName(column);
+    }
+
+    public Class getColumnClass(int column) {
+        return tableModel.getColumnClass(column);
+    }
+
+    public boolean isCellEditable(int row, int column) {
+        return tableModel.isCellEditable(modelIndex(row), column);
+    }
+
+    public Object getValueAt(int row, int column) {
+        return tableModel.getValueAt(modelIndex(row), column);
+    }
+
+    public void setValueAt(Object aValue, int row, int column) {
+        tableModel.setValueAt(aValue, modelIndex(row), column);
+    }
+
+    // Helper classes
+    
+    private class Row implements Comparable {
+        private int modelIndex;
+
+        public Row(int index) {
+            this.modelIndex = index;
+        }
+
+        public int compareTo(Object o) {
+            int row1 = modelIndex;
+            int row2 = ((Row) o).modelIndex;
+
+            for (Iterator it = sortingColumns.iterator(); it.hasNext();) {
+                Directive directive = (Directive) it.next();
+                int column = directive.column;
+                Object o1 = tableModel.getValueAt(row1, column);
+                Object o2 = tableModel.getValueAt(row2, column);
+
+                int comparison = 0;
+                // Define null less than everything, except null.
+                if (o1 == null && o2 == null) {
+                    comparison = 0;
+                } else if (o1 == null) {
+                    comparison = -1;
+                } else if (o2 == null) {
+                    comparison = 1;
+                } else {
+                    comparison = getComparator(column).compare(o1, o2);
+                }
+                if (comparison != 0) {
+                    return directive.direction == DESCENDING ? -comparison : comparison;
+                }
+            }
+            return 0;
+        }
+    }
+
+    private class TableModelHandler implements TableModelListener {
+        public void tableChanged(TableModelEvent e) {
+            // If we're not sorting by anything, just pass the event along.             
+            if (!isSorting()) {
+                clearSortingState();
+                fireTableChanged(e);
+                return;
+            }
+                
+            // If the table structure has changed, cancel the sorting; the             
+            // sorting columns may have been either moved or deleted from             
+            // the model. 
+            if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
+                cancelSorting();
+                fireTableChanged(e);
+                return;
+            }
+
+            // We can map a cell event through to the view without widening             
+            // when the following conditions apply: 
+            // 
+            // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and, 
+            // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
+            // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and, 
+            // d) a reverse lookup will not trigger a sort (modelToView != null)
+            //
+            // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
+            // 
+            // The last check, for (modelToView != null) is to see if modelToView 
+            // is already allocated. If we don't do this check; sorting can become 
+            // a performance bottleneck for applications where cells  
+            // change rapidly in different parts of the table. If cells 
+            // change alternately in the sorting column and then outside of             
+            // it this class can end up re-sorting on alternate cell updates - 
+            // which can be a performance problem for large tables. The last 
+            // clause avoids this problem. 
+            int column = e.getColumn();
+            if (e.getFirstRow() == e.getLastRow()
+                    && column != TableModelEvent.ALL_COLUMNS
+                && getSortingStatus(column) == NOT_SORTED
+                && modelToView != null) {
+                int viewIndex = getModelToView()[e.getFirstRow()];
+                fireTableChanged(new TableModelEvent(TableSorter.this, 
+                                                     viewIndex, viewIndex, 
+                                                     column, e.getType()));
+                return;
+            }
+
+            // Something has happened to the data that may have invalidated the row order. 
+            clearSortingState();
+            fireTableDataChanged();
+            return;
+        }
+    }
+
+    private class MouseHandler extends MouseAdapter {
+        public void mouseClicked(MouseEvent e) {
+            JTableHeader h = (JTableHeader) e.getSource();
+            TableColumnModel columnModel = h.getColumnModel();
+            int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+            int column = columnModel.getColumn(viewColumn).getModelIndex();
+            if (column != -1) {
+                int status = getSortingStatus(column);
+                if (!e.isControlDown()) {
+                    cancelSorting();
+                }
+                // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or 
+                // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed. 
+                status = status + (e.isShiftDown() ? -1 : 1);
+                status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
+                setSortingStatus(column, status);
+            }
+        }
+    }
+
+    private static class Arrow implements Icon {
+        private boolean descending;
+        private int size;
+        private int priority;
+
+        public Arrow(boolean descending, int size, int priority) {
+            this.descending = descending;
+            this.size = size;
+            this.priority = priority;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Color color = c == null ? Color.GRAY : c.getBackground();             
+            // In a compound sort, make each succesive triangle 20% 
+            // smaller than the previous one. 
+            int dx = (int)(size/2*Math.pow(0.8, priority));
+            int dy = descending ? dx : -dx;
+            // Align icon (roughly) with font baseline. 
+            y = y + 5*size/6 + (descending ? -dy : 0);
+            int shift = descending ? 1 : -1;
+            g.translate(x, y);
+
+            // Right diagonal. 
+            g.setColor(color.darker());
+            g.drawLine(dx / 2, dy, 0, 0);
+            g.drawLine(dx / 2, dy + shift, 0, shift);
+            
+            // Left diagonal. 
+            g.setColor(color.brighter());
+            g.drawLine(dx / 2, dy, dx, 0);
+            g.drawLine(dx / 2, dy + shift, dx, shift);
+            
+            // Horizontal line. 
+            if (descending) {
+                g.setColor(color.darker().darker());
+            } else {
+                g.setColor(color.brighter().brighter());
+            }
+            g.drawLine(dx, 0, 0, 0);
+
+            g.setColor(color);
+            g.translate(-x, -y);
+        }
+
+        public int getIconWidth() {
+            return size;
+        }
+
+        public int getIconHeight() {
+            return size;
+        }
+    }
+
+    private class SortableHeaderRenderer implements TableCellRenderer {
+        private TableCellRenderer tableCellRenderer;
+
+        public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
+            this.tableCellRenderer = tableCellRenderer;
+        }
+
+        public Component getTableCellRendererComponent(JTable table, 
+                                                       Object value,
+                                                       boolean isSelected, 
+                                                       boolean hasFocus,
+                                                       int row, 
+                                                       int column) {
+            Component c = tableCellRenderer.getTableCellRendererComponent(table, 
+                                                                          value, isSelected, hasFocus, row, column);
+            if (c instanceof JLabel) {
+                JLabel l = (JLabel) c;
+                l.setHorizontalTextPosition(JLabel.LEFT);
+                int modelColumn = table.convertColumnIndexToModel(column);
+                l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
+            }
+            return c;
+        }
+    }
+
+    private static class Directive {
+        private int column;
+        private int direction;
+
+        public Directive(int column, int direction) {
+            this.column = column;
+            this.direction = direction;
+        }
+    }
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/preferences/SavaraPreferencePage.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/preferences/SavaraPreferencePage.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.monitor/src/java/org/savara/tools/preferences/SavaraPreferencePage.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-10 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 30 March 2010 : Initial version created by gary
+ */
+package org.savara.tools.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By 
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to 
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class SavaraPreferencePage
+	extends FieldEditorPreferencePage
+	implements IWorkbenchPreferencePage {
+
+	public SavaraPreferencePage() {
+		super(GRID);
+		setDescription("SAVARA Preferences");
+	}
+	
+	/**
+	 * Creates the field editors. Field editors are abstractions of
+	 * the common GUI blocks needed to manipulate various types
+	 * of preferences. Each field editor knows how to save and
+	 * restore itself.
+	 */
+	public void createFieldEditors() {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+	}
+	
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.validator</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Tools Validator Plug-in
+Bundle-SymbolicName: org.savara.tools.validator;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.validator.osgi.Activator
+Bundle-Vendor: www.savara.org
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.pi4soa.common,
+ org.eclipse.core.resources,
+ org.pi4soa.cdl
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               Copyright.txt
+src.includes = .classpath,\
+               .project,\
+               .settings/,\
+               Copyright.txt,\
+               META-INF/,\
+               build.properties,\
+               plugin.xml,\
+               src/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.pi4soa.common.annotationsManager">
+      <annotationsManager
+            class="org.savara.tools.validator.osgi.ValidatorAnnotations">
+      </annotationsManager>
+   </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.validator</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsValidator</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,74 @@
+package org.savara.tools.validator.osgi;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tools.validator";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * This method logs an error against the plugin.
+	 * 
+	 * @param mesg The error message
+	 * @param t The optional exception
+	 */
+	public static void logError(String mesg, Throwable t) {
+		
+		if (getDefault() != null) {
+			Status status=new Status(IStatus.ERROR,
+					PLUGIN_ID, 0, mesg, t);
+			
+			getDefault().getLog().log(status);
+		}
+		
+		logger.severe("LOG ERROR: "+mesg+
+				(t == null ? "" : ": "+t));
+	}
+	
+	private static Logger logger = Logger.getLogger("org.savara.tools.validator.osgi");
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/ValidatorAnnotations.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/ValidatorAnnotations.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/ValidatorAnnotations.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 21 Oct 2008 : Initial version created by gary
+ */
+package org.savara.tools.validator.osgi;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.pi4soa.common.annotations.eclipse.EclipseAnnotationsManager;
+
+/**
+ * This class implements the AnnotationsManager extension point.
+ */
+public class ValidatorAnnotations extends EclipseAnnotationsManager {
+
+	public ValidatorAnnotations() {
+		super(Activator.PLUGIN_ID);
+	}
+	
+	/**
+	 * This method returns an input stream associated with the
+	 * supplied URL. The URL can also reference a local relative
+	 * file path.
+	 * 
+	 * @param url The URL, or relative file path
+	 * @return The input stream
+	 */
+	protected java.io.InputStream getInputStream(String url) {
+		java.io.InputStream ret=null;
+		
+		try {
+			String path=ANNOTATIONS_FOLDER +
+							PATH_SEPARATOR + url;
+
+			logger.fine("Load from path: "+path);
+
+			ret = ValidatorAnnotations.class.getResourceAsStream(path);
+
+		} catch(Exception e) {
+			logger.severe("Failed to get input stream for URL '"+
+					url+"': "+e);
+		}
+
+		if (logger.isLoggable(Level.FINEST)) {
+			logger.finest("Ret="+ret);
+		}
+		
+		return(ret);
+	}
+	
+    private static Logger logger = Logger.getLogger("org.savara.tools.validator.osgi");
+
+	private static final String	ANNOTATIONS_FOLDER="annotations";
+    private static final String PATH_SEPARATOR = "/";
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/annotations.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/annotations.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/annotations.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+<annotations>
+	<annotation type="validator" component="org.pi4soa.cdl.ExchangeDetails" >
+		<template url="cdl/validator.template"
+				processor="org.pi4soa.common.annotations.impl.DefaultTemplateProcessor" />
+		<presentation url="cdl/validator.presentation"
+				processor="org.pi4soa.common.annotations.impl.XSLTPresentationProcessor" />
+	</annotation>
+</annotations>
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.presentation
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.presentation	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.presentation	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+The Service destination is <xsl:if test="validator/destination/@name != ''" >'<xsl:value-of select="validator/destination/@name" />' </xsl:if><xsl:if test="validator/destination/@name = ''" >'undefined' </xsl:if> [Type=<xsl:value-of select="validator/destination/@type"/>] [Dynamic Reply-To Destination=<xsl:value-of select="validator/destination/@dynamicReplyTo"/>]</xsl:template></xsl:stylesheet>
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.template
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.template	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.validator/src/java/org/savara/tools/validator/osgi/annotations/cdl/validator.template	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,5 @@
+<validator>
+	<destination name="{{Destination;The URI for the destination;string;;}}"
+		type="{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}" />
+		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
+</validator>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.project
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.wsdl</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Tools WSDL Plug-in
+Bundle-SymbolicName: org.savara.tools.wsdl;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.wsdl.osgi.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: www.savara.org
+Require-Bundle: javax.wsdl;visibility:=reexport,
+ org.savara.contract.model,
+ org.apache.commons.logging,
+ org.scribble.common,
+ org.eclipse.core.resources,
+ org.eclipse.jface,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.scribble.protocol,
+ org.savara.wsdl
+Bundle-ActivationPolicy: lazy

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               build.properties,\
+               Copyright.txt
+src.includes = .classpath,\
+               .project,\
+               Copyright.txt,\
+               META-INF/,\
+               build.properties,\
+               plugin.xml,\
+               src/

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/plugin.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/plugin.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/plugin.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+  <extension point="org.eclipse.ui.popupMenus"> 
+	<objectContribution 
+      id="org.jboss.tools.overlord.cdl.bpel.object.contribution"
+   			objectClass="org.eclipse.core.resources.IFile"
+   				nameFilter="*.cdm">
+	  <menu
+         id="org.savara.tools.menu"
+         label="Savara"
+         path="additions">
+      	<separator name="group1"/>
+      </menu>
+	  <menu
+         id="generate.menu"
+         label="Generate"
+         path="org.savara.tools.menu/additions">
+      	<separator name="group2"/>
+      </menu>
+      <action
+           label="WSDL"
+           class="org.savara.tools.wsdl.actions.GenerateAction"
+           menubarPath="org.savara.tools.menu/generate.menu/group2"
+           enablesFor="1"
+           id="org.savara.tools.wsdl.actions.GenerateAction">
+     </action> 
+    </objectContribution>
+  </extension>
+
+</plugin>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.wsdl</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-plugin</packaging>
+	<name>Savara::Tools::Plugins::ToolsWSDL</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+  
+</project>

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,314 @@
+/*
+ * 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.tools.wsdl.actions;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.contract.model.Namespace;
+import org.savara.tools.wsdl.util.XMLUtils;
+import org.savara.wsdl.generator.WSDLGeneratorFactory;
+import org.savara.wsdl.generator.soap.SOAPDocLitWSDLBinding;
+import org.scribble.conversation.model.ConversationModel;
+import org.scribble.eclipse.util.*;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.Model;
+import org.scribble.model.ModelReference;
+import org.scribble.model.admin.DefaultModelListener;
+import org.scribble.model.admin.ModelRepository;
+
+/**
+ * This class implements the action to generate the choreography
+ * as a set of WSDL definition.
+ */
+public class GenerateAction implements IObjectActionDelegate {
+
+	private static final String CANNOT_GENERATE = "Choreography has errors, so cannot generate";
+
+	public GenerateAction() {
+	}
+
+	/**
+	 * This method implements the action's run method.
+	 * 
+	 * @param action The action
+	 */
+	public void run(IAction action) {
+		if (m_selection instanceof StructuredSelection) {
+			StructuredSelection sel=(StructuredSelection)m_selection;
+			
+			IResource res=(IResource)sel.getFirstElement();
+			
+			if (res instanceof IFile) {
+				
+				if (ResourceUtil.hasErrors(res) == false) {
+					
+					generateWSDL((IFile)res);
+
+				} else {
+					warn(CANNOT_GENERATE);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * This method generates the WSDL associated
+	 * with the supplied file resource.
+	 * 
+	 * @param res The file
+	 */
+	protected void generateWSDL(IFile res) {
+		ModelReference ref=
+			org.scribble.eclipse.model.admin.OSGIModelRepository.createReference(res);
+		ConversationModel conversationModel=null;
+		java.util.List<ModelReference> localModelRefs=null;
+		
+		if (ref != null) {
+			ModelRepository mrep=(ModelRepository)
+					RegistryFactory.getRegistry().getExtension(
+						ModelRepository.class, null);
+
+			if (mrep != null) {
+				Model model=mrep.getModel(ref,
+								new DefaultModelListener());
+				
+				if (model instanceof ConversationModel) {
+					conversationModel = (ConversationModel)model;
+						
+					localModelRefs = conversationModel.getLocalModels(ref);
+				}
+			}
+		}
+		
+		if (conversationModel == null) {
+			logger.error("Unable to load model used to generate " +
+					"the BPEL artefacts", null);
+		} else if (localModelRefs != null) {
+			for (ModelReference mref : localModelRefs) {
+				
+				try {
+					generateWSDL(conversationModel, mref, res);
+				} catch(Exception e) {
+					org.savara.tools.wsdl.osgi.Activator.logError("Failed to generate WSDL for '"+res+"'", e);
+				}
+			}
+		}
+	}
+
+	protected void generateWSDL(ConversationModel cm, ModelReference ref, IResource cdmResource) throws Exception {		
+
+		if (ref.getAnnotations().containsKey(Contract.class.getName())) {
+			javax.wsdl.xml.WSDLWriter writer=
+				javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
+			org.savara.wsdl.generator.WSDLGenerator generator=
+							WSDLGeneratorFactory.getWSDLGenerator();
+			Contract contract=(Contract)ref.getAnnotations().get(Contract.class.getName());
+		
+			// Generate WSDL folder
+			IPath wsdlFolderPath=cdmResource.getParent().getFullPath();
+
+			// Generate definition
+			java.util.List<javax.wsdl.Definition> defns=generator.generate(contract,
+						new SOAPDocLitWSDLBinding());
+		
+			// Check if contract has atleast one message exchange pattern
+			boolean f_hasMEP=false;
+			
+			java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
+			
+			while (f_hasMEP == false && iter.hasNext()) {
+				Interface intf=iter.next();
+				f_hasMEP = (intf.getMessageExchangePatterns().size() > 0);
+			}
+			
+			for (int i=defns.size()-1; i >= 0; i--) {
+				javax.wsdl.Definition defn=defns.get(i);
+				
+				// Check if definition has a port type
+				if (defn.getPortTypes().size() > 0 || defn.getMessages().size() > 0
+						|| (f_hasMEP && defn.getServices().size() > 0)) {
+					byte[] b=null; // Bytes to write out
+					
+					String num="";
+					if (i > 0) {
+						num += i;
+					}
+			
+					String filename=cm.getModelName().getName()+"_"+ref.getLocatedRole()+num+".wsdl";
+		
+					if (i > 0) {
+						javax.wsdl.Import imp=defns.get(0).createImport();
+						
+						imp.setDefinition(defn);
+						imp.setNamespaceURI(defn.getTargetNamespace());
+						imp.setLocationURI(filename);
+						
+						defns.get(0).addImport(imp);
+						
+						java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+						
+						writer.writeWSDL(defn, baos);
+						
+						b=baos.toByteArray();
+						
+						baos.close();
+						
+					} else {
+						
+						// NOTE: Unfortunate workaround due to issue with WSDLWriter not
+						// generating output for extensible elements created to represent
+						// the xsd:schema/xsd:import elements. So instead had to obtain
+						// the DOM document and insert the relevant elements.
+						
+						org.w3c.dom.Document doc=writer.getDocument(defn);
+						
+						if (contract.getNamespaces().size() > 0) {
+							org.w3c.dom.Element defnElem=doc.getDocumentElement();
+							
+							// Added types node
+							org.w3c.dom.Element types=doc.createElementNS("http://schemas.xmlsoap.org/wsdl/",
+														"types");
+							
+							org.w3c.dom.Element schema=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
+														"schema");
+							
+							types.appendChild(schema);		
+							
+							// Generate imports for specified message schema
+							for (Namespace ns : contract.getNamespaces()) {
+								
+								if (ns.getSchemaLocation() != null &&
+											ns.getSchemaLocation().trim().length() > 0) {
+	
+									java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
+									
+									while (st.hasMoreTokens()) {
+										String location=st.nextToken();
+										IFile file=cdmResource.getParent().getFile(new Path(location));
+									
+										org.w3c.dom.Element imp=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
+														"import");
+										
+										imp.setAttribute("namespace", ns.getURI());
+										
+										if (file.exists()) {
+											IPath relative=file.getFullPath().makeRelativeTo(wsdlFolderPath);
+											imp.setAttribute("schemaLocation", relative.toPortableString());
+										} else {
+											imp.setAttribute("schemaLocation", location);
+										}
+										
+										schema.appendChild(imp);					
+									}
+								}
+							}
+	
+							defnElem.insertBefore(types, defnElem.getFirstChild());
+						}
+						
+						// Create bytearray from DOM
+						java.io.ByteArrayOutputStream xmlstr=
+							new java.io.ByteArrayOutputStream();
+						
+						DOMSource source=new DOMSource();
+						source.setNode(doc);
+						
+						StreamResult result=new StreamResult(xmlstr);
+						
+						Transformer trans=
+								TransformerFactory.newInstance().newTransformer();
+						trans.transform(source, result);
+						
+						xmlstr.close();
+						
+						b = XMLUtils.format(new String(xmlstr.toByteArray())).getBytes();
+					}
+					
+					IPath wsdlPath=wsdlFolderPath.append(filename);
+		
+					IFile wsdlFile=cdmResource.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+
+					wsdlFile.create(null, true,
+							new org.eclipse.core.runtime.NullProgressMonitor());
+					
+					wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
+								new org.eclipse.core.runtime.NullProgressMonitor());
+				}
+			}
+		}
+	}
+
+	
+	/**
+	 * This method indicates that the selection has changed.
+	 * 
+	 * @param action The action
+	 * @param selection The selection
+	 */
+	public void selectionChanged(IAction action,
+            ISelection selection) {
+		m_selection = selection;
+	}
+
+	/**
+	 * This method sets the currently active workbench part.
+	 * 
+	 * @param action The action
+	 * @param targetPart The active workbench part
+	 */
+	public void setActivePart(IAction action,
+            IWorkbenchPart targetPart) {
+		m_targetPart = targetPart;
+	}
+	
+	/**
+	 * This method is used to report a warning.
+	 * 
+	 * @param mesg The warning message
+	 */
+	public void warn(String mesg) {
+		
+		MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+				SWT.ICON_WARNING|SWT.OK);
+		mbox.setMessage(mesg);
+		mbox.open();
+	}
+
+	private static Log logger = LogFactory.getLog(GenerateAction.class);
+	
+	private ISelection m_selection=null;
+    private IWorkbenchPart m_targetPart=null;
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,73 @@
+package org.savara.tools.wsdl.osgi;
+
+import org.apache.commons.logging.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.savara.tools.wsdl";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * This method logs an error against the plugin.
+	 * 
+	 * @param mesg The error message
+	 * @param t The optional exception
+	 */
+	public static void logError(String mesg, Throwable t) {
+		
+		if (getDefault() != null) {
+			Status status=new Status(IStatus.ERROR,
+					PLUGIN_ID, 0, mesg, t);
+			
+			getDefault().getLog().log(status);
+		}
+		
+		logger.error("LOG ERROR: "+mesg+
+				(t == null ? "" : ": "+t), t);
+	}
+	
+	private static Log logger = LogFactory.getLog(Activator.class);
+}

Added: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/util/XMLUtils.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/util/XMLUtils.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/util/XMLUtils.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,300 @@
+/*
+ * 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.tools.wsdl.util;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.scribble.model.ModelObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * This class defines a set of XML related utility functions.
+ */
+public final class XMLUtils {
+	
+	private static final String NS_LABEL = "ns";
+
+	/**
+	 * This class converts a DOM representation node to text.
+	 * @param node
+	 * @return
+	 * @throws Exception
+	 */
+	public static final String toText(Node node) throws Exception {
+		String ret = null;
+		try {
+			// Transform the DOM represent to text
+			ByteArrayOutputStream xmlstr= new ByteArrayOutputStream();
+			DOMSource source=new DOMSource(node);
+			//source.setNode(node);
+			
+			StreamResult result=new StreamResult(xmlstr);			
+			Transformer trans= TransformerFactory.newInstance().newTransformer();
+			trans.transform(source, result);
+			
+			xmlstr.close();
+			
+			ret = new String(xmlstr.toByteArray());
+			
+			if ((node instanceof Document) == false) {				
+				// Strip off any <?xml> header
+				int index=ret.indexOf("<?xml");
+				if (index != -1) {
+					index = ret.indexOf("<", 1);
+					if (index != -1) {
+						ret = ret.substring(index);
+					} else {
+						index = ret.indexOf("?>");
+						if (index != -1) {
+							index += 2;
+							
+							// Remove any trailing whitespaces after XML header
+							while (index < ret.length() &&
+									Character.isWhitespace(ret.charAt(index))) {
+								index++;
+							}
+							
+							ret = ret.substring(index);
+						}
+					}
+				}
+			}
+
+		} catch(Exception e) {
+			throw new Exception("Failed to transform DOM representation into text", e);
+		}
+		if (ret != null) {
+			 return format(ret);
+		}
+		return ret;
+	}
+	
+	
+	/**
+	 * Format the xml to well print.
+	 * 
+	 * @param xmltext
+	 * @return
+	 */
+	public static final String format(String xmltext) {
+		String ret=xmltext;
+		int pos=0;
+		int prevpos=0;
+		StringBuffer buf=new StringBuffer();
+		int level=0;
+		
+		while ((pos=ret.indexOf('<', prevpos)) != -1) {
+			
+			if (prevpos < pos &&
+					ret.substring(prevpos, pos).trim().length() > 0 &&
+					ret.charAt(prevpos-1) != '?') {
+				
+				if (ret.charAt(prevpos) == '\r' &&
+						ret.charAt(prevpos+1) == '\n') {
+					prevpos += 2;
+				}
+				for (int i=0; i < level; i++) {
+					buf.append("    ");
+				}
+				
+				buf.append(ret.substring(prevpos, pos).trim());
+				buf.append("\r\n");
+			}
+			
+			int endpos=ret.indexOf('>', pos);
+		
+			if (endpos > 0) {
+				boolean noreturn=false;
+				
+				if (pos > 0 && ret.charAt(pos+1) == '/') {
+					level--;
+				}
+				
+				for (int i=0; i < level; i++) {
+					buf.append("    ");
+				}
+				buf.append(ret.substring(pos, endpos+1));
+				
+				if (ret.charAt(endpos-1)== '?') {
+					//noreturn = true;
+					
+				} else if (ret.charAt(endpos-1) == '/') {
+					// Ignore
+				} else if (pos > 0 && ret.charAt(pos+1) == '/') {
+					// Ignore
+					
+				} else if (pos > 0 && ret.charAt(pos+1) == '!') {
+					// Ignore
+					
+				} else {
+					level++;
+				}
+							
+				if (noreturn == false) {
+					buf.append("\r\n");
+				}
+				
+				pos = endpos+1;
+			}
+			
+			prevpos = pos;
+		}
+		
+		if (prevpos != -1 &&
+				ret.substring(prevpos).trim().length() > 0) {
+			buf.append(ret.substring(prevpos));
+		}
+		
+		ret = buf.toString();
+		
+		return(ret);
+	}
+	
+	public static Node getNode(String text) throws Exception {
+		Node ret=null;
+		
+		// Transform the text representation to DOM
+		DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+		fact.setNamespaceAware(true);
+		
+		java.io.InputStream xmlstr=
+			new java.io.ByteArrayInputStream(text.getBytes());
+
+		DocumentBuilder builder=fact.newDocumentBuilder();
+		org.w3c.dom.Document doc=builder.parse(xmlstr);
+		
+		ret = doc.getDocumentElement();
+
+		return(ret);
+	}
+
+	/**
+	 * This method returns the localname part of the supplied
+	 * qualified name.
+	 * 
+	 * @param qname The qualified name
+	 * @return The localname part
+	 */
+	public static String getLocalname(String qname) {
+		String ret=qname;
+		int pos=0;
+		
+		if (qname != null && ((pos=qname.indexOf(':')) != -1)) {
+			ret = qname.substring(pos+1);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the prefix associated with the supplied namespace.
+	 * 
+	 * @param namespace The namespace
+	 * @param nsMap The existing namespace prefix mappings
+	 * @return The prefix
+	 */
+	public static String getPrefix(String namespace, java.util.Map<String,String> nsMap) {
+		String prefix=null;
+		
+		prefix = nsMap.get(namespace);
+		
+		if (prefix == null) {
+			prefix = NS_LABEL+(nsMap.size()+1);
+			nsMap.put(namespace, prefix);
+		}
+
+		return(prefix);
+	}
+	
+	/**
+	 * This method calculates the start and end position of a supplied DOM element, within
+	 * the supplied text contents, and sets the values on the supplied ModelObject.
+	 * 
+	 * @param obj The ModelObject to be initialized
+	 * @param contents The text contents
+	 * @param elem The DOM element to be located in the text
+	 */
+	public static void setStartAndEndPosition(ModelObject obj, String contents, org.w3c.dom.Element elem) {
+
+		if (contents != null) {
+			org.w3c.dom.NodeList nl=elem.getOwnerDocument().getElementsByTagName(elem.getNodeName());
+			int elempos=-1;
+			
+			for (int i=0; elempos == -1 && i < nl.getLength(); i++) {
+				if (nl.item(i) == elem) {
+					elempos = i;
+				}
+			}
+			
+			if (elempos != -1) {
+				int startpos=-1;
+					
+				for (int i=0; i <= elempos; i++) {
+					int val1=contents.indexOf("<"+elem.getNodeName()+">", startpos+1);
+					int val2=contents.indexOf("<"+elem.getNodeName()+" ", startpos+1);
+					
+					if (val1 == -1 && val2 != -1) {
+						startpos = val2;
+					} else if (val1 != -1 && val2 == -1) {
+						startpos = val1;
+					} else if (val1 == -1 && val2 == -1) {
+						// TODO: Error condition
+						break;
+					} else if (val1 > val2) {
+						startpos = val2;
+					} else {
+						startpos = val1;
+					}
+				}
+				
+				if (startpos != -1) {
+					obj.getSource().setStartPosition(startpos);
+					
+					// Check if single node
+					int p1=contents.indexOf('>', startpos);
+					
+					if (p1 != -1 && contents.charAt(p1-1) == '/') {
+						obj.getSource().setEndPosition(p1);
+					} else {
+					
+						org.w3c.dom.NodeList enl=elem.getElementsByTagName(elem.getNodeName());
+						
+						int endpos=startpos;
+						String nodetxt="</"+elem.getNodeName()+">";
+						
+						for (int i=0; endpos != -1 && i <= enl.getLength(); i++) {
+							endpos = contents.indexOf(nodetxt, endpos+1);
+						}
+						
+						if (endpos != -1) {
+							obj.getSource().setEndPosition(endpos+nodetxt.length()-1);
+						}
+					}
+				}
+			}
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/plugins/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/plugins/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/plugins/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>plugins</artifactId>
+	<packaging>pom</packaging>
+	<version>1.2.0-SNAPSHOT</version>
+	<name>Savara::Tools::Plugins</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>tools</artifactId>
+		<version>1.2.0-SNAPSHOT</version>
+	</parent>
+
+	<modules>
+		<module>org.savara.pi4soa.cdm</module>
+		<module>org.savara.protocol.contract</module>
+		<module>org.savara.tap.model</module>
+		<module>org.savara.tap.validation</module>
+		<module>org.savara.tap.eclipse</module>
+		<module>org.savara.tools.wsdl</module>
+		<module>org.savara.tools.bpel</module>
+		<module>org.savara.tools.validator</module>
+		<module>org.savara.tools.bpmn</module>
+		<module>org.savara.tools.monitor</module>
+		<module>org.scribble.eclipse</module>
+	</modules>
+
+</project>
+

Added: branches/experimental/2.0.x/tools/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,138 @@
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara</groupId>
+	<artifactId>tools</artifactId>
+	<packaging>pom</packaging>
+	<version>2.0.0-SNAPSHOT</version>
+	<name>Savara::Tools</name>
+
+	<!-- use JBoss Tools' trunk/build/parent/pom.xml - must be built locally first! 
+	     Then, build like this to suck in latest pi4soa + target-platform:
+	     	mvn3 clean install -U -B -e -fae -P jbosstools-nightly-trunk,helios-remote-target,\!helios
+	-->
+        <parent>
+                <groupId>org.jboss.tools</groupId>
+                <artifactId>org.jboss.tools.parent.pom</artifactId>
+        	<version>0.0.1-SNAPSHOT</version>
+        </parent>
+
+        <!-- Don't use Savara's own local parent-pom.xml. ~nickb
+        <parent>
+		<relativePath>parent-pom.xml</relativePath>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>org.savara.tools.parent.pom</artifactId>
+		<version>1.2.0-SNAPSHOT</version>
+	</parent> -->
+
+	<properties>
+        <jaxb.version>2.1</jaxb.version>
+    	<tycho-version>0.10.0</tycho-version>
+	</properties>
+
+	<modules>
+		<module>plugins</module>
+		<module>features</module>
+		<module>tests</module>
+		<module>site</module>
+	</modules>
+
+  <build>
+    <plugins>
+			<plugin>
+				<groupId>org.sonatype.tycho</groupId>
+				<artifactId>target-platform-configuration</artifactId>
+				<version>${tycho-version}</version>
+				<configuration>
+					<resolver>p2</resolver>
+					<ignoreTychoRepositories>true</ignoreTychoRepositories>
+         			<pomDependencies>consider</pomDependencies>
+					<environments>
+						<environment>
+							<os>macosx</os>
+							<ws>cocoa</ws>
+							<arch>x86</arch>
+						</environment>
+						<environment>
+							<os>macosx</os>
+							<ws>carbon</ws>
+							<arch>x86</arch>
+						</environment>
+						<environment>
+							<os>win32</os>
+							<ws>win32</ws>
+							<arch>x86</arch>
+						</environment>
+						<environment>
+							<os>linux</os>
+							<ws>gtk</ws>
+							<arch>x86</arch>
+						</environment>
+						<environment>
+							<os>linux</os>
+							<ws>gtk</ws>
+							<arch>x86_64</arch>
+						</environment>
+					</environments>
+				</configuration>
+			</plugin>
+    </plugins>
+  </build>
+
+
+<!-- No need for distribution details as there are no artifacts to publish
+	<distributionManagement>
+	    <repository>
+	      <id>jboss-releases-repository</id>
+	      <name>JBoss Releases Repository</name>
+	      <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
+	    </repository>
+	    <snapshotRepository>
+	      <id>jboss-snapshots-repository</id>
+	      <name>JBoss Snapshots Repository</name>
+	      <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
+	    </snapshotRepository>
+	</distributionManagement>
+-->
+
+	<repositories>
+	    <repository>
+	        <id>jboss-developer-repository-group</id>
+	        <name>JBoss Developer Maven Repository Group</name>
+		<url>https://repository.jboss.org/nexus/content/groups/developer/</url>
+		<releases>
+		  <enabled>true</enabled>
+		  <updatePolicy>never</updatePolicy>
+		</releases>
+		<snapshots>
+		  <enabled>true</enabled>
+		  <updatePolicy>never</updatePolicy>
+		</snapshots>
+	    </repository>
+		<repository>
+			<id>pi4soa</id>
+			<url>http://download.jboss.org/jbosstools/builds/staging/pi4soa/all/repo/</url>
+			<layout>p2</layout>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+		</repository>
+		<repository>
+			<id>eclipse-helios</id>
+			<url>http://download.eclipse.org/releases/helios</url>
+			<layout>p2</layout>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+		</repository>
+	</repositories>
+
+</project>
+

Added: branches/experimental/2.0.x/tools/site/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/site/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/site/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,80 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion> 
+	<groupId>org.savara.tools</groupId>
+	<artifactId>site</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-update-site</packaging>
+	<name>Savara::Tools::Site</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>tools</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.core</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.conformance</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.projector</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.comparator</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.validation</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.export.text</artifactId> 
+			<version>1${scribble.version}</version>
+ 		</dependency>
+ 	</dependencies>
+	
+</project>
+

Added: branches/experimental/2.0.x/tools/site/site.xml
===================================================================
--- branches/experimental/2.0.x/tools/site/site.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/site/site.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+   <description name="Savara Tools Update Site">
+      This is the update site for the Savara tools.
+   </description>
+   <feature url="features/org.savara.tools.feature_0.0.0.jar" id="org.savara.tools.feature" version="0.0.0">
+      <category name="Savara"/>
+   </feature>
+   <feature url="features/org.scribble.protocol.feature_0.0.0.jar" id="org.scribble.protocol.feature" version="0.0.0">
+      <category name="Savara"/>
+   </feature>
+   <category-def name="Savara" label="Savara">
+      <description>
+         Savara Tools update site
+      </description>
+   </category-def>
+</site>

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.project
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.protocol.contract.tests</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/Copyright.txt
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/Copyright.txt	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/Copyright.txt	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA Protocol Contract Tests Plugin
+Bundle-SymbolicName: org.savara.protocol.contract.tests
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.protocol.contract.tests.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.common,
+ org.scribble.protocol,
+ org.savara.contract.model,
+ org.savara.protocol.contract,
+ org.junit4
+Export-Package: org.savara.protocol.contract

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.protocol.contract.tests</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-test-plugin</packaging>
+	<name>Savara::Tools::Tests::ProtocolContract</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>tests</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.parser</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.contract.model</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+</project>

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ContractGeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ContractGeneratorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ContractGeneratorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+package org.savara.protocol.contract;
+
+import static org.junit.Assert.*;
+
+import org.savara.protocol.contract.ContractGenerator;
+import org.savara.protocol.contract.ContractGeneratorFactory;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.model.LocatedName;
+import org.scribble.model.Role;
+
+public class ContractGeneratorTest {
+
+	@org.junit.Test
+	public void testGenerateProtocolNull() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=null;
+			
+			generator.generate(conv);
+			
+			fail("Should have thrown IllegalArgumentException");
+			
+		} catch(IllegalArgumentException iae) {
+			// Test worked
+		}
+	}
+
+	@org.junit.Test
+	public void testGenerateProtocolNotLocated() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=new Conversation();
+			LocatedName ln=new LocatedName();
+			conv.setLocatedName(ln);
+			
+			generator.generate(conv);
+			
+			fail("Should have thrown IllegalArgumentException");
+			
+		} catch(IllegalArgumentException iae) {
+			// Test worked
+		}
+	}
+
+	@org.junit.Test
+	public void testGenerateConversationAndRoleNotNull2() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=new Conversation();
+			LocatedName ln=new LocatedName();
+			ln.setRole(new Role());
+			conv.setLocatedName(ln);
+			
+			generator.generate(conv);
+			
+		} catch(IllegalArgumentException iae) {			
+			fail("Should NOT have thrown IllegalArgumentException");
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ProtocolContractAllTests.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ProtocolContractAllTests.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/ProtocolContractAllTests.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.protocol.contract;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+import org.savara.protocol.contract.impl.*;
+
+ at RunWith(Suite.class)
+ at Suite.SuiteClasses( { ContractGeneratorTest.class,
+	ContractIntrospectorTest.class})
+public class ProtocolContractAllTests {
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/impl/ContractIntrospectorTest.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/impl/ContractIntrospectorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/impl/ContractIntrospectorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,304 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.protocol.contract.impl;
+
+import org.savara.contract.model.Contract;
+import org.savara.contract.model.Interface;
+import org.savara.contract.model.MessageExchangePattern;
+import org.savara.contract.model.OneWayRequestMEP;
+import org.savara.contract.model.RequestResponseMEP;
+import org.savara.contract.model.Type;
+import org.savara.protocol.contract.impl.ContractIntrospector;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.conversation.model.ConversationInteraction;
+import org.scribble.conversation.model.ConversationReference;
+import org.scribble.conversation.model.Run;
+import org.scribble.model.LocatedName;
+import org.scribble.model.MessageSignature;
+import org.scribble.model.Role;
+import org.scribble.model.TypeReference;
+
+import static org.junit.Assert.*;
+
+public class ContractIntrospectorTest {
+
+	private static final String MY_ROLE = "myRole";
+	private static final String TYPE_NS = "typeNS";
+	private static final String TYPE_LP = "typeLP";
+	private static final String OP_NAME = "opName";
+
+	@org.junit.Test
+	public void testNoSubProtocolWithoutRun() {
+		Role r=new Role();
+		r.setName("role");
+		
+		LocatedName ln1=new LocatedName();
+		ln1.setName("top");
+		ln1.setRole(r);
+		LocatedName ln2=new LocatedName();
+		ln2.setName("mid");
+		ln2.setRole(r);
+		LocatedName ln3=new LocatedName();
+		ln3.setName("sub");
+		ln3.setRole(r);
+		
+		Conversation top=new Conversation();
+		top.setLocatedName(ln1);
+		
+		Conversation mid=new Conversation();
+		mid.setLocatedName(ln2);
+		
+		Conversation sub=new Conversation();
+		sub.setLocatedName(ln3);
+		
+		ConversationReference ref=new ConversationReference();
+		ref.setLocalpart("sub");
+		ref.setLocatedRole(r.getName());
+		
+		Run run=new Run();
+		run.setReference(ref);
+		
+		top.getBlock().getContents().add(mid);
+		
+		mid.getBlock().getContents().add(run);
+		mid.getBlock().getContents().add(sub);
+		
+		ContractIntrospector introspector=new ContractIntrospector(top);
+		
+		introspector.process();
+		
+		if (introspector.getProcessedProtocols().size() != 0) {
+			fail("Expecting 0 processed protocol, but got: "+introspector.getProcessedProtocols().size());
+		}
+	}
+	
+	@org.junit.Test
+	public void testSubProtocolWithRun() {
+		Role r=new Role();
+		r.setName("role");
+		
+		LocatedName ln1=new LocatedName();
+		ln1.setName("top");
+		ln1.setRole(r);
+		LocatedName ln2=new LocatedName();
+		ln2.setName("mid");
+		ln2.setRole(r);
+		LocatedName ln3=new LocatedName();
+		ln3.setName("sub");
+		ln3.setRole(r);
+		
+		Conversation top=new Conversation();
+		top.setLocatedName(ln1);
+		
+		Conversation mid=new Conversation();
+		mid.setLocatedName(ln2);
+		
+		Conversation sub=new Conversation();
+		sub.setLocatedName(ln3);
+		
+		ConversationReference ref1=new ConversationReference();
+		ref1.setLocalpart("mid");
+		ref1.setLocatedRole(r.getName());
+		ref1.setInner(true);
+		
+		Run run1=new Run();
+		run1.setReference(ref1);
+		
+		top.getBlock().getContents().add(run1);
+		top.getBlock().getContents().add(mid);
+		
+		ConversationReference ref2=new ConversationReference();
+		ref2.setLocalpart("sub");
+		ref2.setLocatedRole(r.getName());
+		ref2.setInner(true);
+		
+		Run run2=new Run();
+		run2.setReference(ref2);
+		
+		mid.getBlock().getContents().add(run2);
+		mid.getBlock().getContents().add(sub);
+		
+		ContractIntrospector introspector=new ContractIntrospector(top);
+		
+		introspector.process();
+		
+		if (introspector.getProcessedProtocols().size() != 2) {
+			fail("Expecting 2 processed protocol, but got: "+introspector.getProcessedProtocols().size());
+		}
+		
+		if (introspector.getProcessedProtocols().contains(mid) == false) {
+			fail("Should contain mid");
+		}
+		
+		if (introspector.getProcessedProtocols().contains(sub) == false) {
+			fail("Should contain sub");
+		}
+	}
+	
+	@org.junit.Test
+	public void testCreateSingleInterface() {
+		Conversation protocol=new Conversation();
+		Role role=new Role();
+		role.setName(MY_ROLE);
+		LocatedName ln=new LocatedName();
+		ln.setRole(role);
+		protocol.setLocatedName(ln);
+		
+		ContractIntrospector introspector=new ContractIntrospector(protocol);
+		
+		if (introspector.getContract().getInterfaces().size() != 0) {
+			fail("Should be 0 interfaces: "+introspector.getContract().getInterfaces().size());
+		}
+		
+		Interface intf=introspector.getInterface();
+		
+		if (intf == null) {
+			fail("Interface not created");
+		}
+		
+		if (introspector.getContract().getInterfaces().size() != 1) {
+			fail("Should be 1 interface: "+introspector.getContract().getInterfaces().size());
+		}
+		
+		Interface intf2=introspector.getInterface();
+		
+		if (intf2 != intf) {
+			fail("Interfaces are different");
+		}
+		
+		if (introspector.getContract().getInterfaces().size() != 1) {
+			fail("Should still only be 1 interface: "+introspector.getContract().getInterfaces().size());
+		}
+	}
+	
+	@org.junit.Test
+	public void testVisitInteractionOneWayRequestRPC() {
+		Conversation protocol=new Conversation();
+		Role role=new Role();
+		role.setName(MY_ROLE);
+		LocatedName ln=new LocatedName();
+		ln.setRole(role);
+		protocol.setLocatedName(ln);
+		
+		ContractIntrospector introspector=new ContractIntrospector(protocol);
+		
+		ConversationInteraction interaction=new ConversationInteraction();
+		
+		MessageSignature msig=new MessageSignature();
+		msig.setOperation(OP_NAME);
+		
+		TypeReference tref=new TypeReference();
+		tref.setLocalpart(TYPE_LP);
+		tref.setNamespace(TYPE_NS);
+		msig.getTypes().add(tref);
+		
+		interaction.setMessageSignature(msig);
+		interaction.setFromRole(new Role());
+		
+		introspector.visitInteraction(interaction);
+		
+		Contract contract=introspector.getContract();
+		
+		Interface intf=contract.getInterface(role.getName());
+		
+		if (intf == null) {
+			fail("Interface '"+role.getName()+"' not found");
+		}
+		
+		MessageExchangePattern mep=intf.getMessageExchangePatternForOperation(OP_NAME);
+		
+		if (mep == null) {
+			fail("Operation '"+OP_NAME+"' not found");
+		}
+		
+		if ((mep instanceof OneWayRequestMEP) == false) {
+			fail("Not a oneway request");
+		}
+		
+		if (mep.getTypes().size() != 1) {
+			fail("One type expected, but got: "+mep.getTypes().size());
+		}
+		
+		Type t=mep.getTypes().get(0);
+		
+		if (t.getName().equals(TYPE_LP) == false) {
+			fail("Type name not correct: "+t.getName());
+		}
+	}
+	
+	
+	@org.junit.Test
+	public void testVisitInteractionRequestResponseRPCOnlyRequest() {
+		Conversation protocol=new Conversation();
+		Role role=new Role();
+		role.setName(MY_ROLE);
+		LocatedName ln=new LocatedName();
+		ln.setRole(role);
+		protocol.setLocatedName(ln);
+		
+		ContractIntrospector introspector=new ContractIntrospector(protocol);
+		
+		ConversationInteraction interaction=new ConversationInteraction();
+		
+		MessageSignature msig=new MessageSignature();
+		msig.setOperation(OP_NAME);
+		
+		TypeReference tref=new TypeReference();
+		tref.setLocalpart(TYPE_LP);
+		tref.setNamespace(TYPE_NS);
+		msig.getTypes().add(tref);
+		
+		interaction.setMessageSignature(msig);
+		interaction.setFromRole(new Role());
+		interaction.setRequestLabel("label");
+		
+		introspector.visitInteraction(interaction);
+		
+		Contract contract=introspector.getContract();
+		
+		Interface intf=contract.getInterface(role.getName());
+		
+		if (intf == null) {
+			fail("Interface '"+role.getName()+"' not found");
+		}
+		
+		MessageExchangePattern mep=intf.getMessageExchangePatternForOperation(OP_NAME);
+		
+		if (mep == null) {
+			fail("Operation '"+OP_NAME+"' not found");
+		}
+		
+		if ((mep instanceof RequestResponseMEP) == false) {
+			fail("Not a request/response MEP");
+		}
+		
+		if (mep.getTypes().size() != 1) {
+			fail("One type expected, but got: "+mep.getTypes().size());
+		}
+		
+		Type t=mep.getTypes().get(0);
+		
+		if (t.getName().equals(TYPE_LP) == false) {
+			fail("Type name not correct: "+t.getName());
+		}
+	}
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.protocol.contract.tests/src/java/org/savara/protocol/contract/tests/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,39 @@
+/*
+ * 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.protocol.contract.tests.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.classpath
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.classpath	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.classpath	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/java"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.project
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.project	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/.project	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.savara.tools.bpel.tests</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/META-INF/MANIFEST.MF	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Boss SAVARA Tools BPEL Tests Plug-in
+Bundle-SymbolicName: org.savara.tools.bpel.tests
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.savara.tools.bpel.tests.osgi.Activator
+Bundle-Vendor: www.savara.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.scribble.protocol,
+ org.scribble.common,
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.junit,
+ org.scribble.protocol.parser,
+ org.apache.commons.logging,
+ org.savara.pi4soa.cdm;resolution:=optional,
+ org.savara.tools.bpel,
+ org.savara.contract.model,
+ org.savara.tools.wsdl,
+ org.eclipse.ui.ide,
+ org.eclipse.jst.common.frameworks,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.project.facet.core,
+ org.scribble.protocol.projection,
+ org.savara.bpel,
+ org.savara.core

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/build.properties
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/build.properties	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/build.properties	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               test.xml
+src.includes = test.xml,\
+               src/,\
+               build.properties,\
+               META-INF/,\
+               .settings/,\
+               .project,\
+               .classpath

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>org.savara.tools.bpel.tests</artifactId> 
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-test-plugin</packaging>
+	<name>Savara::Tools::Tests::ToolsBPEL</name>
+
+	<parent>
+		<groupId>org.savara.tools</groupId>
+		<artifactId>tests</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+   	<dependencies>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.common</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.parser.projector</artifactId> 
+			<version>${scribble.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.bpel</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.savara.wsdl</artifactId> 
+			<version>${savara.version}</version>
+ 		</dependency>
+ 	</dependencies>
+</project>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/GeneratorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/GeneratorTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,314 @@
+/*
+ * 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.tools.bpel.generator;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.savara.bpel.model.BPELNotation;
+import org.savara.bpel.model.DefaultBPELLanguageModel;
+import org.savara.pi4soa.cdm.model.CDMNotation;
+import org.savara.util.XMLUtils;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.Definition;
+import org.scribble.model.ModelReference;
+import org.scribble.model.SubDefinitionPath;
+import org.scribble.model.change.ModelGenerator;
+
+public class GeneratorTest {
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite("Choreography->BPEL Generator Tests");
+        
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "Broker"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "CreditAgency"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker",
+        				new SubDefinitionPath(new String[]{"CompleteTransaction"}),
+        								"SupplierTxnProcessor"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", 
+						new SubDefinitionPath(new String[]{"RequestForQuote"}),
+										"SupplierQuoteEngine"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "CreditAgency"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "Store"));
+        suite.addTest(new ChoreographyToBPELTester("ReqRespFault", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("ReqRespFault", "Seller"));
+        
+        return suite;
+    }
+    
+    public static class ChoreographyToBPELTester extends TestCase {
+
+    	/**
+    	 * This constructor is initialized with the test
+    	 * name.
+    	 * 
+    	 * @param name The test name
+    	 * @param role The role
+    	 */
+    	public ChoreographyToBPELTester(String name,
+    						String role) {
+    		super(name+"@"+role);
+    		m_name = name;
+    		m_role = role;
+    	}
+    	
+    	/**
+    	 * This constructor is initialized with the test
+    	 * name.
+    	 * 
+    	 * @param name The test name
+    	 * @param role The role
+    	 */
+    	public ChoreographyToBPELTester(String name,
+    						SubDefinitionPath sdp, String role) {
+    		super(name+sdp.toString()+"@"+role);
+    		m_name = name;
+    		m_subDefinitionPath = sdp;
+    		m_role = role;
+    	}
+    	
+    	/**
+    	 * This method runs the test.
+    	 * 
+    	 * @param result The test result
+    	 */
+    	public void run(TestResult result) {
+    		result.startTest(this);
+    		
+    		String filename="testmodels/"+m_name+".cdm";
+    		
+    		java.io.InputStream is=
+    			ChoreographyToBPELTester.class.getResourceAsStream(filename);
+    		
+    		if (is == null) {
+    			result.addError(this,
+    					new Throwable("Unable to locate resource: "+filename));
+    		} else {			
+    			org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
+    			org.scribble.model.ModelReference ref=
+    					new org.scribble.model.ModelReference(CDMNotation.NOTATION_CODE);
+    			org.scribble.model.admin.DefaultModelListener l=
+    					new org.scribble.model.admin.DefaultModelListener();
+    			
+    			org.scribble.model.Model model=p.parse(ref, is, l, null);
+    			
+    			if (model == null) {
+    				result.addError(this, new Throwable("Model is null"));
+    			} else {
+    				org.scribble.projector.Projector projector=
+    					new org.scribble.projector.DefaultProjector();
+    				
+    				org.scribble.model.Role role=null;
+    				
+    				// Obtain role from definition
+    				java.util.List<Definition> defns=model.getDefinitions();
+    				Definition defn=null;
+    				
+    				if (defns.size() == 1) {
+    					defn = defns.get(0);
+    				}
+    				
+    				// Check if subpath definition defined
+    				if (m_subDefinitionPath != null) {
+    					defn = defn.getSubDefinition(m_subDefinitionPath);
+    				}
+    				
+    				java.util.List<org.scribble.model.Role> roles=defn.getRoles();
+    					//new org.scribble.model.Role(m_role);
+    				
+    				for (int i=0; role == null && i < roles.size(); i++) {
+    					if (roles.get(i).getName().equals(m_role)) {
+    						role = roles.get(i);
+    					}
+    				}
+    				
+    				if (role == null) {
+    					result.addError(this,
+    							new Throwable("Role '"+m_role+"' not found"));						
+    				} else {
+    					org.scribble.model.Model projected=
+    							projector.project(ref, model,
+    									m_subDefinitionPath, role, l);
+    					
+    					/* Currently if a 'fail' is performed in Tycho build, it
+    					 * hangs the build.
+    					if (l.getErrors().size() > 0) {
+    						fail("Projection has errors: "+l.getErrors());
+    					} else if (projected == null) {
+    						fail("Projected model is null, for "+filename+" role "+role);
+    					}
+    					 */
+    					
+    					ModelGenerator generator=(ModelGenerator)
+    							RegistryFactory.getRegistry().getExtension(
+    									ModelGenerator.class, null);
+    				
+    					defns = projected.getDefinitions();
+    					defn = null;
+    					
+    					if (defns.size() == 1) {
+    						defn = defns.get(0);
+    					}
+    					
+    					if (generator != null && defn != null) {
+    						ModelReference targetRef=
+    							new ModelReference(BPELNotation.NOTATION_CODE);
+    						targetRef.setAlias(m_name);
+    						targetRef.setLocatedRole(m_role);
+    						
+    						DefaultBPELLanguageModel target=
+    							new DefaultBPELLanguageModel(targetRef);
+
+    						generator.generate(targetRef, role,
+    									target, projected);
+    						
+    						if (target.getBPELProcess().getDOMElement() != null) {
+    							try {
+    								String text=XMLUtils.toText(target.getBPELProcess().getDOMElement());
+    								checkResults(result, text);
+    							} catch(Exception e) {
+    								result.addError(this, e);
+    							}
+    						} else {
+    							result.addError(this,
+    									new Throwable("No BPEL generated"));						
+    						}
+    						
+    					} else {
+    						result.addError(this,
+    								new Throwable("Unable to find Model Generator"));						
+    					}
+    				}
+    			}
+    		}
+    		
+    		result.endTest(this);
+    	}
+    	
+    	/**
+    	 * This method checks the generated BPEL against a
+    	 * previously stored correct version.
+    	 * 
+    	 * @param result The test result
+    	 * @param bpel The BPEL
+    	 */
+    	protected void checkResults(TestResult result, String bpel) {
+    		boolean f_valid=false;
+
+    		String filename="results/"+m_name+"@"+m_role+".bpel";
+    		
+    		java.io.InputStream is=
+    			ChoreographyToBPELTester.class.getResourceAsStream(filename);
+    		
+    		if (is != null) {
+    			
+    			try {
+    				byte[] b=new byte[is.available()];
+    			
+    				is.read(b);
+    				
+    				is.close();
+    				
+    				String orig=new String(b);
+    				
+    				if (orig.equals(bpel) == false) {
+    					result.addError(this,
+    							new Throwable("Generated Conversation does not match stored version"));
+    				} else {
+    					f_valid = true;
+    				}
+    			} catch(Exception e) {
+    				result.addError(this, e);
+    			}
+    		} else {
+    			result.addError(this,
+    					new Throwable("Resulting BPEL '"+filename+
+    							"' not found for comparison"));
+    		}
+    		
+    		if (f_valid == false) {
+    			String bpelfile="testmodels/"+m_name+".cdm";
+    			
+    			java.net.URL url=ChoreographyToBPELTester.class.getResource(bpelfile);
+    			
+    			/*
+    			try {
+    				url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
+    			} catch(Exception e) {
+    				e.printStackTrace();
+    			}
+    			*/
+    			
+    			if (url != null) {
+    				// URL will point to copy of test models in the classes folder, so need
+    				// to obtain reference back to source version
+    				java.io.File f=null;
+    				
+    				if (url.getFile().indexOf("classes") != -1) {
+    					f = new java.io.File(url.getFile().replaceFirst("classes","src/plugintest"));
+    				} else if (url.getFile().indexOf("bin") != -1) {						
+    					f = new java.io.File(url.getFile().replaceFirst("bin","src/plugintest"));
+    				} else {
+    					result.addError(this, new Exception("Could not locate results folder to record expected result"));
+    				}
+    				
+    				if (f != null && f.exists()) {
+    					f = f.getParentFile().getParentFile();
+    					
+    					java.io.File resultsDir=new java.io.File(f, "results");
+    					
+    					if (resultsDir.exists() == false) {
+    						resultsDir.mkdirs();
+    					}
+    					
+    					java.io.File resultFile=new java.io.File(resultsDir,
+    										m_name+"@"+m_role+".expected");
+    					
+    					if (resultFile.exists() == false) {
+    						try {
+    							java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
+    							
+    							fos.write(bpel.getBytes());
+    							
+    							fos.flush();
+    							fos.close();
+    							
+    						} catch(Exception e){
+    							result.addError(this, e);
+    						}
+    					} else {
+    						System.err.println("NOTE: Expected output '"+resultFile+
+    									"' already exists - not being overwritten");
+    					}
+    				} else {
+    					result.addError(this, new Throwable("Unable to obtain URL for CDM model source '"+
+    							m_name+"': "+url));
+    				}
+    			}
+    		}
+    	}
+
+    	private String m_name=null;
+    	private SubDefinitionPath m_subDefinitionPath=null;
+    	private String m_role=null;
+    }
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Broker.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Broker.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Broker.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+<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.LoanBroker at Broker" name="ESBBrokerProcess_Broker" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <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_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <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_BrokerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <partnerLinks>
+        <partnerLink myRole="BrokerBehavior" name="BuyerToBroker" partnerLinkType="brk:BuyerToBrokerServiceLT"/>
+        <partnerLink name="BrokerToSupplierQuoteEngine" partnerLinkType="brk:BrokerToSupplierQuoteEngineLT" partnerRole="SupplierQuoteEngineRequester"/>
+        <partnerLink name="BrokerToCreditAgency" partnerLinkType="brk:BrokerToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+        <partnerLink name="BrokerToSupplierTxnProcessor" partnerLinkType="brk:BrokerToSupplierTxnProcessorLT" partnerRole="SupplierTxnProcessorRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="brk:makeEnquiryRequest" name="makeEnquiryRequestVar"/>
+        <variable messageType="spr:getQuoteRequest" name="getQuoteRequestVar"/>
+        <variable messageType="spr:getQuoteResponse" name="getQuoteResponseVar"/>
+        <variable messageType="brk:makeEnquiryResponse" name="makeEnquiryResponseVar"/>
+        <variable messageType="brk:buyRequest" name="buyRequestVar"/>
+        <variable messageType="cay:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="cay:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="spr:confirmRequest" name="confirmRequestVar"/>
+        <variable messageType="spr:confirmResponse" name="confirmResponseVar"/>
+        <variable messageType="brk:buyResponse" name="buyResponseVar"/>
+        <variable messageType="brk:rejectedFault" name="rejectedFaultVar"/>
+        <variable messageType="brk:cancelRequest" name="cancelRequestVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_enquiry" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryRequestVar"/>
+        <while>
+            <sequence>
+                <scope>
+                    <sequence>
+                        <invoke inputVariable="getQuoteRequestVar" name="Send_requestForQuote" operation="getQuote" outputVariable="getQuoteResponseVar" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior"/>
+                    </sequence>
+                </scope>
+            </sequence>
+        </while>
+        <reply name="Send_quoteList" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryResponseVar"/>
+        <pick>
+            <onMessage operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="buyRequestVar">
+                <sequence>
+                    <scope>
+                        <sequence>
+                            <scope>
+                                <faultHandlers>
+                                    <catch faultMessageType="cay:invalidCreditFault" faultName="cay:invalidCredit" faultVariable="invalidCreditFaultVar">
+                                        <sequence>
+                                            <reply faultName="brk:rejected" name="Send_orderRejected" operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="rejectedFaultVar"/>
+                                        </sequence>
+                                    </catch>
+                                </faultHandlers>
+                                <sequence>
+                                    <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"/>
+                                    <invoke inputVariable="confirmRequestVar" name="Send_orderConfirmed" operation="confirm" outputVariable="confirmResponseVar" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior"/>
+                                    <reply name="Send_bookingReference" operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="buyResponseVar"/>
+                                </sequence>
+                            </scope>
+                        </sequence>
+                    </scope>
+                </sequence>
+            </onMessage>
+            <onMessage operation="cancel" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="cancelRequestVar">
+                <sequence/>
+            </onMessage>
+        </pick>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,43 @@
+<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.LoanBroker at Buyer" name="ESBBrokerProcess_Buyer" targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <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_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <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_BuyerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
+    <partnerLinks>
+        <partnerLink myRole="BrokerBehavior" name="BuyerToBroker" partnerLinkType="byr:BuyerToBrokerLT" partnerRole="BrokerRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="brk:makeEnquiryRequest" name="makeEnquiryRequestVar"/>
+        <variable messageType="brk:makeEnquiryResponse" name="makeEnquiryResponseVar"/>
+        <variable messageType="brk:buyRequest" name="buyRequestVar"/>
+        <variable messageType="brk:buyResponse" name="buyResponseVar"/>
+        <variable messageType="brk:cancelRequest" name="cancelRequestVar"/>
+    </variables>
+    <sequence>
+        <invoke inputVariable="makeEnquiryRequestVar" name="Send_enquiry" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+        <receive name="Receive_quoteList" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryResponseVar"/>
+        <if>
+            <sequence>
+                <scope>
+                    <sequence>
+                        <scope>
+                            <faultHandlers>
+                                <catch faultMessageType="brk:rejectedFault" faultName="brk:rejected" faultVariable="rejectedFaultVar">
+                                    <sequence/>
+                                </catch>
+                            </faultHandlers>
+                            <sequence>
+                                <invoke inputVariable="buyRequestVar" name="Send_buy" operation="buy" outputVariable="buyResponseVar" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+                            </sequence>
+                        </scope>
+                    </sequence>
+                </scope>
+            </sequence>
+            <else>
+                <sequence>
+                    <invoke inputVariable="cancelRequestVar" name="Send_cancel" operation="cancel" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at CreditAgency.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at CreditAgency.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -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 at 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>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Supplier.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Supplier.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at Supplier.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+<process name="ESBBrokerProcess_Supplier" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <sequence/>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierQuoteEngine.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierQuoteEngine.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierQuoteEngine.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+<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.LoanBroker at SupplierQuoteEngine" name="RequestForQuote_SupplierQuoteEngine" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngine.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngineArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <partnerLinks>
+        <partnerLink myRole="SupplierBehavior" name="BrokerToSupplierQuoteEngine" partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="spr:getQuoteRequest" name="getQuoteRequestVar"/>
+        <variable messageType="spr:getQuoteResponse" name="getQuoteResponseVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_requestForQuote" operation="getQuote" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior" variable="getQuoteRequestVar"/>
+        <reply name="Send_quote" operation="getQuote" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior" variable="getQuoteResponseVar"/>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierTxnProcessor.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierTxnProcessor.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ESBBroker at SupplierTxnProcessor.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+<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.LoanBroker at SupplierTxnProcessor" name="CompleteTransaction_SupplierTxnProcessor" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="CompleteTransaction_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <partnerLinks>
+        <partnerLink myRole="SupplierTxnProcessorService" name="BrokerToSupplierTxnProcessor" partnerLinkType="spr:BrokerToSupplierTxnProcessorServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="spr:confirmRequest" name="confirmRequestVar"/>
+        <variable messageType="spr:confirmResponse" name="confirmResponseVar"/>
+    </variables>
+    <sequence>
+        <pick createInstance="yes">
+            <onMessage operation="confirm" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior" variable="confirmRequestVar">
+                <sequence>
+                    <reply name="Send_bookingReference" operation="confirm" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior" variable="confirmResponseVar"/>
+                </sequence>
+            </onMessage>
+        </pick>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Buyer" name="PurchaseGoodsProcess_Buyer" targetNamespace="http://www.jboss.org/savara/examples" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_BuyerArtifacts.wsdl" namespace="http://www.jboss.org/savara/examples"/>
+    <partnerLinks>
+        <partnerLink name="BuyerToStore" partnerLinkType="tns:BuyerToStoreLT" partnerRole="StoreRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="sto:buyResponse" name="buyResponseVar"/>
+    </variables>
+    <sequence>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="sto:BuyFailedFault" faultName="sto:BuyFailed" faultVariable="BuyFailedFaultVar">
+                    <sequence/>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="buyRequestVar" name="Send_BuyRequest" operation="buy" outputVariable="buyResponseVar" partnerLink="BuyerToStore" portType="sto:StoreInterface"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at CreditAgency.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at CreditAgency.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,26 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Common at CreditAgency" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="java:org.jboss.savara.examples.purchasing" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <partnerLinks>
+        <partnerLink myRole="CreditAgencyInterface" name="StoreToCreditAgency" partnerLinkType="pur:StoreToCreditAgencyServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="pur:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="pur:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="pur:CreditCheckFailedFault" name="CreditCheckFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="checkCreditRequestVar"/>
+        <if>
+            <sequence>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="checkCreditResponseVar"/>
+            </sequence>
+            <else>
+                <sequence>
+                    <reply faultName="pur:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="CreditCheckFailedFaultVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Store.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Store.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/PurchaseGoods at Store.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Store" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <partnerLinks>
+        <partnerLink myRole="StoreInterface" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+        <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="pur:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="pur:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="sto:buyResponse" name="buyResponseVar"/>
+        <variable messageType="sto:BuyFailedFault" name="BuyFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyRequestVar"/>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="pur:CreditCheckFailedFault" faultName="pur:CreditCheckFailed" faultVariable="CreditCheckFailedFaultVar">
+                    <sequence>
+                        <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="BuyFailedFaultVar"/>
+                    </sequence>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface"/>
+                <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyResponseVar"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:tns="http://www.pi4soa.org/ReqRespFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="overlord.cdl.samples.LoanBroker at Buyer" name="ReqRespFaultProcess_Buyer" targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_BuyerArtifacts.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+    <partnerLinks>
+        <partnerLink name="BuyerToSeller" partnerLinkType="byr:BuyerToSellerLT" partnerRole="SellerRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="slr:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="slr:checkCreditResponse" name="checkCreditResponseVar"/>
+    </variables>
+    <sequence>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="slr:insufficientCreditFault" faultName="slr:insufficientCredit" faultVariable="insufficientCreditFaultVar">
+                    <sequence/>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="BuyerToSeller" portType="slr:SellerBehavior"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Seller.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Seller.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/results/ReqRespFault at Seller.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,25 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:tns="http://www.pi4soa.org/ReqRespFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="org.pi4soa.reqrespfault.reqrespfault.ReqRespFaultProcess at Seller" name="ReqRespFaultProcess_Seller" targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_SellerArtifacts.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <partnerLinks>
+        <partnerLink myRole="SellerBehavior" name="BuyerToSeller" partnerLinkType="slr:BuyerToSellerServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="slr:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="slr:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="slr:insufficientCreditFault" name="insufficientCreditFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="checkCreditRequestVar"/>
+        <if>
+            <sequence>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="checkCreditResponseVar"/>
+            </sequence>
+            <else>
+                <sequence>
+                    <reply faultName="slr:insufficientCredit" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="insufficientCreditFaultVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ESBBroker.cdm
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ESBBroker.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ESBBroker.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for ESBBroker" name="ESBBroker" author="gary" version="0.2" targetNamespace="http://www.pi4soa.org/ESBBroker">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for ESBBroker" prefix="tns" uRI="http://www.pi4soa.org/ESBBroker"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces description="Target Namespace for ESBBroker" prefix="brk" uRI="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <nameSpaces description="Target Namespace for ESBBroker" prefix="byr" uRI="http://www.pi4soa.org/ESBBroker/Buyer"/>
+    <nameSpaces description="Target Namespace for ESBBroker" prefix="cay" uRI="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <nameSpaces description="Target Namespace for ESBBroker" prefix="spr" uRI="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <informationTypes description="This is the information type BookingReference" name="BookingReference" elementName="bookingReference"/>
+    <informationTypes description="This is the information type Buy" name="Buy" elementName="buy"/>
+    <informationTypes description="This is the information type Cancel" name="Cancel" elementName="cancel"/>
+    <informationTypes description="This is the information type CreditInformation" name="CreditInformation" elementName="CreditCheckRequest"/>
+    <informationTypes description="This is the information type CreditInvalid" name="CreditInvalid" elementName="CreditCheckInvalid"/>
+    <informationTypes description="This is the information type CreditValid" name="CreditValid" elementName="CreditCheckOk"/>
+    <informationTypes description="This is the information type Enquiry" name="Enquiry" typeName="" elementName="enquiry"/>
+    <informationTypes description="This is the information type OrderConfirmed" name="OrderConfirmed" elementName="orderConfirmed"/>
+    <informationTypes description="This is the information type OrderRejected" name="OrderRejected" elementName="orderRejected"/>
+    <informationTypes description="This is the information type Quote" name="Quote" elementName="quote"/>
+    <informationTypes description="This is the information type QuoteList" name="QuoteList" elementName="quoteList"/>
+    <informationTypes description="This is the information type RequestForQuote" name="RequestForQuote" elementName="requestForQuote"/>
+    <informationTypes description="This is the information type URIType" name="URIType"/>
+    <tokens description="This is the token URI" name="URI" informationType="//@typeDefinitions/@informationTypes.12"/>
+    <roleTypes description="This is the role type Broker" name="Broker">
+      <behaviors description="This is the behavior BrokerBehavior" name="BrokerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Supplier" name="Supplier">
+      <behaviors description="This is the behavior SupplierBehavior" name="SupplierBehavior"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Broker and CreditAgency" name="BrokerToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between Broker and Supplier" name="BrokerToSupplierRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.3"/>
+    <relationshipTypes description="Relationship between Buyer and Broker" name="BuyerToBrokerRel" firstRoleType="//@typeDefinitions/@roleTypes.1" secondRoleType="//@typeDefinitions/@roleTypes.0"/>
+    <participantTypes description="This is the participant type brk:Broker" name="brk:Broker" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at Broker" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type byr:Buyer" name="byr:Buyer" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type cay:CreditAgency" name="cay:CreditAgency" roleTypes="//@typeDefinitions/@roleTypes.2">
+      <semanticAnnotations annotation="overlord.cdl.samples.Common at CreditAgency" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type spr:Supplier" name="spr:Supplier" roleTypes="//@typeDefinitions/@roleTypes.3">
+      <semanticAnnotations annotation="" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type BrokerChannelType" name="BrokerChannelType" referenceToken="//@typeDefinitions/@tokens.0" roleType="//@typeDefinitions/@roleTypes.0"/>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.0" roleType="//@typeDefinitions/@roleTypes.2"/>
+    <channelTypes description="This is the channel type SupplierChannelType" name="SupplierChannelType" referenceToken="//@typeDefinitions/@tokens.0" roleType="//@typeDefinitions/@roleTypes.3"/>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the ESBBroker process" name="ESBBrokerProcess" root="true">
+    <enclosedChoreographies name="CompleteTransaction">
+      <participantDefinitions name="SupplierTxnProcessor" roleTypes="//@typeDefinitions/@roleTypes.3">
+        <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at SupplierTxnProcessor" name="conversationType"/>
+      </participantDefinitions>
+      <variableDefinitions description="Channel to facilitate interaction to Broker" name="BrokerChannel" type="//@typeDefinitions/@channelTypes.0" free="true" roleTypes="//@typeDefinitions/@roleTypes.0 //@typeDefinitions/@roleTypes.1"/>
+      <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.1"/>
+      <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.2"/>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="Buy" operation="buy" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction Buy" name="BuyRequestExchange" type="//@typeDefinitions/@informationTypes.1"/>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="CheckCredit" operation="checkCredit" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CheckCredit" name="CheckCreditRequestExchange" type="//@typeDefinitions/@informationTypes.3"/>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Choice" description="Evaluate Credit Check Result">
+        <activities xsi:type="org.pi4soa.cdl:Sequence" description="Sufficient Credit">
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="CheckCreditResponse" operation="checkCredit" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CheckCreditResponse" name="CheckCreditResponseRespondExchange" type="//@typeDefinitions/@informationTypes.5" action="Respond"/>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="ConfirmBooking" operation="confirm" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.1" toParticipant="//@choreographies.0/@enclosedChoreographies.0/@participantDefinitions.0">
+            <exchangeDetails description="This is the exchange details for the request exchange associated with interaction ConfirmBooking" name="ConfirmBookingRequestExchange" type="//@typeDefinitions/@informationTypes.7"/>
+            <exchangeDetails description="This is the exchange details for the request exchange associated with interaction ConfirmBooking" name="ConfirmBookingRequestExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond"/>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="Buy" operation="buy" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction Buy" name="BuyRespondExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond" faultName=""/>
+          </activities>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Sequence" description="Insufficient Credit">
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="CheckCreditFailed" operation="checkCredit" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CheckCreditFailed" name="CheckCreditFailedRespondExchange" type="//@typeDefinitions/@informationTypes.4" action="Respond" faultName="invalidCredit"/>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="Buy" operation="buy" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction Buy" name="BuyRespondExchange" type="//@typeDefinitions/@informationTypes.8" action="Respond" faultName="rejected"/>
+          </activities>
+        </activities>
+      </activities>
+    </enclosedChoreographies>
+    <enclosedChoreographies name="RequestForQuote">
+      <participantDefinitions name="SupplierQuoteEngine" roleTypes="//@typeDefinitions/@roleTypes.3">
+        <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at SupplierQuoteEngine" name="conversationType"/>
+      </participantDefinitions>
+      <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.2"/>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="RFQ" operation="getQuote" channelVariable="//@choreographies.0/@enclosedChoreographies.1/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1" toParticipant="//@choreographies.0/@enclosedChoreographies.1/@participantDefinitions.0">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction RFQ" name="RFQRequestExchange" type="//@typeDefinitions/@informationTypes.11"/>
+        <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction RFQ" name="RFQRespondExchange" type="//@typeDefinitions/@informationTypes.9" action="Respond"/>
+      </activities>
+    </enclosedChoreographies>
+    <variableDefinitions description="Channel to facilitate interaction to Broker" name="BrokerChannel" type="//@typeDefinitions/@channelTypes.0" roleTypes="//@typeDefinitions/@roleTypes.0 //@typeDefinitions/@roleTypes.1"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="Enquiry" operation="makeEnquiry" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction Enquiry" name="EnquiryRequestExchange" type="//@typeDefinitions/@informationTypes.6"/>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:While" name="SendRFQToSuppliers">
+      <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.1"/>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:When" name="WhenQuotesReceivedOrTimeout">
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="Enquiry" operation="makeEnquiry" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+        <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction Enquiry" name="EnquiryRespondExchange" type="//@typeDefinitions/@informationTypes.10" action="Respond"/>
+      </activities>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice">
+      <activities xsi:type="org.pi4soa.cdl:Sequence">
+        <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.0" waitForCompletion="false">
+          <bindDetails name="BindBrokerChannel" thisVariable="//@choreographies.0/@variableDefinitions.0" thisRole="//@typeDefinitions/@roleTypes.1" freeVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" freeRole="//@typeDefinitions/@roleTypes.1"/>
+          <bindDetails name="BindBrokerChannel" thisVariable="//@choreographies.0/@variableDefinitions.0" thisRole="//@typeDefinitions/@roleTypes.0" freeVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" freeRole="//@typeDefinitions/@roleTypes.0"/>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="Cancel" operation="cancel" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+          <exchangeDetails description="This is the exchange details for the request exchange associated with interaction Cancel" name="CancelRequestExchange" type="//@typeDefinitions/@informationTypes.2"/>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/PurchaseGoods.cdm
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/PurchaseGoods.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/PurchaseGoods.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PurchaseGoods" name="PurchaseGoods" author="gary" version="0.1" targetNamespace="http://www.jboss.org/savara/examples">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces prefix="pur" uRI="java:org.jboss.savara.examples.purchasing"/>
+    <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store"/>
+    <informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="sto:BuyConfirmed" elementName=""/>
+    <informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="sto:BuyFailed" elementName=""/>
+    <informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="sto:BuyRequest" elementName=""/>
+    <informationTypes description="This is the information type CreditCheckInvalid" name="CreditCheckInvalid" typeName="pur:CreditCheckInvalid" elementName=""/>
+    <informationTypes description="This is the information type CreditCheckOk" name="CreditCheckOk" typeName="pur:CreditCheckOk" elementName=""/>
+    <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" typeName="pur:CreditCheckRequest" elementName=""/>
+    <informationTypes description="This is the information type IDType" name="IDType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URITokenType" name="URITokenType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token ID" name="ID" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator BuyFailedIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.1" query="//@id" name="BuyFailedIDLocator"/>
+    <tokenLocators description="This is the token locator BuyRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//@id" name="BuyRequestIDLocator"/>
+    <tokenLocators description="This is the token locator BuyResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.0" query="//@id" name="BuyResponseIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckInvalidIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//@id" name="CreditCheckInvalidIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@id" name="CreditCheckRequestIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.4" query="//@id" name="CreditCheckResponseIDLocator"/>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="pur:CreditAgencyInterface"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Store" name="Store">
+      <behaviors description="This is the behavior StoreBehavior" name="StoreBehavior" interface="sto:StoreInterface"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Buyer and Store" name="BuyerToStoreRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between Store and CreditAgency" name="StoreToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type Buyer" name="Buyer" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type pur:CreditAgency" name="pur:CreditAgency" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="savara.samples.Common at CreditAgency" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type sto:Store" name="sto:Store" roleTypes="//@typeDefinitions/@roleTypes.2">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Store" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type StoreChannelType" name="StoreChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.2">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the PurchaseGoods process" name="PurchaseGoodsProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.0"/>
+    <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.1"/>
+    <variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/@informationTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/@informationTypes.2"/>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.5"/>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Valid">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/@informationTypes.4" action="Respond"/>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond"/>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond" faultName="CreditCheckFailed"/>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" faultName="BuyFailed"/>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ReqRespFault.cdm
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ReqRespFault.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/generator/testmodels/ReqRespFault.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for ReqRespFault" name="ReqRespFault" author="gary" version="0.3" targetNamespace="http://www.pi4soa.org/ReqRespFault">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for ReqRespFault" prefix="tns" uRI="http://www.pi4soa.org/ReqRespFault"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces description="Target Namespace for ReqRespFault" prefix="byr" uRI="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+    <nameSpaces description="Target Namespace for ReqRespFault" prefix="slr" uRI="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <informationTypes description="This is the information type CreditInformation" name="CreditInformation" elementName="CreditCheckRequest"/>
+    <informationTypes description="This is the information type CreditInvalid" name="CreditInvalid" elementName="CreditCheckInvalid"/>
+    <informationTypes description="This is the information type CreditValid" name="CreditValid" elementName="CreditCheckOk"/>
+    <informationTypes description="This is the information type URIType" name="URIType"/>
+    <tokens description="This is the token URI" name="URI" informationType="//@typeDefinitions/@informationTypes.3"/>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Seller" name="Seller">
+      <behaviors description="This is the behavior SellerBehavior" name="SellerBehavior"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Buyer and Seller" name="BuyerToSellerRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type byr:Buyer" name="byr:Buyer" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type slr:Seller" name="slr:Seller" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="overlord.cdl.samples.LoanBroker at Broker" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type SellerChannelType" name="SellerChannelType" referenceToken="//@typeDefinitions/@tokens.0" roleType="//@typeDefinitions/@roleTypes.1"/>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the ReqRespFault process" name="ReqRespFaultProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to Broker" name="BrokerChannel" type="//@typeDefinitions/@channelTypes.0" roleTypes="//@typeDefinitions/@roleTypes.1 //@typeDefinitions/@roleTypes.0"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.0"/>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice">
+      <activities xsi:type="org.pi4soa.cdl:Sequence">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckValid" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckValid" name="CreditCheckValidRespondExchange" type="//@typeDefinitions/@informationTypes.2" action="Respond"/>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckInvalid" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckInvalid" name="CreditCheckInvalidRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" faultName="insufficientCredit"/>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/ParserTest.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/ParserTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/ParserTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,288 @@
+/*
+ * 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.tools.bpel.parser;
+
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.savara.bpel.model.BPELNotation;
+import org.scribble.conversation.model.ConversationModel;
+import org.scribble.lang.model.*;
+import org.scribble.conversation.model.ConversationNotation;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.ModelReference;
+import org.scribble.model.admin.Context;
+
+public class ParserTest extends TestCase {
+
+    public static TestSuite suite() {
+        TestSuite suite = new TestSuite("BPEL->Conversation Parser Tests");
+        
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_Broker", "ESBBroker at Broker"));
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_Buyer", "ESBBroker at Buyer"));
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_CreditAgency", "ESBBroker at CreditAgency"));
+        suite.addTest(new BPELToConversationTest("RequestForQuote_SupplierQuoteEngine", "ESBBroker at SupplierQuoteEngine"));
+        suite.addTest(new BPELToConversationTest("CompleteTransaction_SupplierTxnProcessor", "ESBBroker at SupplierTxnProcessor"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_Buyer", "PurchaseGoods at Buyer"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_CreditAgency", "PurchaseGoods at CreditAgency"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_Store", "PurchaseGoods at Store"));
+        suite.addTest(new BPELToConversationTest("ReqRespFaultProcess_Buyer", "ReqRespFault at Buyer"));
+        suite.addTest(new BPELToConversationTest("ReqRespFaultProcess_Seller", "ReqRespFault at Seller"));
+        
+        /**
+         * TODO: (SAVARA-150) Commenting out this test for now, as we now need the accompanying WSDL to be able to
+         * resolve the message type's underlying XSD element or type.
+         *
+        suite.addTest(new BPELToConversationTest("LoanApprovalService at Service", "LoanApprovalService at Service"));
+         */
+
+        return suite;
+    }
+    
+    /**
+     * The test case for running the BPEL to Conversation test.
+     */
+	public static class BPELToConversationTest extends TestCase {
+
+		/**
+		 * This constructor is initialized with the test
+		 * name.
+		 * 
+		 * @param name The test name
+		 */
+		public BPELToConversationTest(String bpelName, String scvName) {
+			super(bpelName+"->"+scvName);
+			m_bpelName = bpelName;
+			m_scvName = scvName;
+		}
+		
+		/**
+		 * This method runs the test.
+		 * 
+		 * @param result The test result
+		 */
+		public void run(TestResult result) {
+			result.startTest(this);
+			
+			String filename="testmodels/"+m_bpelName+".bpel";
+			
+			java.io.InputStream is=
+				ParserTest.class.getResourceAsStream(filename);
+			
+			if (is == null) {
+				result.addError(this,
+						new Throwable("Unable to locate resource: "+filename));
+			} else {			
+				org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
+				org.scribble.model.ModelReference ref=
+						new org.scribble.model.ModelReference(BPELNotation.NOTATION_CODE);
+				org.scribble.model.admin.DefaultModelListener l=
+						new org.scribble.model.admin.DefaultModelListener();
+				
+				org.scribble.model.Model model=p.parse(ref, is, l, new ResourceLoaderContext());
+				
+				if (model == null) {
+					result.addError(this, new Throwable("Model is null"));
+						
+				} else if ((model instanceof LanguageModel) == false) {
+					result.addError(this, new Throwable("Model is null"));
+					
+				} else if (l.getErrors().size() != 0) {
+					result.addError(this, new Throwable("Failed to parse CDM Model"));
+					
+					for (int i=0; i < l.getErrors().size(); i++) {
+						System.err.println("ModelIssue: "+
+								l.getErrors().get(i).getMessage());
+					}
+				} else {
+					LanguageModel lm=(LanguageModel)model;
+					ConversationModel cm=new ConversationModel();
+					
+					cm.setNamespace(lm.getNamespace());
+					
+					if (lm.getConversations().size() == 1) {
+						cm.setConversation(lm.getConversations().get(0));
+					}
+
+					try {
+						org.scribble.export.Exporter exporter=
+							(org.scribble.export.Exporter)
+							RegistryFactory.getRegistry().getExtension(
+									org.scribble.export.Exporter.class, null);
+
+						org.scribble.export.text.TextFormatter formatter=
+							new org.scribble.export.text.TextFormatter();
+						
+						java.io.ByteArrayOutputStream os=
+							new java.io.ByteArrayOutputStream();
+						
+						formatter.setOutputStream(os);
+														
+						exporter.export(new ModelReference(ConversationNotation.NOTATION_CODE),
+								cm, formatter);
+						
+						String str=new String(os.toByteArray());
+						
+						checkResults(result, str);
+						
+					} catch(Exception e) {
+						e.printStackTrace();
+					}
+				}
+			}
+			
+			result.endTest(this);
+		}
+		
+		/**
+		 * This method checks the generated jboss-esb.xml against a
+		 * previously stored correct version.
+		 * 
+		 * @param result The test result
+		 * @param conv The conversation
+		 */
+		protected void checkResults(TestResult result, String conv) {
+			boolean f_valid=false;
+
+			String filename="results/"+m_scvName+".scv";
+			
+			java.io.InputStream is=
+				ParserTest.class.getResourceAsStream(filename);
+			
+			if (is != null) {
+				
+				try {
+					byte[] b=new byte[is.available()];
+				
+					is.read(b);
+					
+					is.close();
+					
+					String orig=new String(b);
+					
+					if (orig.equals(conv) == false) {
+						result.addError(this,
+							new Throwable("Generated Conversation does not match stored version"));
+					} else {
+						f_valid = true;
+					}
+				} catch(Exception e) {
+					result.addError(this, e);
+				}
+			} else {
+				result.addError(this,
+						new Throwable("Resulting Conversation '"+filename+
+								"' not found for comparison"));
+			}
+			
+			if (f_valid == false) {
+				String bpelfile="testmodels/"+m_bpelName+".bpel";
+				
+				java.net.URL url=ParserTest.class.getResource(bpelfile);
+				
+				try {
+					url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+				
+				if (url != null) {
+					// URL will point to copy of test models in the classes folder, so need
+					// to obtain reference back to source version
+					java.io.File f=null;
+					
+					if (url.getFile().indexOf("classes") != -1) {
+						f = new java.io.File(url.getFile().replaceFirst("classes","src/plugintest"));
+					} else if (url.getFile().indexOf("bin") != -1) {						
+						f = new java.io.File(url.getFile().replaceFirst("bin","src/plugintest"));
+					} else {
+						result.addError(this, new Exception("Could not locate results folder to record expected result"));
+					}
+					
+					if (f != null && f.exists()) {
+						f = f.getParentFile().getParentFile();
+						
+						java.io.File resultsDir=new java.io.File(f, "results");
+						
+						if (resultsDir.exists() == false) {
+							resultsDir.mkdirs();
+						}
+						
+						java.io.File resultFile=new java.io.File(resultsDir, m_scvName+".expected");
+						
+						if (resultFile.exists() == false) {
+							try {
+								java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
+								
+								fos.write(conv.getBytes());
+								
+								fos.flush();
+								fos.close();
+								
+							} catch(Exception e){
+								result.addError(this, e);
+							}
+						} else {
+							System.err.println("NOTE: Expected output '"+resultFile+
+										"' already exists - not being overwritten");
+						}
+					} else {
+						result.addError(this, new Throwable("Unable to obtain URL for BPEL model source '"+
+								m_bpelName+"': "+url));
+					}
+				}
+			}
+		}
+
+		private String m_bpelName=null;
+		private String m_scvName=null;
+	}
+
+	public static class ResourceLoaderContext implements Context {
+
+		public ResourceLoaderContext() {
+		}
+		
+		public InputStream getResource(ModelReference ref, String uri) {
+			String filename="testmodels/"+uri;
+			
+			java.io.InputStream is=
+				ParserTest.class.getResourceAsStream(filename);
+			
+			return(is);
+		}
+
+		public java.net.URI getResourceURI(ModelReference ref, String uri) {
+			String filename="testmodels/"+uri;
+			
+			java.net.URI ret=null;
+			
+			try {
+				ret = ParserTest.class.getResource(filename).toURI();
+			} catch(Exception e) {
+				e.printStackTrace();
+			}
+			
+			return(ret);
+		}
+		
+	}
+}

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Broker.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Broker.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Broker.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,35 @@
+namespace null;
+
+conversation ESBBrokerProcess_Broker at Broker implements LoanBroker at Broker {
+	makeEnquiry(enquiry) from Buyer to Broker;
+	while {
+		getQuote(requestForQuote) from Broker to SupplierQuoteEngine;
+		getQuote(quote) from SupplierQuoteEngine to Broker;
+	}
+	;
+	makeEnquiry(quoteList) from Broker to Buyer;
+	if {
+		buy(buy) from Buyer to Broker;
+		try {
+			checkCredit(CreditCheckRequest) from Broker to CreditAgency;
+			if {
+				checkCredit(CreditCheckOk) from CreditAgency to Broker;
+			} else if {
+				checkCredit(CreditCheckInvalid) from CreditAgency to Broker;
+				raise invalidCredit;
+			}
+			confirm(orderConfirmed) from Broker to SupplierTxnProcessor;
+			if {
+				confirm(bookingReference) from SupplierTxnProcessor to Broker;
+			} else if {
+				confirm(CreditCheckInvalid) from SupplierTxnProcessor to Broker;
+				raise invalidCredit;
+			}
+			buy(bookingReference) from Broker to Buyer;
+		} catch invalidCredit {
+			buy(orderRejected) from Broker to Buyer;
+		}
+	} else if {
+		cancel(cancel) from Buyer to Broker;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Buyer.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Buyer.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at Buyer.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,16 @@
+namespace null;
+
+conversation ESBBrokerProcess_Buyer at Buyer implements LoanBroker at Buyer {
+	makeEnquiry(enquiry) from Buyer to Broker;
+	makeEnquiry(quoteList) from Broker to Buyer;
+	if {
+		buy(buy) from Buyer to Broker;
+		if {
+			buy(bookingReference) from Broker to Buyer;
+		} else if {
+			buy(orderRejected) from Broker to Buyer;
+		}
+	} else if {
+		cancel(cancel) from Buyer to Broker;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at CreditAgency.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at CreditAgency.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at CreditAgency.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+namespace null;
+
+conversation ESBBrokerProcess_CreditAgency at CreditAgency implements Common at 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/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierQuoteEngine.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierQuoteEngine.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierQuoteEngine.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+namespace null;
+
+conversation RequestForQuote_SupplierQuoteEngine at SupplierQuoteEngine implements LoanBroker at SupplierQuoteEngine {
+	getQuote(requestForQuote) from Broker to SupplierQuoteEngine;
+	getQuote(quote) from SupplierQuoteEngine to Broker;
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierTxnProcessor.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierTxnProcessor.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ESBBroker at SupplierTxnProcessor.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+namespace null;
+
+conversation CompleteTransaction_SupplierTxnProcessor at SupplierTxnProcessor implements LoanBroker at SupplierTxnProcessor {
+	if {
+		confirm(orderConfirmed) from Broker to SupplierTxnProcessor;
+		confirm(bookingReference) from SupplierTxnProcessor to Broker;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,41 @@
+namespace null;
+
+conversation loanApprovalProcess {
+	try {
+		boolean	receive-to-assess, receive-to-approval, approval-to-reply, assess-to-setMessage, setMessage-to-reply, assess-to-approval;
+		parallel {
+			request(creditInformationMessage) from customer;
+			receive-to-assess = xpath[true()];
+			receive-to-approval = xpath[true()];
+		} and {
+			when (xpath[$receive-to-assess])  {
+				check(creditInformationMessage) to assessor;
+				if {
+					check(riskAssessmentMessage) from assessor;
+				} else if {
+					check(errorMessage) from assessor;
+					raise lns:loanProcessFault;
+				}
+				assess-to-setMessage = xpath[true()];
+				assess-to-approval = xpath[true()];
+			}
+		} and {
+			when (xpath[$receive-to-approval and $assess-to-approval])  {
+				approve(creditInformationMessage) to approver;
+				if {
+					approve(approvalMessage) from approver;
+				} else if {
+					approve(errorMessage) from approver;
+					raise lns:loanProcessFault;
+				}
+				approval-to-reply = xpath[true()];
+			}
+		} and {
+			when (xpath[$setMessage-to-reply and $approval-to-reply])  {
+				request(approvalMessage) to customer;
+			}
+		}
+	} catch lns:loanProcessFault {
+		request(errorMessage) to customer;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Buyer.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Buyer.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Buyer.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,10 @@
+namespace null;
+
+conversation PurchaseGoodsProcess_Buyer at Buyer implements Purchasing at Buyer {
+	buy(BuyRequest) from Buyer to Store;
+	if {
+		buy(BuyConfirmed) from Store to Buyer;
+	} else if {
+		buy(BuyFailed) from Store to Buyer;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at CreditAgency.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at CreditAgency.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at CreditAgency.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,10 @@
+namespace null;
+
+conversation PurchaseGoodsProcess_CreditAgency at CreditAgency implements Common at CreditAgency {
+	checkCredit(CreditCheckRequest) from Store to CreditAgency;
+	if {
+		checkCredit(CreditCheckOk) from CreditAgency to Store;
+	} else if {
+		checkCredit(CreditCheckInvalid) from CreditAgency to Store;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Store.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Store.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/PurchaseGoods at Store.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,13 @@
+namespace null;
+
+conversation PurchaseGoodsProcess_Store at Store implements Purchasing at Store {
+	buy(BuyRequest) from Buyer to Store;
+	checkCredit(CreditCheckRequest) from Store to CreditAgency;
+	if {
+		checkCredit(CreditCheckOk) from CreditAgency to Store;
+		buy(BuyConfirmed) from Store to Buyer;
+	} else if {
+		checkCredit(CreditCheckInvalid) from CreditAgency to Store;
+		buy(BuyFailed) from Store to Buyer;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Buyer.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Buyer.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Buyer.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,10 @@
+namespace null;
+
+conversation ReqRespFaultProcess_Buyer at Buyer implements LoanBroker at Buyer {
+	checkCredit(CreditCheckRequest) from Buyer to Seller;
+	if {
+		checkCredit(CreditCheckOk) from Seller to Buyer;
+	} else if {
+		checkCredit(CreditCheckInvalid) from Seller to Buyer;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Seller.scv
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Seller.scv	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/results/ReqRespFault at Seller.scv	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,10 @@
+namespace null;
+
+conversation ReqRespFaultProcess_Seller at Seller implements ReqRespFaultProcess at Seller {
+	checkCredit(CreditCheckRequest) from Buyer to Seller;
+	if {
+		checkCredit(CreditCheckOk) from Seller to Buyer;
+	} else if {
+		checkCredit(CreditCheckInvalid) from Seller to Buyer;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,20 @@
+<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.LoanBroker at SupplierTxnProcessor" name="CompleteTransaction_SupplierTxnProcessor" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="CompleteTransaction_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <partnerLinks>
+        <partnerLink myRole="SupplierTxnProcessorService" name="BrokerToSupplierTxnProcessor" partnerLinkType="spr:BrokerToSupplierTxnProcessorServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="spr:confirmRequest" name="confirmRequestVar"/>
+        <variable messageType="spr:confirmResponse" name="confirmResponseVar"/>
+    </variables>
+    <sequence>
+        <pick createInstance="yes">
+            <onMessage operation="confirm" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior" variable="confirmRequestVar">
+                <sequence>
+                    <reply name="Send_bookingReference" operation="confirm" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior" variable="confirmResponseVar"/>
+                </sequence>
+            </onMessage>
+        </pick>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessor.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="confirmRequest">
+        <wsdl:part element="orderConfirmed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="confirmResponse">
+        <wsdl:part element="bookingReference" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteResponse">
+        <wsdl:part element="quote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteRequest">
+        <wsdl:part element="requestForQuote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="SupplierBehavior">
+        <wsdl:operation name="confirm">
+            <wsdl:input message="spr:confirmRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:confirmResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <wsdl:input message="spr:getQuoteRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:getQuoteResponse">
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SupplierBehaviorBinding" type="spr:SupplierBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="confirm">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SupplierService">
+        <wsdl:port binding="spr:SupplierBehaviorBinding" name="SupplierBehaviorPort">
+            <soap:address location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+    <wsdl:import location="CompleteTransaction_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <plnk:partnerLinkType name="BrokerToSupplierTxnProcessorServiceLT">
+        <plnk:role name="SupplierTxnProcessorService" portType="ns1:SupplierBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,66 @@
+<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.LoanBroker at Broker" name="ESBBrokerProcess_Broker" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <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_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <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_BrokerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <partnerLinks>
+        <partnerLink myRole="BrokerBehavior" name="BuyerToBroker" partnerLinkType="brk:BuyerToBrokerServiceLT"/>
+        <partnerLink name="BrokerToSupplierQuoteEngine" partnerLinkType="brk:BrokerToSupplierQuoteEngineLT" partnerRole="SupplierQuoteEngineRequester"/>
+        <partnerLink name="BrokerToCreditAgency" partnerLinkType="brk:BrokerToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+        <partnerLink name="BrokerToSupplierTxnProcessor" partnerLinkType="brk:BrokerToSupplierTxnProcessorLT" partnerRole="SupplierTxnProcessorRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="brk:makeEnquiryRequest" name="makeEnquiryRequestVar"/>
+        <variable messageType="spr:getQuoteRequest" name="getQuoteRequestVar"/>
+        <variable messageType="spr:getQuoteResponse" name="getQuoteResponseVar"/>
+        <variable messageType="brk:makeEnquiryResponse" name="makeEnquiryResponseVar"/>
+        <variable messageType="brk:buyRequest" name="buyRequestVar"/>
+        <variable messageType="cay:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="cay:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="spr:confirmRequest" name="confirmRequestVar"/>
+        <variable messageType="spr:confirmResponse" name="confirmResponseVar"/>
+        <variable messageType="brk:buyResponse" name="buyResponseVar"/>
+        <variable messageType="brk:rejectedFault" name="rejectedFaultVar"/>
+        <variable messageType="brk:cancelRequest" name="cancelRequestVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_enquiry" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryRequestVar"/>
+        <while>
+            <sequence>
+                <scope>
+                    <sequence>
+                        <invoke inputVariable="getQuoteRequestVar" name="Send_requestForQuote" operation="getQuote" outputVariable="getQuoteResponseVar" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior"/>
+                    </sequence>
+                </scope>
+            </sequence>
+        </while>
+        <reply name="Send_quoteList" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryResponseVar"/>
+        <pick>
+            <onMessage operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="buyRequestVar">
+                <sequence>
+                    <scope>
+                        <sequence>
+                            <scope>
+                                <faultHandlers>
+                                    <catch faultMessageType="cay:invalidCreditFault" faultName="cay:invalidCredit" faultVariable="invalidCreditFaultVar">
+                                        <sequence>
+                                            <reply faultName="brk:rejected" name="Send_orderRejected" operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="rejectedFaultVar"/>
+                                        </sequence>
+                                    </catch>
+                                </faultHandlers>
+                                <sequence>
+                                    <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="BrokerToCreditAgency" portType="cay:CreditAgencyBehavior"/>
+                                    <invoke inputVariable="confirmRequestVar" name="Send_orderConfirmed" operation="confirm" outputVariable="confirmResponseVar" partnerLink="BrokerToSupplierTxnProcessor" portType="spr:SupplierBehavior"/>
+                                    <reply name="Send_bookingReference" operation="buy" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="buyResponseVar"/>
+                                </sequence>
+                            </scope>
+                        </sequence>
+                    </scope>
+                </sequence>
+            </onMessage>
+            <onMessage operation="cancel" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="cancelRequestVar">
+                <sequence/>
+            </onMessage>
+        </pick>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Broker.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Broker" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="rejectedFault">
+        <wsdl:part element="orderRejected" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="makeEnquiryRequest">
+        <wsdl:part element="enquiry" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyResponse">
+        <wsdl:part element="bookingReference" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="makeEnquiryResponse">
+        <wsdl:part element="quoteList" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyRequest">
+        <wsdl:part element="buy" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="cancelRequest">
+        <wsdl:part element="cancel" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="BrokerBehavior">
+        <wsdl:operation name="buy">
+            <wsdl:input message="brk:buyRequest">
+            </wsdl:input>
+            <wsdl:output message="brk:buyResponse">
+            </wsdl:output>
+            <wsdl:fault message="brk:rejectedFault" name="rejected">
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="makeEnquiry">
+            <wsdl:input message="brk:makeEnquiryRequest">
+            </wsdl:input>
+            <wsdl:output message="brk:makeEnquiryResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="cancel">
+            <wsdl:input message="brk:cancelRequest">
+            </wsdl:input>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="BrokerBehaviorBinding" type="brk:BrokerBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="buy">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Broker/buy"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="rejected">
+                <soap:fault name="rejected" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="makeEnquiry">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Broker/makeEnquiry"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="cancel">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Broker/cancel"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="BrokerService">
+        <wsdl:port binding="brk:BrokerBehaviorBinding" name="BrokerBehaviorPort">
+            <soap:address location="http://localhost:8080/BrokerService/BrokerBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BrokerArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BrokerArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BrokerArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ESBBroker/Broker" xmlns:ns2="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:ns3="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
+    <wsdl:import location="ESBBrokerProcess_Broker.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <wsdl:import location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <plnk:partnerLinkType name="BuyerToBrokerServiceLT">
+        <plnk:role name="BrokerBehavior" portType="ns1:BrokerBehavior"/>
+    </plnk:partnerLinkType>
+    <plnk:partnerLinkType name="BrokerToSupplierQuoteEngineLT">
+        <plnk:role name="SupplierQuoteEngineRequester" portType="ns2:SupplierBehavior"/>
+    </plnk:partnerLinkType>
+    <plnk:partnerLinkType name="BrokerToCreditAgencyLT">
+        <plnk:role name="CreditAgencyRequester" portType="ns3:CreditAgencyBehavior"/>
+    </plnk:partnerLinkType>
+    <plnk:partnerLinkType name="BrokerToSupplierTxnProcessorLT">
+        <plnk:role name="SupplierTxnProcessorRequester" portType="ns2:SupplierBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,43 @@
+<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.LoanBroker at Buyer" name="ESBBrokerProcess_Buyer" targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <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_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <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_BuyerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
+    <partnerLinks>
+        <partnerLink myRole="BrokerBehavior" name="BuyerToBroker" partnerLinkType="byr:BuyerToBrokerLT" partnerRole="BrokerRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="brk:makeEnquiryRequest" name="makeEnquiryRequestVar"/>
+        <variable messageType="brk:makeEnquiryResponse" name="makeEnquiryResponseVar"/>
+        <variable messageType="brk:buyRequest" name="buyRequestVar"/>
+        <variable messageType="brk:buyResponse" name="buyResponseVar"/>
+        <variable messageType="brk:cancelRequest" name="cancelRequestVar"/>
+    </variables>
+    <sequence>
+        <invoke inputVariable="makeEnquiryRequestVar" name="Send_enquiry" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+        <receive name="Receive_quoteList" operation="makeEnquiry" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior" variable="makeEnquiryResponseVar"/>
+        <if>
+            <sequence>
+                <scope>
+                    <sequence>
+                        <scope>
+                            <faultHandlers>
+                                <catch faultMessageType="brk:rejectedFault" faultName="brk:rejected" faultVariable="rejectedFaultVar">
+                                    <sequence/>
+                                </catch>
+                            </faultHandlers>
+                            <sequence>
+                                <invoke inputVariable="buyRequestVar" name="Send_buy" operation="buy" outputVariable="buyResponseVar" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+                            </sequence>
+                        </scope>
+                    </sequence>
+                </scope>
+            </sequence>
+            <else>
+                <sequence>
+                    <invoke inputVariable="cancelRequestVar" name="Send_cancel" operation="cancel" partnerLink="BuyerToBroker" portType="brk:BrokerBehavior"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BuyerArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BuyerArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_BuyerArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ESBBroker/Broker" xmlns:ns2="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer">
+    <wsdl:import location="ESBBrokerProcess_Buyer.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
+    <wsdl:import location="ESBBrokerProcess_Broker.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <wsdl:import location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <plnk:partnerLinkType name="BuyerToBrokerLT">
+        <plnk:role name="BrokerRequester" portType="ns1:BrokerBehavior"/>
+        <plnk:role name="BrokerBehavior" portType="ns2:BuyerBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -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 at 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>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgency.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditAgency" targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="checkCreditResponse">
+        <wsdl:part element="CreditCheckOk" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="checkCreditRequest">
+        <wsdl:part element="CreditCheckRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="invalidCreditFault">
+        <wsdl:part element="CreditCheckInvalid" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="CreditAgencyBehavior">
+        <wsdl:operation name="checkCredit">
+            <wsdl:input message="cay:checkCreditRequest">
+            </wsdl:input>
+            <wsdl:output message="cay:checkCreditResponse">
+            </wsdl:output>
+            <wsdl:fault message="cay:invalidCreditFault" name="invalidCredit">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CreditAgencyBehaviorBinding" type="cay:CreditAgencyBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="checkCredit">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/CreditAgency/checkCredit"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="invalidCredit">
+                <soap:fault name="invalidCredit" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CreditAgencyService">
+        <wsdl:port binding="cay:CreditAgencyBehaviorBinding" name="CreditAgencyBehaviorPort">
+            <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgencyArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgencyArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_CreditAgencyArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+    <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+    <wsdl:import location="ESBBrokerProcess_Broker.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+    <wsdl:import location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <plnk:partnerLinkType name="BrokerToCreditAgencyServiceLT">
+        <plnk:role name="CreditAgencyService" portType="ns1:CreditAgencyBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Supplier.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Supplier.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ESBBrokerProcess_Supplier.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="confirmRequest">
+        <wsdl:part element="orderConfirmed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="confirmResponse">
+        <wsdl:part element="bookingReference" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteResponse">
+        <wsdl:part element="quote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteRequest">
+        <wsdl:part element="requestForQuote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="SupplierBehavior">
+        <wsdl:operation name="confirm">
+            <wsdl:input message="spr:confirmRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:confirmResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <wsdl:input message="spr:getQuoteRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:getQuoteResponse">
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SupplierBehaviorBinding" type="spr:SupplierBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="confirm">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SupplierService">
+        <wsdl:port binding="spr:SupplierBehaviorBinding" name="SupplierBehaviorPort">
+            <soap:address location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/LoanApprovalService at Service.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/LoanApprovalService at Service.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/LoanApprovalService at Service.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,123 @@
+<process name="loanApprovalProcess"
+    targetNamespace="http://example.com/loan-approval/"
+    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+    xmlns:lns="http://example.com/loan-approval/wsdl/"
+    suppressJoinFailure="yes">
+    <import importType="http://schemas.xmlsoap.org/wsdl/"
+          location="loanServicePT.wsdl"
+          namespace="http://example.com/loan-approval/wsdl/" />
+    <partnerLinks>
+          <partnerLink name="customer"
+              partnerLinkType="lns:loanPartnerLT"
+              myRole="loanService" />
+          <partnerLink name="approver"
+              partnerLinkType="lns:loanApprovalLT"
+              partnerRole="approver" />
+          <partnerLink name="assessor"
+              partnerLinkType="lns:riskAssessmentLT"
+              partnerRole="assessor" />
+    </partnerLinks>
+    <variables>
+          <variable name="request"
+              messageType="lns:creditInformationMessage" />
+          <variable name="risk"
+              messageType="lns:riskAssessmentMessage" />
+          <variable name="approval"
+              messageType="lns:approvalMessage" />
+    </variables>
+    <faultHandlers>
+          <catch faultName="lns:loanProcessFault"
+              faultVariable="error"
+              faultMessageType="lns:errorMessage">
+              <reply partnerLink="customer"
+                 portType="lns:loanServicePT"
+                 operation="request" variable="error"
+                 faultName="unableToHandleRequest" />
+          </catch>
+    </faultHandlers>
+    <flow>
+          <links>
+              <link   name="receive-to-assess" />
+              <link   name="receive-to-approval" />
+              <link   name="approval-to-reply" />
+              <link   name="assess-to-setMessage" />
+              <link   name="setMessage-to-reply" />
+              <link   name="assess-to-approval" />
+          </links>
+          <receive partnerLink="customer"
+              portType="lns:loanServicePT"
+              operation="request"
+              variable="request"
+              createInstance="yes">
+              <sources>
+                 <source linkName="receive-to-assess">
+                      <transitionCondition>
+                          $request.amount &lt; 10000
+                      </transitionCondition>
+                 </source>
+                 <source linkName="receive-to-approval">
+                      <transitionCondition>
+                          $request.amount >= 10000
+                      </transitionCondition>
+                 </source>
+              </sources>
+          </receive>
+          <invoke partnerLink="assessor"
+              portType="lns:riskAssessmentPT"
+              operation="check"
+              inputVariable="request"
+              outputVariable="risk">
+              <targets>
+                 <target linkName="receive-to-assess" />
+              </targets>
+              <sources>
+                 <source linkName="assess-to-setMessage">
+                      <transitionCondition>
+                          $risk.level='low'
+                      </transitionCondition>
+                 </source>
+                 <source linkName="assess-to-approval">
+                      <transitionCondition>
+                          $risk.level!='low'
+                      </transitionCondition>
+                 </source>
+              </sources>
+          </invoke>
+          <assign>
+              <targets>
+                 <target linkName="assess-to-setMessage" />
+              </targets>
+              <sources>
+                 <source linkName="setMessage-to-reply" />
+	         </sources>
+         <copy>
+            <from>
+               <literal>yes</literal>
+            </from>
+            <to variable="approval" part="accept" />
+         </copy>
+      </assign>
+      <invoke partnerLink="approver"
+         portType="lns:loanApprovalPT"
+         operation="approve"
+         inputVariable="request"
+         outputVariable="approval">
+         <targets>
+            <target linkName="receive-to-approval" />
+            <target linkName="assess-to-approval" />
+         </targets>
+         <sources>
+            <source linkName="approval-to-reply" />
+         </sources>
+      </invoke>
+      <reply partnerLink="customer"
+         portType="lns:loanServicePT"
+         operation="request"
+         variable="approval">
+         <targets>
+            <target linkName="setMessage-to-reply" />
+            <target linkName="approval-to-reply" />
+         </targets>
+      </reply>
+   </flow>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,24 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Buyer" name="PurchaseGoodsProcess_Buyer" targetNamespace="http://www.jboss.org/savara/examples" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_BuyerArtifacts.wsdl" namespace="http://www.jboss.org/savara/examples"/>
+    <partnerLinks>
+        <partnerLink name="BuyerToStore" partnerLinkType="tns:BuyerToStoreLT" partnerRole="StoreRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="sto:buyResponse" name="buyResponseVar"/>
+    </variables>
+    <sequence>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="sto:BuyFailedFault" faultName="sto:BuyFailed" faultVariable="BuyFailedFaultVar">
+                    <sequence/>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="buyRequestVar" name="Send_BuyRequest" operation="buy" outputVariable="buyResponseVar" partnerLink="BuyerToStore" portType="sto:StoreInterface"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_BuyerArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_BuyerArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_BuyerArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.jboss.org/examples/store" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.jboss.org/savara/examples">
+    <wsdl:import location="PurchaseGoodsProcess_Buyer.wsdl" namespace="http://www.jboss.org/savara/examples"/>
+    <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <wsdl:import location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <plnk:partnerLinkType name="BuyerToStoreLT">
+        <plnk:role name="StoreRequester" portType="ns1:StoreInterface"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,26 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Common at CreditAgency" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="java:org.jboss.savara.examples.purchasing" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <partnerLinks>
+        <partnerLink myRole="CreditAgencyInterface" name="StoreToCreditAgency" partnerLinkType="pur:StoreToCreditAgencyServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="pur:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="pur:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="pur:CreditCheckFailedFault" name="CreditCheckFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="checkCreditRequestVar"/>
+        <if>
+            <sequence>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="checkCreditResponseVar"/>
+            </sequence>
+            <else>
+                <sequence>
+                    <reply faultName="pur:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface" variable="CreditCheckFailedFaultVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgency.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditAgency" targetNamespace="java:org.jboss.savara.examples.purchasing">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="checkCreditRequest">
+        <wsdl:part name="content" type="pur:CreditCheckRequest">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="CreditCheckFailedFault">
+        <wsdl:part name="content" type="pur:CreditCheckInvalid">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="checkCreditResponse">
+        <wsdl:part name="content" type="pur:CreditCheckOk">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="CreditAgencyInterface">
+        <wsdl:operation name="checkCredit">
+            <wsdl:input message="pur:checkCreditRequest">
+            </wsdl:input>
+            <wsdl:output message="pur:checkCreditResponse">
+            </wsdl:output>
+            <wsdl:fault message="pur:CreditCheckFailedFault" name="CreditCheckFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CreditAgencyInterfaceBinding" type="pur:CreditAgencyInterface">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="checkCredit">
+            <soap:operation soapAction="java:org.jboss.savara.examples.purchasing/checkCredit"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="CreditCheckFailed">
+                <soap:fault name="CreditCheckFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CreditAgencyService">
+        <wsdl:port binding="pur:CreditAgencyInterfaceBinding" name="CreditAgencyInterfacePort">
+            <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyInterfacePort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="java:org.jboss.savara.examples.purchasing" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="java:org.jboss.savara.examples.purchasing">
+    <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <wsdl:import location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <plnk:partnerLinkType name="StoreToCreditAgencyServiceLT">
+        <plnk:role name="CreditAgencyInterface" portType="ns1:CreditAgencyInterface"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Store" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <partnerLinks>
+        <partnerLink myRole="StoreInterface" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+        <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="pur:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="pur:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="sto:buyResponse" name="buyResponseVar"/>
+        <variable messageType="sto:BuyFailedFault" name="BuyFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyRequestVar"/>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="pur:CreditCheckFailedFault" faultName="pur:CreditCheckFailed" faultVariable="CreditCheckFailedFaultVar">
+                    <sequence>
+                        <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="BuyFailedFaultVar"/>
+                    </sequence>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="StoreToCreditAgency" portType="pur:CreditAgencyInterface"/>
+                <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyResponseVar"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_Store.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Store" targetNamespace="http://www.jboss.org/examples/store">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="BuyFailedFault">
+        <wsdl:part name="content" type="sto:BuyFailed">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyRequest">
+        <wsdl:part name="content" type="sto:BuyRequest">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyResponse">
+        <wsdl:part name="content" type="sto:BuyConfirmed">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="StoreInterface">
+        <wsdl:operation name="buy">
+            <wsdl:input message="sto:buyRequest">
+            </wsdl:input>
+            <wsdl:output message="sto:buyResponse">
+            </wsdl:output>
+            <wsdl:fault message="sto:BuyFailedFault" name="BuyFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="StoreInterfaceBinding" type="sto:StoreInterface">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="buy">
+            <soap:operation soapAction="http://www.jboss.org/examples/store/buy"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="BuyFailed">
+                <soap:fault name="BuyFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="StoreService">
+        <wsdl:port binding="sto:StoreInterfaceBinding" name="StoreInterfacePort">
+            <soap:address location="http://localhost:8080/StoreService/StoreInterfacePort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_StoreArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_StoreArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/PurchaseGoodsProcess_StoreArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.jboss.org/examples/store" xmlns:ns2="java:org.jboss.savara.examples.purchasing" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.jboss.org/examples/store">
+    <wsdl:import location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
+    <plnk:partnerLinkType name="BuyerToStoreServiceLT">
+        <plnk:role name="StoreInterface" portType="ns1:StoreInterface"/>
+    </plnk:partnerLinkType>
+    <plnk:partnerLinkType name="StoreToCreditAgencyLT">
+        <plnk:role name="CreditAgencyRequester" portType="ns2:CreditAgencyInterface"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Buyer.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Buyer.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Buyer.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:tns="http://www.pi4soa.org/ReqRespFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="overlord.cdl.samples.LoanBroker at Buyer" name="ReqRespFaultProcess_Buyer" targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_BuyerArtifacts.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+    <partnerLinks>
+        <partnerLink name="BuyerToSeller" partnerLinkType="byr:BuyerToSellerLT" partnerRole="SellerRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="slr:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="slr:checkCreditResponse" name="checkCreditResponseVar"/>
+    </variables>
+    <sequence>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="slr:insufficientCreditFault" faultName="slr:insufficientCredit" faultVariable="insufficientCreditFaultVar">
+                    <sequence/>
+                </catch>
+            </faultHandlers>
+            <sequence>
+                <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="BuyerToSeller" portType="slr:SellerBehavior"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_BuyerArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_BuyerArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_BuyerArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer">
+    <wsdl:import location="ReqRespFaultProcess_Buyer.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+    <wsdl:import location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <plnk:partnerLinkType name="BuyerToSellerLT">
+        <plnk:role name="SellerRequester" portType="ns1:SellerBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,25 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:tns="http://www.pi4soa.org/ReqRespFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="org.pi4soa.reqrespfault.reqrespfault.ReqRespFaultProcess at Seller" name="ReqRespFaultProcess_Seller" targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_SellerArtifacts.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <partnerLinks>
+        <partnerLink myRole="SellerBehavior" name="BuyerToSeller" partnerLinkType="slr:BuyerToSellerServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="slr:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="slr:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="slr:insufficientCreditFault" name="insufficientCreditFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="checkCreditRequestVar"/>
+        <if>
+            <sequence>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="checkCreditResponseVar"/>
+            </sequence>
+            <else>
+                <sequence>
+                    <reply faultName="slr:insufficientCredit" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="BuyerToSeller" portType="slr:SellerBehavior" variable="insufficientCreditFaultVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_Seller.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.pi4soa.org/ReqRespFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Seller" targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="checkCreditRequest">
+        <wsdl:part element="CreditCheckRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="checkCreditResponse">
+        <wsdl:part element="CreditCheckOk" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="insufficientCreditFault">
+        <wsdl:part element="CreditCheckInvalid" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="SellerBehavior">
+        <wsdl:operation name="checkCredit">
+            <wsdl:input message="slr:checkCreditRequest">
+            </wsdl:input>
+            <wsdl:output message="slr:checkCreditResponse">
+            </wsdl:output>
+            <wsdl:fault message="slr:insufficientCreditFault" name="insufficientCredit">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SellerBehaviorBinding" type="slr:SellerBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="checkCredit">
+            <soap:operation soapAction="http://www.pi4soa.org/ReqRespFault/Seller/checkCredit"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="insufficientCredit">
+                <soap:fault name="insufficientCredit" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SellerService">
+        <wsdl:port binding="slr:SellerBehaviorBinding" name="SellerBehaviorPort">
+            <soap:address location="http://localhost:8080/SellerService/SellerBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_SellerArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_SellerArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/ReqRespFaultProcess_SellerArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller">
+    <wsdl:import location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+    <plnk:partnerLinkType name="BuyerToSellerServiceLT">
+        <plnk:role name="SellerBehavior" portType="ns1:SellerBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.bpel
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.bpel	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,15 @@
+<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.LoanBroker at SupplierQuoteEngine" name="RequestForQuote_SupplierQuoteEngine" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngine.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngineArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <partnerLinks>
+        <partnerLink myRole="SupplierBehavior" name="BrokerToSupplierQuoteEngine" partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="spr:getQuoteRequest" name="getQuoteRequestVar"/>
+        <variable messageType="spr:getQuoteResponse" name="getQuoteResponseVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_requestForQuote" operation="getQuote" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior" variable="getQuoteRequestVar"/>
+        <reply name="Send_quote" operation="getQuote" partnerLink="BrokerToSupplierQuoteEngine" portType="spr:SupplierBehavior" variable="getQuoteResponseVar"/>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngine.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema"/>
+    </types>
+    <wsdl:message name="confirmRequest">
+        <wsdl:part element="orderConfirmed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="confirmResponse">
+        <wsdl:part element="bookingReference" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteResponse">
+        <wsdl:part element="quote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getQuoteRequest">
+        <wsdl:part element="requestForQuote" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="SupplierBehavior">
+        <wsdl:operation name="confirm">
+            <wsdl:input message="spr:confirmRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:confirmResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <wsdl:input message="spr:getQuoteRequest">
+            </wsdl:input>
+            <wsdl:output message="spr:getQuoteResponse">
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SupplierBehaviorBinding" type="spr:SupplierBehavior">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="confirm">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap:operation soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SupplierService">
+        <wsdl:port binding="spr:SupplierBehaviorBinding" name="SupplierBehaviorPort">
+            <soap:address location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/parser/testmodels/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+    <wsdl:import location="RequestForQuote_SupplierQuoteEngine.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+    <plnk:partnerLinkType name="BrokerToSupplierQuoteEngineServiceLT">
+        <plnk:role name="SupplierBehavior" portType="ns1:SupplierBehavior"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/AllTests.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/AllTests.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/AllTests.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,69 @@
+/*
+ * 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.tools.bpel.tests;
+
+import org.savara.tools.bpel.generator.GeneratorTest.ChoreographyToBPELTester;
+import org.scribble.model.SubDefinitionPath;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite();
+		
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "Broker"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", "CreditAgency"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker",
+        				new SubDefinitionPath(new String[]{"CompleteTransaction"}),
+        								"SupplierTxnProcessor"));
+        suite.addTest(new ChoreographyToBPELTester("ESBBroker", 
+						new SubDefinitionPath(new String[]{"RequestForQuote"}),
+										"SupplierQuoteEngine"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "CreditAgency"));
+        suite.addTest(new ChoreographyToBPELTester("PurchaseGoods", "Store"));
+        suite.addTest(new ChoreographyToBPELTester("ReqRespFault", "Buyer"));
+        suite.addTest(new ChoreographyToBPELTester("ReqRespFault", "Seller"));
+
+        /* SAVARA-151 - need to uncomment tests and find a way to run from Tycho
+         * 
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_Broker", "ESBBroker at Broker"));
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_Buyer", "ESBBroker at Buyer"));
+        suite.addTest(new BPELToConversationTest("ESBBrokerProcess_CreditAgency", "ESBBroker at CreditAgency"));
+        suite.addTest(new BPELToConversationTest("RequestForQuote_SupplierQuoteEngine", "ESBBroker at SupplierQuoteEngine"));
+        suite.addTest(new BPELToConversationTest("CompleteTransaction_SupplierTxnProcessor", "ESBBroker at SupplierTxnProcessor"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_Buyer", "PurchaseGoods at Buyer"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_CreditAgency", "PurchaseGoods at CreditAgency"));
+        suite.addTest(new BPELToConversationTest("PurchaseGoodsProcess_Store", "PurchaseGoods at Store"));
+        suite.addTest(new BPELToConversationTest("ReqRespFaultProcess_Buyer", "ReqRespFault at Buyer"));
+        suite.addTest(new BPELToConversationTest("ReqRespFaultProcess_Seller", "ReqRespFault at Seller"));
+        */
+        
+        /**
+         * TODO: (SAVARA-150) Commenting out this test for now, as we now need the accompanying WSDL to be able to
+         * resolve the message type's underlying XSD element or type.
+         *
+        suite.addTest(new BPELToConversationTest("LoanApprovalService at Service", "LoanApprovalService at Service"));
+         */
+        
+        return suite;
+	}
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/osgi/Activator.java	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/org.savara.tools.bpel.tests/src/java/org/savara/tools/bpel/tests/osgi/Activator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,22 @@
+package org.savara.tools.bpel.tests.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: branches/experimental/2.0.x/tools/tests/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/tests/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/tools/tests/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.tools</groupId>
+	<artifactId>tests</artifactId>
+	<packaging>pom</packaging>
+	<version>2.0.0-SNAPSHOT</version>
+	<name>Savara::Tools::Tests</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>tools</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+	<modules>
+		<module>org.savara.protocol.contract.tests</module>
+		<!-- module>org.savara.tools.bpel.tests</module -->
+	</modules>
+	
+</project>
+

Added: branches/experimental/2.0.x/validators/jboss/common/pom.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,132 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.validators</groupId>
+	<artifactId>savara-validator-jboss</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Validators::JBoss::Common</name>
+	
+	<parent>
+		<groupId>org.savara.validators</groupId>
+		<artifactId>jboss</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+		<dependencies>	
+			<dependency>
+				<groupId>log4j</groupId>
+				<artifactId>log4j</artifactId>
+	    		<version>${log4j.version}</version>
+				<scope>provided</scope>
+			</dependency>
+			<dependency>
+				<groupId>junit</groupId>
+				<artifactId>junit</artifactId>
+            	<version>${junit.version}</version>
+				<scope>test</scope>
+			</dependency>
+			<dependency>
+    			<groupId>org.pi4soa</groupId>
+               	<artifactId>org.pi4soa.common</artifactId>
+               	<version>${pi4soa.version}</version>
+          	</dependency>
+			<dependency>
+    			<groupId>org.pi4soa</groupId>
+               	<artifactId>org.pi4soa.cdl</artifactId>
+               	<version>${pi4soa.version}</version>
+          	</dependency>
+			<dependency>
+    			<groupId>org.pi4soa</groupId>
+               	<artifactId>org.pi4soa.service</artifactId>
+               	<version>${pi4soa.version}</version>
+          	</dependency>
+
+			<dependency>
+    			<groupId>org.jboss.savara.dependencies.eclipse</groupId>
+               	<artifactId>emf-common</artifactId>
+				<version>2.3.0</version>
+          	</dependency>
+			<dependency>
+    			<groupId>org.jboss.savara.dependencies.eclipse</groupId>
+               	<artifactId>emf-ecore</artifactId>
+				<version>2.3.1</version>
+          	</dependency>
+			<dependency>
+    			<groupId>org.jboss.savara.dependencies.eclipse</groupId>
+               	<artifactId>emf-ecore-xmi</artifactId>
+				<version>2.3.1</version>
+          	</dependency>
+		    <dependency>
+			  <groupId>org.jboss.jbossas</groupId>
+			  <artifactId>jboss-as-client</artifactId>
+		      <version>${jboss.version}</version>
+			  <type>pom</type>
+			  <scope>provided</scope>
+			</dependency>
+		</dependencies>
+	
+	<build>
+		<plugins>
+		  <plugin>
+	        <artifactId>maven-assembly-plugin</artifactId>
+	        <executions>
+	          <execution>
+	            <id>dist</id>
+	            <phase>package</phase>
+	            <goals>
+	              <goal>single</goal>
+	            </goals>
+	            <configuration>
+	              <finalName>savara-validator-jboss.sar</finalName>
+	              <appendAssemblyId>true</appendAssemblyId>
+	              <descriptors>
+	                <descriptor>src/main/configs/common-assembly.xml</descriptor>
+	              </descriptors>
+	            </configuration>
+	          </execution>
+	        </executions>
+	      </plugin>
+		  <plugin>
+			<artifactId>maven-javadoc-plugin</artifactId>
+			<executions>
+			  <execution>
+			    <id>generate-javadoc</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>jar</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<configuration>
+			  <doclet>org.jboss.apiviz.APIviz</doclet>
+			  <docletArtifact>
+			    <groupId>org.jboss.apiviz</groupId>
+			    <artifactId>apiviz</artifactId>
+			    <version>1.2.4.GA</version>
+			  </docletArtifact>
+			  <aggregate>true</aggregate>
+			  <attach>false</attach>
+			  <additionalparam>
+			    -d ${project.build.directory}/javadoc
+			    -charset UTF-8
+			    -docencoding UTF-8
+			    -version
+			    -author
+			    -breakiterator
+			    -windowtitle "${project.name} ${project.version} API Reference"
+			    -doctitle "${project.name} ${project.version} API Reference"
+			    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+			    -link http://java.sun.com/javase/6/docs/api/
+			    -sourceclasspath ${project.build.outputDirectory}
+			  </additionalparam>
+			  <encoding>UTF-8</encoding>
+			  <locale>en_US</locale>
+			</configuration>
+		   </plugin>
+	    </plugins>
+	</build>
+	
+</project>
+

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jbm-queue-service.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jbm-queue-service.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jbm-queue-service.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+    <mbean code="org.jboss.jms.server.destination.TopicService"
+           name="jboss.messaging.destination:service=Topic,name=tracker"
+           xmbean-dd="xmdesc/Topic-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+</server>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-beans.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-beans.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-beans.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean class="org.savara.validator.service.ServiceValidatorService"
+        				name="ServiceValidator">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.savara:service=ServiceValidatorManager", exposedInterface=org.savara.validator.service.ServiceValidatorServiceMBean.class,registerDirectly=true)</annotation>
+    <property name="jndiName"><value>savara/ServiceValidatorManager</value></property>
+    <depends>jboss:service=Naming</depends>
+    <depends>jboss.messaging.destination:service=Topic,name=tracker</depends>
+  </bean>
+
+</deployment>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-scanning.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-scanning.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-scanning.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+	<!-- prevent scanning for annotations -->
+</scanning>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-structure.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-structure.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/META-INF/jboss-structure.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<structure>
+    <context>
+        <path name=""/>
+        <metaDataPath>
+            <path name="META-INF"/>
+        </metaDataPath>        
+        <classpath>
+            <path name=""/>
+            <path name="" suffixes=".jar" />
+            <path name="lib" suffixes=".jar" />
+        </classpath>
+    </context>
+</structure>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/common-assembly.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/common-assembly.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/common-assembly.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,33 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+  <id>dist</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>src/main/configs</directory>
+      <outputDirectory>/</outputDirectory>
+      <excludes>
+        <exclude>common-assembly.xml</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
+  
+     <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+            <includes>
+               <include>org.savara.validators:savara-validator-jboss</include>
+               <include>org.pi4soa:org.pi4soa.common</include>
+               <include>org.pi4soa:org.pi4soa.cdl</include>
+               <include>org.pi4soa:org.pi4soa.service</include>
+               <include>org.jboss.savara.dependencies.eclipse:emf-common</include>
+               <include>org.jboss.savara.dependencies.eclipse:emf-ecore</include>
+               <include>org.jboss.savara.dependencies.eclipse:emf-ecore-xmi</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+  
+</assembly>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PurchaseGoods" name="PurchaseGoods" author="gary" version="0.1" targetNamespace="http://www.jboss.org/savara/examples">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+    <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+    <informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="" elementName="sto:BuyConfirmed"/>
+    <informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="" elementName="sto:BuyFailed"/>
+    <informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="" elementName="sto:BuyRequest"/>
+    <informationTypes description="This is the information type CreditCheckInvalid" name="CreditCheckInvalid" typeName="" elementName="ca:CreditCheckInvalid"/>
+    <informationTypes description="This is the information type CreditCheckOk" name="CreditCheckOk" typeName="" elementName="ca:CreditCheckOk"/>
+    <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" typeName="" elementName="ca:CreditCheckRequest"/>
+    <informationTypes description="This is the information type IDType" name="IDType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URITokenType" name="URITokenType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token ID" name="ID" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator BuyFailedIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.1" query="//@id" name="BuyFailedIDLocator"/>
+    <tokenLocators description="This is the token locator BuyRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//@id" name="BuyRequestIDLocator"/>
+    <tokenLocators description="This is the token locator BuyResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.0" query="//@id" name="BuyResponseIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckInvalidIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//@id" name="CreditCheckInvalidIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@id" name="CreditCheckRequestIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.4" query="//@id" name="CreditCheckResponseIDLocator"/>
+    <roleTypes description="This is the role type Buyer" name="Buyer">
+      <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="ca:CreditAgencyInterface"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Store" name="Store">
+      <behaviors description="This is the behavior StoreBehavior" name="StoreBehavior" interface="sto:StoreInterface"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Buyer and Store" name="BuyerToStoreRel" firstRoleType="//@typeDefinitions/@roleTypes.0" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between Store and CreditAgency" name="StoreToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type Buyer" name="Buyer" roleTypes="//@typeDefinitions/@roleTypes.0">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Buyer" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type ca:CreditAgency" name="ca:CreditAgency" roleTypes="//@typeDefinitions/@roleTypes.1">
+      <semanticAnnotations annotation="savara.samples.Common at CreditAgency" name="conversationType"/>
+    </participantTypes>
+    <participantTypes description="This is the participant type sto:Store" name="sto:Store" roleTypes="//@typeDefinitions/@roleTypes.2">
+      <semanticAnnotations annotation="savara.samples.Purchasing at Store" name="conversationType"/>
+    </participantTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type StoreChannelType" name="StoreChannelType" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.2">
+      <identities description="ID" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the PurchaseGoods process" name="PurchaseGoodsProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.0"/>
+    <variableDefinitions name="CreditCheckVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/@channelTypes.1"/>
+    <variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/@informationTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/@informationTypes.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.5" receiveVariable="//@choreographies.0/@variableDefinitions.1">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" name="CreditValid" expression="cdl:getVariable('CreditCheckVar','','//@amount','CreditAgency') &lt; 250">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/@informationTypes.4" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/@informationTypes.0" action="Respond">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond" faultName="CreditCheckFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAgencyService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" faultName="BuyFailed">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/TrailBlazer.cdm
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/TrailBlazer.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/models/TrailBlazer.cdm	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for TrailBlazer" name="TrailBlazer" author="gary" version="0.1" targetNamespace="http://www.pi4soa.org/TrailBlazer">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for TrailBlazer" prefix="tns" uRI="http://www.pi4soa.org/TrailBlazer"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <informationTypes description="This is the information type CreditCheckReq" name="CreditCheckReq" elementName="creditCheck"/>
+    <informationTypes description="This is the information type CreditCheckResp" name="CreditCheckResp" elementName="creditCheckResult"/>
+    <informationTypes description="This is the information type InsufficientCredit" name="InsufficientCredit" elementName="insufficientCredit"/>
+    <informationTypes description="This is the information type Quote" name="Quote" elementName="quote"/>
+    <informationTypes description="This is the information type QuoteRefType" name="QuoteRefType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type QuoteReq" name="QuoteReq" elementName="quoteRequest"/>
+    <informationTypes description="This is the information type SSNType" name="SSNType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type URIType" name="URIType" typeName="xsd:anyURI"/>
+    <tokens description="This is the token QuoteRef" name="QuoteRef" informationType="//@typeDefinitions/@informationTypes.4"/>
+    <tokens description="This is the token SSN" name="SSN" informationType="//@typeDefinitions/@informationTypes.6"/>
+    <tokens description="This is the token URI" name="URI" informationType="//@typeDefinitions/@informationTypes.7"/>
+    <tokenLocators description="This is the token locator QuoteRef4InsufficientCredit" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//ref/text()" name="QuoteRef4InsufficientCredit"/>
+    <tokenLocators description="This is the token locator QuoteRef4Quote" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//ref/text()" name="QuoteRef4Quote"/>
+    <tokenLocators description="This is the token locator QuoteRef4QuoteReq" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//@ref" name="QuoteRef4QuoteReq"/>
+    <tokenLocators description="This is the token locator SSN4CreditCheckReq" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.0" query="//@ssn" name="SSN4CreditCheckReq"/>
+    <tokenLocators description="This is the token locator SSN4CreditCheckResp" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.1" query="//@ssn" name="SSN4CreditCheckResp"/>
+    <tokenLocators description="This is the token locator SSN4InsufficientCredit" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.2" query="//customerUID/text()" name="SSN4InsufficientCredit"/>
+    <tokenLocators description="This is the token locator SSN4Quote" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.3" query="//customerUID/text()" name="SSN4Quote"/>
+    <tokenLocators description="This is the token locator SSN4QuoteReq" token="//@typeDefinitions/@tokens.1" informationType="//@typeDefinitions/@informationTypes.5" query="//@ssn" name="SSN4QuoteReq"/>
+    <roleTypes description="This is the role type Bank" name="Bank">
+      <behaviors description="This is the behavior BankBehavior" name="BankBehavior" interface="bank"/>
+    </roleTypes>
+    <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+      <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="creditAgency"/>
+    </roleTypes>
+    <roleTypes description="This is the role type LoanBroker" name="LoanBroker">
+      <behaviors description="This is the behavior LoanBrokerBehavior" name="LoanBrokerBehavior" interface="loanBroker"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Notifier" name="Notifier">
+      <behaviors description="This is the behavior NotifierBehavior" name="NotifierBehavior" interface="notifier"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between LoanBroker and Bank" name="LoanBrokerToBankRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.0"/>
+    <relationshipTypes description="Relationship between LoanBroker and CreditAgency" name="LoanBrokerToCreditAgencyRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.1"/>
+    <relationshipTypes description="Relationship between LoanBroker and Notifier" name="LoanBrokerToNotifierRel" firstRoleType="//@typeDefinitions/@roleTypes.2" secondRoleType="//@typeDefinitions/@roleTypes.3"/>
+    <participantTypes description="This is the participant type BankParticipant" name="BankParticipant" roleTypes="//@typeDefinitions/@roleTypes.0"/>
+    <participantTypes description="This is the participant type CreditAgencyParticipant" name="CreditAgencyParticipant" roleTypes="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type LoanBrokerParticipant" name="LoanBrokerParticipant" roleTypes="//@typeDefinitions/@roleTypes.2"/>
+    <participantTypes description="This is the participant type NotifierParticipant" name="NotifierParticipant" roleTypes="//@typeDefinitions/@roleTypes.3"/>
+    <channelTypes description="This is the channel type BankChannelType" name="BankChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.0">
+      <identities description="SSN Id and Quote Ref" tokens="//@typeDefinitions/@tokens.1 //@typeDefinitions/@tokens.0"/>
+      <identities description="SSN Id" type="Association" tokens="//@typeDefinitions/@tokens.1"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.1">
+      <identities description="SSN Id" tokens="//@typeDefinitions/@tokens.1"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type NotifierChannelType" name="NotifierChannelType" referenceToken="//@typeDefinitions/@tokens.2" roleType="//@typeDefinitions/@roleTypes.3">
+      <identities description="SSN Id" type="Association" tokens="//@typeDefinitions/@tokens.1"/>
+      <identities description="SSN Id and Quote Ref" tokens="//@typeDefinitions/@tokens.1 //@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the TrailBlazer process" name="TrailBlazerProcess" root="true">
+    <enclosedChoreographies name="RequestQuote">
+      <variableDefinitions description="Channel to facilitate interaction to Bank" name="BankChannel" type="//@typeDefinitions/@channelTypes.0" roleTypes="//@typeDefinitions/@roleTypes.0 //@typeDefinitions/@roleTypes.2"/>
+      <variableDefinitions description="Channel to facilitate interaction to Notifier" name="NotifierChannel" type="//@typeDefinitions/@channelTypes.2" roleTypes="//@typeDefinitions/@roleTypes.2 //@typeDefinitions/@roleTypes.3"/>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="QuoteRequest" operation="requestQuote" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.0">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction QuoteRequest" name="QuoteRequestRequestExchange" type="//@typeDefinitions/@informationTypes.5">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-jmsBankRequestQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-fileBankRequestQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+        <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction QuoteRequest" name="QuoteRequestRespondExchange" type="//@typeDefinitions/@informationTypes.3" action="Respond">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-jmsBankResponseQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-fileBankResponseQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Interaction" name="NotifyCustomer" operation="notify" channelVariable="//@choreographies.0/@enclosedChoreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.2">
+        <exchangeDetails description="This is the exchange details for the request exchange associated with interaction NotifyCustomer" name="NotifyCustomerRequestExchange" type="//@typeDefinitions/@informationTypes.3">
+          <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-customerNotifier}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+        </exchangeDetails>
+      </activities>
+    </enclosedChoreographies>
+    <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/@channelTypes.1" roleTypes="//@typeDefinitions/@roleTypes.1 //@typeDefinitions/@roleTypes.2"/>
+    <variableDefinitions description="This is the variable NotifierChannel" name="NotifierChannel" type="//@typeDefinitions/@channelTypes.2" roleTypes="//@typeDefinitions/@roleTypes.2 //@typeDefinitions/@roleTypes.3"/>
+    <variableDefinitions description="This is the variable creditCheckResult" name="creditCheckResult" type="//@typeDefinitions/@informationTypes.1" roleTypes="//@typeDefinitions/@roleTypes.2"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/@informationTypes.0">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-creditAgencyQueue}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheck" name="CreditCheckRespondExchange" type="//@typeDefinitions/@informationTypes.1" action="Respond" receiveVariable="//@choreographies.0/@variableDefinitions.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-creditAgencyQueue_reply}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" description="Sufficient credit to request quotes" name="ValidCredit" expression="cdl:getVariable('creditCheckResult','','//@score') >= 4">
+        <activities xsi:type="org.pi4soa.cdl:Parallel">
+          <activities xsi:type="org.pi4soa.cdl:Sequence" description="First quote">
+            <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.0"/>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Sequence" description="Second quote">
+            <activities xsi:type="org.pi4soa.cdl:Perform" choreography="//@choreographies.0/@enclosedChoreographies.0"/>
+          </activities>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Sequence" description="Insufficient credit">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="NotifyCustomer" operation="notify" channelVariable="//@choreographies.0/@variableDefinitions.1" relationship="//@typeDefinitions/@relationshipTypes.2">
+          <exchangeDetails description="This is the exchange details for the request exchange associated with interaction NotifyCustomer" name="NotifyCustomerRequestExchange" type="//@typeDefinitions/@informationTypes.2">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the ESB destination;string;;jms:queue/esb-tb-customerNotifier}}&quot;&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/pi4soa.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/pi4soa.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/pi4soa.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,31 @@
+<!--
+/*
+# * Copyright 2005-8 Pi4 Technologies Ltd
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+# *
+# * Change History:
+# * 16, June 2008: Initial version created by gary
+# */
+-->
+
+<pi4soa>
+	<monitor>
+		<serviceTracker class="org.savara.validator.pi4soa.JMSServiceTracker" >
+			<jmsConnectionFactory>ConnectionFactory</jmsConnectionFactory>
+			<jmsDestination>topic/tracker</jmsDestination>
+			<recordMessagePayload>true</recordMessagePayload>
+		</serviceTracker>
+	</monitor>
+</pi4soa>
\ No newline at end of file

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/configs/validator-config.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/configs/validator-config.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/configs/validator-config.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,2 @@
+<validator mode="monitor" replyToTimeout="10000" >
+</validator>

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/AbstractServiceValidator.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/AbstractServiceValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/AbstractServiceValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,70 @@
+/*
+ * 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.validator;
+
+/**
+ * Abstract base class representing the ServiceValidator.
+ */
+public abstract class AbstractServiceValidator implements ServiceValidator {
+
+	private static final String MODELS_PATH = "models/";
+
+	/**
+	 * This is the constructor for the abstract
+	 * service validator, initialised with the validator
+	 * name.
+	 * 
+	 * @param name The validator name
+	 */
+	public AbstractServiceValidator(ValidatorName name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the validator name.
+	 * 
+	 * @return The validator name
+	 */
+	public ValidatorName getValidatorName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method returns the input stream associated
+	 * with the model. Once the input stream has been
+	 * used, it is the caller's responsibility to close
+	 * the stream.
+	 * 
+	 * @return The model's input stream, or null if
+	 * 				not found
+	 */
+	protected java.io.InputStream getModel() {
+		String filePath=MODELS_PATH+getValidatorName().getModelName();
+		
+		java.io.InputStream ret = AbstractServiceValidator.class.
+				getClassLoader().getResourceAsStream(filePath);
+		
+		return(ret);
+	}
+	
+	public String toString() {
+		return("ServiceValidator["+getValidatorName()+"]");
+	}
+	
+	private ValidatorName m_name=null;
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/DefaultValidatorConfig.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/DefaultValidatorConfig.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/DefaultValidatorConfig.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,61 @@
+/*
+ * 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.validator;
+
+/**
+ * This class represents a default configuration that will be used for
+ * validation against a stream of ESB based messages.
+ */
+public class DefaultValidatorConfig implements ValidatorConfig {
+
+	/**
+	 * This is the constructor for the default validator model.
+	 * 
+	 * @param modeType The model type
+	 * @param config The configuration
+	 */
+	public DefaultValidatorConfig(String modelType, org.w3c.dom.Element config) {
+		m_modelType = modelType;
+		m_configuration = config;
+	}
+	
+	/**
+	 * This method returns the type of the model associated
+	 * with this validator configuration. This will
+	 * general be based on the file extension of the model
+	 * file.
+	 * 
+	 * @return The model type
+	 */
+	public String getModelType() {
+		return(m_modelType);
+	}
+	
+	/**
+	 * This method returns the validator configuration
+	 * associated with the model.
+	 * 
+	 * @return The validator model
+	 */
+	public org.w3c.dom.Element getConfiguration() {
+		return(m_configuration);
+	}
+	
+	private String m_modelType=null;
+	private org.w3c.dom.Element m_configuration=null;
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/Endpoint.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/Endpoint.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/Endpoint.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,87 @@
+/*
+ * 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.validator;
+
+/**
+ * This class represents an endpoint being monitored by one
+ * or more service validator.
+ */
+public class Endpoint {
+
+	/**
+	 * This is the constructor for the endpoint, supplying
+	 * the destination associated with the endpoint.
+	 * 
+	 * @param destination The destination
+	 */
+	public Endpoint(String destination) {
+		m_destination = destination;
+	}
+	
+	/**
+	 * This method returns the destination for the endpoint.
+	 * 
+	 * @return The destination
+	 */
+	public String getDestination() {
+		return(m_destination);
+	}
+	
+	/**
+	 * This method returns the list of service validators
+	 * associated with this endpoint.
+	 * 
+	 * @return The list of service validators for this endpoint
+	 */
+	public java.util.List<ServiceValidator> getServiceValidators() {
+		return(m_validators);
+	}
+	
+	public boolean equals(Object obj) {
+		boolean ret=false;
+		
+		if (obj instanceof Endpoint) {
+			Endpoint ep=(Endpoint)obj;
+			
+			if (ep.getDestination() != null &&
+					ep.getDestination().equals(m_destination)) {
+				ret = true;
+			}
+		}
+		
+		return(ret);
+	}
+	
+	public int hashCode() {
+		int ret=0;
+		
+		if (m_destination != null) {
+			ret = m_destination.hashCode();
+		}
+		
+		return(ret);
+	}
+	
+	public String toString() {
+		return("Endpoint["+m_destination+"]");
+	}
+	
+	private String m_destination=null;
+	private java.util.List<ServiceValidator> m_validators=
+					new java.util.Vector<ServiceValidator>();
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidator.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,68 @@
+/*
+ * 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.validator;
+
+/**
+ * This interface represents a service validator responsible for
+ * validing a stream of ESB messages against a model.
+ */
+public interface ServiceValidator {
+
+	/**
+	 * This method returns the validator name.
+	 * 
+	 * @return The validator name
+	 */
+	public ValidatorName getValidatorName();
+	
+	/**
+	 * This method processes a sent message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process sent message 
+	 */
+	public void messageSent(String mesgType, java.io.Serializable msg) throws Exception;
+	
+	/**
+	 * This method processes a received message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process received message 
+	 */
+	public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception;
+	
+	/**
+	 * This method is called to update the model associated
+	 * with the service validator.
+	 * 
+	 * @throws Exception Failed to update the service validator
+	 */
+	public void update() throws Exception;
+
+	/**
+	 * This method closes the service validator.
+	 * 
+	 * @throws Exception Failed to close the service validator
+	 */
+	public void close() throws Exception;
+	
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorFactory.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,71 @@
+/*
+ * 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.validator;
+
+import java.lang.reflect.Constructor;
+import org.apache.log4j.Logger;
+
+/**
+ * This class provides a factory for Service Validators.
+ */
+public class ServiceValidatorFactory {
+
+	/**
+	 * This method returns the Service Validator appropriate
+	 * for the supplied validator name.
+	 * 
+	 * @param name The validator name
+	 * @return The service validator
+	 * @exception IOException Failed to create the service validator
+	 */
+	public static ServiceValidator getServiceValidator(ValidatorName name)
+							throws Exception {
+		ServiceValidator ret=null;
+		
+		String modelType=name.getModelType();
+		
+		if (modelType != null &&
+				m_validatorClasses.containsKey(modelType)) {
+			Class<?> cls=m_validatorClasses.get(modelType);
+
+			Constructor<?> con=cls.getConstructor(
+					new Class[]{ValidatorName.class});
+			
+			ret = (ServiceValidator)con.newInstance(new Object[]{name});
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Returning service validator for "+
+							name+": "+ret);
+		}
+
+		return(ret);		
+	}
+	
+	private static final Logger logger = Logger.getLogger(ServiceValidatorFactory.class);
+
+	private static java.util.Map<String,Class<?>> m_validatorClasses=
+					new java.util.HashMap<String,Class<?>>();
+	
+	static {
+		m_validatorClasses.put(org.savara.validator.pi4soa.Pi4SOAServiceRecorder.getModelType(),
+				org.savara.validator.pi4soa.Pi4SOAServiceRecorder.class);
+		m_validatorClasses.put(org.savara.validator.pi4soa.Pi4SOAServiceValidator.getModelType(),
+				org.savara.validator.pi4soa.Pi4SOAServiceValidator.class);
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorManager.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorManager.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ServiceValidatorManager.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,972 @@
+/*
+ * 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.validator;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is responsible for managing the active
+ * service validators, the mapping of endpoints to the service
+ * validators and updating the configuration when changes
+ * are detected.
+ */
+public class ServiceValidatorManager {
+
+	/**
+	 * Default constructor for the service validator manager.
+	 */
+	public ServiceValidatorManager() {
+		initialize();
+	}
+	
+	/**
+	 * This method initializes the service validator manager on
+	 * startup.
+	 */
+	protected void initialize() {
+		
+		java.net.URL url=
+			ServiceValidatorManager.class.getClassLoader().getResource(CONFIG_FILE);
+		
+		if (url != null) {
+			m_validatorConfigFile = new java.io.File(url.getFile());
+			
+			java.io.File[] files=m_validatorConfigFile.getParentFile().listFiles();
+			
+			for (int i=0; m_modelsDir == null && i < files.length; i++) {
+				if (files[i].getName().equals("models") &&
+						files[i].isDirectory()) {
+					m_modelsDir = files[i];
+				}
+			}
+			
+			if (m_modelsDir != null) {
+				ValidatorConfigChangeMonitor mon=
+					new ValidatorConfigChangeMonitor();
+				
+				new Thread(mon).start();
+			}
+		}
+	}
+	
+	/**
+	 * This method closes the service validation manager.
+	 */
+	public void close() {
+	}
+	
+	/**
+	 * This method returns the list of service validators associated
+	 * with the supplied input endpoint.
+	 * 
+	 * @param endpoint The input endpoint
+	 * @return The list of service validators, or null if the endpoint
+	 * 					is unknown
+	 */
+	public java.util.List<ServiceValidator> getInputServiceValidators(Endpoint endpoint) {
+		java.util.List<ServiceValidator> ret=
+					m_inputValidators.get(endpoint);
+		
+		if (ret == null) {
+			ret = m_replyToManager.getInputServiceValidators(endpoint);
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Return input validators '"+endpoint+"': "+ret);
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied endpoint will be
+	 * associated with a dynamic reply-to endpoint.
+	 *  
+	 * @param endpoint The endpoint
+	 * @return Whether the endpoint has a dynamic reply-to
+	 */
+	public boolean isInputDynamicReplyTo(Endpoint endpoint) {
+		boolean ret=m_inputDynaReplyTos.contains(endpoint);
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Is input endpoint '"+endpoint+
+					"' a dynamic reply-to: "+ret);
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the list of service validators associated
+	 * with the supplied output endpoint.
+	 * 
+	 * @param endpoint The output endpoint
+	 * @return The list of service validators, or null if the endpoint
+	 * 					is unknown
+	 */
+	public java.util.List<ServiceValidator> getOutputServiceValidators(Endpoint endpoint) {
+		java.util.List<ServiceValidator> ret=
+					m_outputValidators.get(endpoint);
+
+		if (ret == null) {
+			ret = m_replyToManager.getOutputServiceValidators(endpoint);
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Return output validators '"+endpoint+"': "+ret);
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether the supplied endpoint will be
+	 * associated with a dynamic reply-to endpoint.
+	 *  
+	 * @param endpoint The endpoint
+	 * @return Whether the endpoint has a dynamic reply-to
+	 */
+	public boolean isOutputDynamicReplyTo(Endpoint endpoint) {
+		boolean ret=m_outputDynaReplyTos.contains(endpoint);
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Is output endpoint '"+endpoint+
+					"' a dynamic reply-to: "+ret);
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method registers a list of service validators against
+	 * a dynamic 'reply-to' endpoint.
+	 * 
+	 * @param endpoint The endpoint
+	 * @param validators The list of service validators
+	 */
+	public void registerInputReplyToValidators(Endpoint endpoint,
+						java.util.List<ServiceValidator> validators) {
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Register input reply-to '"+endpoint+"': "+validators);
+		}
+		
+		m_replyToManager.registerInputDynamicReplyTo(endpoint, validators);
+	}
+	
+	/**
+	 * This method registers a list of service validators against
+	 * a dynamic 'reply-to' endpoint.
+	 * 
+	 * @param endpoint The endpoint
+	 * @param validators The list of service validators
+	 */
+	public void registerOutputReplyToValidators(Endpoint endpoint,
+						java.util.List<ServiceValidator> validators) {
+		if (logger.isDebugEnabled()) {
+			logger.debug("Register output reply-to '"+endpoint+"': "+validators);
+		}
+		
+		m_replyToManager.registerOutputDynamicReplyTo(endpoint, validators);
+	}
+	
+	/**
+	 * This method returns a ServiceValidator associated with the
+	 * supplied validator name.
+	 * 
+	 * @param name The validator name
+	 * @return The service validator
+	 * @throws Exception Failed to create service validator
+	 */
+	public ServiceValidator createServiceValidator(ValidatorName name)
+							throws Exception {
+		ServiceValidator ret=null;
+		
+		synchronized(m_serviceValidators) {
+			ret = m_serviceValidators.get(name);
+			
+			// If does not exist, then create, else update
+			// the existing service validator
+			if (ret == null) {
+				ret = ServiceValidatorFactory.getServiceValidator(name);
+				
+				m_serviceValidators.put(name, ret);
+			} else {
+				
+				// Update the description
+				ret.update();
+			}
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Created Service Validator '"+name+"': "+ret);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method removes the service validator associated with
+	 * the supplied validator name.
+	 * 
+	 * @param name The validator name
+	 * @throws Exception Failed to remove the service validator
+	 */
+	protected void removeServiceValidator(ValidatorName name)
+							throws Exception {
+		synchronized(m_serviceValidators) {
+			ServiceValidator validator=(ServiceValidator)
+					m_serviceValidators.remove(name);
+
+			// Check if validator should be removed from
+			// input/output endpoint mappings
+			java.util.Iterator<Endpoint> iter=m_inputValidators.keySet().iterator();
+			
+			while (iter.hasNext()) {
+				Endpoint ep=iter.next();
+				java.util.List<ServiceValidator> list=
+						m_inputValidators.get(ep);
+				
+				if (list.contains(validator)) {
+					list.remove(validator);
+					
+					if (list.size() == 0) {
+						logger.error("Input validator list, associated with endpoint '"+
+								ep+"' contains no entries after removal of validator '"+
+								name+"' - this Endpoint should have previously been removed");
+					}
+				}
+			}
+			
+			iter=m_outputValidators.keySet().iterator();
+			
+			while (iter.hasNext()) {
+				Endpoint ep=iter.next();
+				java.util.List<ServiceValidator> list=
+						m_outputValidators.get(ep);
+				
+				if (list.contains(validator)) {
+					list.remove(validator);
+					
+					if (list.size() == 0) {
+						logger.error("Output validator list, associated with endpoint '"+
+								ep+"' contains no entries after removal of validator '"+
+								name+"' - this Endpoint should have previously been removed");
+					}
+				}
+			}
+			
+			if (validator != null) {
+				validator.close();
+			}
+		}
+	}
+	
+	/**
+	 * This method returns the set of currently configured
+	 * service validator names.
+	 * 
+	 * @return The set of validator names
+	 */
+	protected java.util.Set<ValidatorName> getServiceValidatorNames() {
+		java.util.Set<ValidatorName> ret=new java.util.HashSet<ValidatorName>();
+		
+		ret.addAll(m_serviceValidators.keySet());
+		
+		return(ret);
+	}
+
+	/**
+	 * This method updates the configuration of the service
+	 * validators and endpoint mappings.
+	 */
+	protected void updateConfigurations() {
+		java.util.Set<ValidatorName> existingValidatorNames=
+					getServiceValidatorNames();
+		
+		java.util.Set<Endpoint> existingInputEndpoints=
+			new java.util.HashSet<Endpoint>(m_inputValidators.keySet());
+
+		java.util.Set<Endpoint> existingOutputEndpoints=
+			new java.util.HashSet<Endpoint>(m_outputValidators.keySet());
+
+		java.util.Set<Endpoint> existingInputDynaReplyTos=
+			new java.util.HashSet<Endpoint>(m_inputDynaReplyTos);
+
+		java.util.Set<Endpoint> existingOutputDynaReplyTos=
+			new java.util.HashSet<Endpoint>(m_outputDynaReplyTos);
+
+		java.io.InputStream is=ServiceValidatorManager.class.getClassLoader().
+					getResourceAsStream(CONFIG_FILE);
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("ValidationFilter: config="+CONFIG_FILE+" is="+is);
+		}
+
+		try {
+			DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+			fact.setNamespaceAware(true);
+
+			DocumentBuilder builder=fact.newDocumentBuilder();
+			org.w3c.dom.Document doc=builder.parse(is);
+			
+			org.w3c.dom.Element config=doc.getDocumentElement();
+			
+			if (config.getNodeName().equals(VALIDATOR_NODE)) {
+				
+				// Old 'active' attribute is now 'mode'
+				String active=config.getAttribute(ACTIVE_ATTR);
+				
+				if (active != null && active.equalsIgnoreCase("true")) {
+					m_managedMode = true;
+				}
+				
+				String mode=config.getAttribute(MODE_ATTR);
+				
+				if (mode != null) {
+					if (mode.equals("manage")) {
+						m_managedMode = true;
+					} else if (mode.equals("monitor")) {
+						m_managedMode = false; // will override active=true
+					} else {
+						logger.error("Unknown mode '"+mode+"' - setting to 'monitor'");
+						m_managedMode = false;
+					}
+				}
+					
+				if (m_managedMode) {
+					logger.debug("Setting validators in 'manage' mode");
+				} else {
+					logger.debug("Setting validators in 'monitor' mode");
+				}
+				
+				// Check for dynamic replyTo endpoint timeout
+				String timeoutValue=config.getAttribute(REPLY_TO_TIMEOUT_ATTR);
+				
+				if (timeoutValue != null) {
+					try {
+						long tv=Long.parseLong(timeoutValue);
+						
+						m_replyToManager.setReplyToTimeout(tv);
+					} catch(Exception e) {
+						logger.error("Unable to set 'reply to' timeout", e);
+					}
+				}
+			}
+			
+			updateConfiguration(config, existingValidatorNames,
+					existingInputEndpoints, existingOutputEndpoints,
+					existingInputDynaReplyTos, existingOutputDynaReplyTos);
+			
+			// Work through choreography files in the models directory
+			java.io.File[] files=m_modelsDir.listFiles();
+			
+			for (int i=0; i < files.length; i++) {
+				
+				// Check if a ValidatorModel exists for the
+				// file
+				try {
+					ValidatorConfig vm=
+						ValidatorConfigFactory.getValidatorConfig(files[i]);
+					
+					if (vm != null) {
+						org.w3c.dom.Element vConfig=vm.getConfiguration();
+						
+						if (vConfig != null) {
+							updateConfiguration(vConfig,
+									existingValidatorNames,
+									existingInputEndpoints,
+									existingOutputEndpoints,
+									existingInputDynaReplyTos,
+									existingOutputDynaReplyTos);
+						} else {
+							logger.error("Failed to obtain configuration for model '"+
+									files[i].getName()+"'");
+						}
+					}
+				} catch(Exception e) {
+					logger.error("Failed to update configuration for model '"+
+							files[i].getName()+"'", e);
+				}
+			}
+			
+			// Any remaining input keys need to be removed
+			java.util.Iterator<Endpoint> iter=
+							existingInputEndpoints.iterator();
+			
+			while (iter.hasNext()) {
+				Endpoint key=iter.next();
+				m_inputValidators.remove(key);
+			}
+			
+			iter = existingInputDynaReplyTos.iterator();
+
+			while (iter.hasNext()) {
+				Endpoint key=iter.next();
+				m_inputDynaReplyTos.remove(key);
+			}
+
+			// Any remaining output keys need to be removed
+			iter = existingOutputEndpoints.iterator();
+			
+			while (iter.hasNext()) {
+				Endpoint key=iter.next();
+				m_outputValidators.remove(key);
+			}
+			
+			iter = existingOutputDynaReplyTos.iterator();
+
+			while (iter.hasNext()) {
+				Endpoint key=iter.next();
+				m_outputDynaReplyTos.remove(key);
+			}
+
+			// Any remaining service description names need to
+			// have their associated monitors removed
+			java.util.Iterator<ValidatorName> sviter=
+				existingValidatorNames.iterator();
+			
+			while (sviter.hasNext()) {
+				ValidatorName svkey=sviter.next();
+				
+				try {
+					logger.debug("Removing service validator: "+svkey);
+					removeServiceValidator(svkey);
+				} catch(Exception e) {
+					logger.error(
+							"Failed to remove service validator: "+svkey, e);
+				}
+			}
+		} catch(Exception e) {		
+			logger.error("Failed to update configuration from input stream", e);
+		}
+	}
+	
+	/**
+	 * This method performs the update of the configuration of
+	 * service monitors, based on the information in the validator
+	 * configuration XML file, and the choreographies defined in the
+	 * models folder.
+	 * 
+	 * @param config The configuration
+	 * @param existingValidatorNames The list of validator names
+	 * @param existingInputEndpoints The list of input endpoints
+	 * @param existingOutputEndpoints The list of output endpoints
+	 * @param existingInputDynaReplyTos The set of input dynamic replyTo endpoints
+	 * @param existingOutputDynaReplyTos The set of output dynamic replyTo endpoints
+	 */
+	protected void updateConfiguration(org.w3c.dom.Element config,
+			java.util.Set<ValidatorName> existingValidatorNames,
+			java.util.Set<Endpoint> existingInputEndpoints,
+			java.util.Set<Endpoint> existingOutputEndpoints,
+			java.util.Set<Endpoint> existingInputDynaReplyTos,
+			java.util.Set<Endpoint> existingOutputDynaReplyTos) {
+		logger.debug("Update Service Validator Configuration");
+		
+		if (config != null) {
+			try {				
+				if (config.getNodeName().equals(VALIDATOR_NODE)) {
+					String active=config.getAttribute(ACTIVE_ATTR);
+					
+					if (active != null && active.equalsIgnoreCase("true")) {
+						
+						logger.debug("Setting validator into active mode");
+						m_managedMode = true;
+					}
+				}
+				
+				org.w3c.dom.NodeList services=config.getElementsByTagName(SERVICE_NODE);
+				
+				if (logger.isDebugEnabled()) {
+					if (services != null) {
+						logger.debug("ServiceValidationManager: services="+services.getLength());
+					} else {
+						logger.debug("ServiceValidationManager: services null");
+					}
+				}
+
+				for (int i=0; i < services.getLength(); i++) {
+		       		ServiceValidator sm=null;
+					
+					// Create service monitor for service
+					String modelName=
+						((org.w3c.dom.Element)services.item(i)).getAttribute(MODEL_ATTR);
+					String role=
+						((org.w3c.dom.Element)services.item(i)).getAttribute(ROLE_ATTR);
+					String validate=
+						((org.w3c.dom.Element)services.item(i)).getAttribute(VALIDATE_ATTR);
+
+					// Check for old attribute names, for
+					// backward compatibility - only support
+					// for a limited time
+					if (role == null) {
+						role = ((org.w3c.dom.Element)services.item(i)).getAttribute("participantType");
+					}
+					
+					if (modelName == null) {
+						modelName = ((org.w3c.dom.Element)services.item(i)).getAttribute("cdmFilePath");
+						
+						if (modelName != null) {
+							// Remove path
+							int pos=modelName.lastIndexOf('/');
+							if (pos != -1) {
+								modelName = modelName.substring(pos+1);
+							}
+						}
+					}
+					
+					if (logger.isDebugEnabled()) {
+						logger.debug("Initialize service validator for: model="+
+								modelName+" role="+role+" validate="+validate);
+					}
+					
+					if (role != null) {
+						boolean f_validate=(validate != null && validate.equalsIgnoreCase("true"));
+						
+						if (modelName != null ||
+								f_validate == false) {
+							ValidatorName name=null;
+							
+							if (f_validate) {
+								name = new ValidatorName(modelName, role);
+							} else {
+								name = new ValidatorName(role);
+								
+							}
+							
+							try {
+								// Obtain the service container
+					       		sm = createServiceValidator(name);
+					       		
+					       		if (logger.isDebugEnabled()) {
+					    			logger.debug("Service validator for '"+modelName+
+					       					"' and role '"+role+"' = "+sm);
+					       		}
+					       		
+					       		// Remove validator name from list
+					       		existingValidatorNames.remove(sm.getValidatorName());
+							} catch(Exception e) {
+								logger.error(
+										"Failed to create service validator '"+
+										name+"'", e);
+							}
+						} else {
+							logger.error("Model name must be specified in validation mode");
+						}
+					} else {
+				   		logger.error("Role must be specified");
+					}
+					
+					if (sm != null) {
+						// Map inputs to service
+						org.w3c.dom.NodeList inputs=((org.w3c.dom.Element)services.item(i)).getElementsByTagName(INPUT_NODE);
+						
+						for (int j=0; j < inputs.getLength(); j++) {
+							String epr=((org.w3c.dom.Element)inputs.item(j)).getAttribute(EPR_ATTR);
+							
+							if (epr != null) {
+								Endpoint endpoint=new Endpoint(epr);
+								
+								if (logger.isDebugEnabled()) {
+									logger.debug("Storing input endpoint '"+
+										endpoint+"' against validator: "+sm);									
+								}
+								
+								// Check if existing list
+								java.util.List<ServiceValidator> svs=
+											m_inputValidators.get(endpoint);
+					
+								if (svs == null) {
+									svs = new java.util.Vector<ServiceValidator>();
+									m_inputValidators.put(endpoint, svs);
+								}
+								
+								if (svs.contains(sm) == false) {
+									svs.add(sm);
+								}
+								
+								existingInputEndpoints.remove(endpoint);
+								
+								// Check if dynamic replyTo
+								String dynamicReplyTo=((org.w3c.dom.Element)inputs.item(j)).
+												getAttribute(DYNAMIC_REPLY_TO_ATTR);
+								
+								if (dynamicReplyTo != null && dynamicReplyTo.equalsIgnoreCase("true")) {
+
+									if (logger.isDebugEnabled()) {
+										logger.debug("Input endpoint '"+
+											endpoint+"' has dynamic replyTo destination");									
+									}
+									
+									m_inputDynaReplyTos.add(endpoint);
+									
+									existingInputDynaReplyTos.remove(endpoint);
+								}		
+							}
+						}
+	
+						// Map outputs to service
+						org.w3c.dom.NodeList outputs=((org.w3c.dom.Element)services.item(i)).getElementsByTagName(OUTPUT_NODE);
+						
+						for (int j=0; j < outputs.getLength(); j++) {
+							String epr=((org.w3c.dom.Element)outputs.item(j)).getAttribute(EPR_ATTR);
+							
+							if (epr != null) {
+								Endpoint endpoint=new Endpoint(epr);
+
+								if (logger.isDebugEnabled()) {
+									logger.debug("Storing output endpoint '"+
+										endpoint+"' against validator: "+sm);									
+								}
+								
+								// Check if existing list
+								java.util.List<ServiceValidator> svs=
+											m_outputValidators.get(endpoint);
+					
+								if (svs == null) {
+									svs = new java.util.Vector<ServiceValidator>();
+									m_outputValidators.put(endpoint, svs);
+								}
+								
+								if (svs.contains(sm) == false) {
+									svs.add(sm);
+								}
+								
+								existingOutputEndpoints.remove(endpoint);
+								
+								// Check if dynamic replyTo
+								String dynamicReplyTo=((org.w3c.dom.Element)outputs.item(j)).
+											getAttribute(DYNAMIC_REPLY_TO_ATTR);
+				
+								if (dynamicReplyTo != null && dynamicReplyTo.equalsIgnoreCase("true")) {
+
+									if (logger.isDebugEnabled()) {
+										logger.debug("Output endpoint '"+
+											endpoint+"' has dynamic replyTo destination");									
+									}
+									
+									m_outputDynaReplyTos.add(endpoint);
+									
+									existingOutputDynaReplyTos.remove(endpoint);
+								}		
+							}
+						}
+					}
+				}
+			} catch(Exception e) {
+				logger.error("Failed to load validator config", e);
+			}
+		}
+	}
+
+	/**
+	 * This method returns whether the service validator configuration
+	 * is in 'manage' mode. If yes, then invalid messages will
+	 * be blocked from being delivered to their destination.
+	 * 
+	 * @return Whether the service validator is in 'manage' mode
+	 */
+	public boolean isManagedMode() {
+		return(m_managedMode);
+	}
+	
+	private static final Logger logger = Logger.getLogger(ServiceValidatorManager.class);
+
+	private static final String EPR_ATTR = "epr";
+	private static final String DYNAMIC_REPLY_TO_ATTR = "dynamicReplyTo";
+
+	private static final String OUTPUT_NODE = "output";
+	private static final String INPUT_NODE = "input";
+	private static final String SERVICE_NODE = "service";
+	private static final String ACTIVE_ATTR = "active";
+	private static final String MODE_ATTR = "mode";
+	private static final String REPLY_TO_TIMEOUT_ATTR = "replyToTimeout";
+	private static final String VALIDATOR_NODE = "validator";
+
+	private static final String CONFIG_FILE = "validator-config.xml";
+	private static final String MODEL_ATTR="model";
+	private static final String ROLE_ATTR="role";
+	private static final String VALIDATE_ATTR="validate";
+	
+	private static ServiceValidatorManager m_instance=null;
+	private java.io.File m_validatorConfigFile=null;
+	private java.io.File m_modelsDir=null;
+	private java.util.Map<ValidatorName,ServiceValidator> m_serviceValidators=
+					new java.util.HashMap<ValidatorName,ServiceValidator>();
+	private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_inputValidators=new java.util.Hashtable<Endpoint,java.util.List<ServiceValidator>>();
+	private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_outputValidators=new java.util.Hashtable<Endpoint,java.util.List<ServiceValidator>>();
+	private java.util.Set<Endpoint> m_inputDynaReplyTos=new java.util.HashSet<Endpoint>();
+	private java.util.Set<Endpoint> m_outputDynaReplyTos=new java.util.HashSet<Endpoint>();
+	private boolean m_managedMode=false;
+	private DynamicReplyToEndpointManager m_replyToManager=new DynamicReplyToEndpointManager();
+	
+	/**
+	 * This class is responsible for monitoring the models folder,
+	 * within the overlord validator ESB bundle, to determine when
+	 * the configuration has changed.
+	 */
+	public class ValidatorConfigChangeMonitor implements java.lang.Runnable {
+		
+		public ValidatorConfigChangeMonitor() {
+			// Do initial check for updates, so monitors
+			// initialized before returning from construct,
+			// as remainder of checks will be in a separate
+			// thread - so we need to ensure that the monitors
+			// are configured before the first message is
+			// passed through the filter.
+			checkForUpdates();
+		}
+		
+		public void run() {
+			
+			while (true) {
+				checkForUpdates();
+				
+				try {
+					synchronized(ValidatorConfigChangeMonitor.this) {
+						wait(30000);
+					}
+				} catch(Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+		
+		protected void checkForUpdates() {
+			logger.debug("Checking for config updates");
+			
+			// Get last update time
+			long lastUpdate=getLastUpdate();
+			
+			if (lastUpdate > m_lastUpdate) {
+				
+				updateConfigurations();
+				
+				m_lastUpdate = lastUpdate;
+			}			
+		}
+		
+		protected long getLastUpdate() {
+			long ret=0;
+			
+			if (m_validatorConfigFile != null) {
+				ret = m_validatorConfigFile.lastModified();
+			}
+			
+			if (m_modelsDir != null) {
+				java.io.File[] files=m_modelsDir.listFiles();
+				
+				for (int i=0; i < files.length; i++) {
+					if (files[i].getName().endsWith(".cdm") &&
+							ret < files[i].lastModified()) {
+						ret = files[i].lastModified();
+					}
+				}
+				
+				if (ret < m_modelsDir.lastModified()) {
+					ret = m_modelsDir.lastModified();
+				}
+			}
+			
+			return(ret);
+		}
+		
+		private long m_lastUpdate=0;
+	}
+	
+	public class DynamicReplyToEndpointManager extends Thread {
+		
+		/**
+		 * The default constructor
+		 */
+		public DynamicReplyToEndpointManager() {
+			setDaemon(true);
+			
+			start();
+		}
+		
+		/**
+		 * The run method is responsible for ensuring the dynamic
+		 * 'reply-to' endpoints are cleaned up periodically.
+		 */
+		public void run() {
+			
+			while(true) {
+				
+				try {
+					synchronized(this) {
+						wait(m_replyToTimeout);
+					}
+				} catch(Exception e) {
+					logger.error("Failed to wait");
+				}
+				
+				// Shift main entries to an emptied 'pending delete'
+				// map
+				synchronized(m_inputs) {
+					if (logger.isDebugEnabled()) {
+						java.util.Iterator<Endpoint> iter=
+								m_inputsPendingDelete.keySet().iterator();
+						while (iter.hasNext()) {
+							Endpoint endpoint=iter.next();
+							java.util.List<ServiceValidator> validators=
+										m_inputsPendingDelete.get(endpoint);
+							logger.debug("Deleting input (reply-to) validators '"+
+									endpoint+"': "+validators);
+						}
+					}
+					
+					m_inputsPendingDelete.clear();				
+					m_inputsPendingDelete.putAll(m_inputs);
+					m_inputs.clear();
+				}
+				
+				synchronized(m_outputs) {
+					if (logger.isDebugEnabled()) {
+						java.util.Iterator<Endpoint> iter=
+								m_outputsPendingDelete.keySet().iterator();
+						while (iter.hasNext()) {
+							Endpoint endpoint=iter.next();
+							java.util.List<ServiceValidator> validators=
+								m_outputsPendingDelete.get(endpoint);
+							logger.debug("Deleting output (reply-to) validators '"+
+									endpoint+"': "+validators);
+						}
+					}
+
+					m_outputsPendingDelete.clear();				
+					m_outputsPendingDelete.putAll(m_outputs);
+					m_outputs.clear();
+				}
+			}
+		}
+		
+		/**
+		 * This method returns the list of service validators
+		 * associated with the dynamic reply-to endpoint.
+		 * 
+		 * @param endpoint The input endpoint
+		 * @return The list of service validators, or null if
+		 * 			not found
+		 */
+		public java.util.List<ServiceValidator> getInputServiceValidators(Endpoint endpoint) {
+			java.util.List<ServiceValidator> ret=null;
+		
+			synchronized(m_inputs) {
+				ret = m_inputs.get(endpoint);
+				
+				if (ret == null) {
+					ret = m_inputsPendingDelete.get(endpoint);
+				}
+			}
+			
+			if (logger.isDebugEnabled()) {
+				logger.debug("Return input (reply-to) validators '"+endpoint+"': "+ret);
+			}
+			
+			return(ret);
+		}
+
+		/**
+		 * This method returns the list of service validators
+		 * associated with the dynamic reply-to endpoint.
+		 * 
+		 * @param endpoint The output endpoint
+		 * @return The list of service validators, or null if
+		 * 			not found
+		 */
+		public java.util.List<ServiceValidator> getOutputServiceValidators(Endpoint endpoint) {
+			java.util.List<ServiceValidator> ret=null;
+		
+			synchronized(m_outputs) {
+				ret = m_outputs.get(endpoint);
+				
+				if (ret == null) {
+					ret = m_outputsPendingDelete.get(endpoint);
+				}
+			}
+			
+			if (logger.isDebugEnabled()) {
+				logger.debug("Return output (reply-to) validators '"+endpoint+"': "+ret);
+			}
+			
+			return(ret);
+		}
+
+		/**
+		 * This method registers a list of service validators against
+		 * a dynamic 'reply-to' endpoint.
+		 * 
+		 * @param endpoint The endpoint
+		 * @param validators The list of service validators
+		 */
+		public void registerInputDynamicReplyTo(Endpoint endpoint,
+							java.util.List<ServiceValidator> validators) {
+
+			synchronized(m_inputs) {
+				m_inputs.put(endpoint, validators);
+				
+				// May not be necessary, as entry would not be
+				// used - but could save memory?
+				m_inputsPendingDelete.remove(endpoint);
+			}
+		}
+		
+		/**
+		 * This method registers a list of service validators against
+		 * a dynamic 'reply-to' endpoint.
+		 * 
+		 * @param endpoint The endpoint
+		 * @param validators The list of service validators
+		 */
+		public void registerOutputDynamicReplyTo(Endpoint endpoint,
+							java.util.List<ServiceValidator> validators) {
+
+			synchronized(m_outputs) {
+				m_outputs.put(endpoint, validators);
+				
+				// May not be necessary, as entry would not be
+				// used - but could save memory?
+				m_outputsPendingDelete.remove(endpoint);
+			}
+		}
+		
+		/**
+		 * This method sets the timeout period for purging the
+		 * cache of reply-to endpoints.
+		 * 
+		 * @param timeoutValue The timeout value
+		 */
+		public void setReplyToTimeout(long timeoutValue) {
+			m_replyToTimeout = timeoutValue;
+		}
+		
+		private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_inputs=
+			new java.util.HashMap<Endpoint,java.util.List<ServiceValidator>>();
+		private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_outputs=
+			new java.util.HashMap<Endpoint,java.util.List<ServiceValidator>>();
+		private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_inputsPendingDelete=
+			new java.util.HashMap<Endpoint,java.util.List<ServiceValidator>>();
+		private java.util.Map<Endpoint,java.util.List<ServiceValidator>> m_outputsPendingDelete=
+			new java.util.HashMap<Endpoint,java.util.List<ServiceValidator>>();
+		private long m_replyToTimeout=10000;
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfig.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfig.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfig.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,44 @@
+/*
+ * 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.validator;
+
+/**
+ * This interface represents a configuration that will be used for
+ * validation against a stream of ESB based messages.
+ */
+public interface ValidatorConfig {
+
+	/**
+	 * This method returns the type of the model associated
+	 * with this validator configuration. This will
+	 * general be based on the file extension of the model
+	 * file.
+	 * 
+	 * @return The model type
+	 */
+	public String getModelType();
+	
+	/**
+	 * This method returns the validator configuration
+	 * associated with the model.
+	 * 
+	 * @return The validator model
+	 */
+	public org.w3c.dom.Element getConfiguration();
+	
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigFactory.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigFactory.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,97 @@
+/*
+ * 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.validator;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class provides a factory for ValidatorConfig objects
+ * based on supplied model file details.
+ */
+public class ValidatorConfigFactory {
+
+	/**
+	 * This method retrieves a validator config associated with
+	 * the supplied file. If the model associated with the
+	 * file is not supported, then a null will be returned.
+	 * 
+	 * @param file The file containing the model
+	 * @return The validator config, or null if an unsupported type
+	 * @exception IOException Failed to load supported model type
+	 */
+	public static ValidatorConfig getValidatorConfig(java.io.File file)
+							throws java.io.IOException {
+		ValidatorConfig ret=null;
+		
+		String modelType=null;
+		
+		if (file != null && (modelType=getModelType(file.getName())) != null) {
+			ValidatorConfigLoader loader=null;
+			
+			for (int i=0; loader == null &&
+					i < m_loaders.size(); i++) {
+				
+				if (m_loaders.get(i).isSupported(modelType)) {
+					loader = m_loaders.get(i);
+				}
+			}
+			
+			if (loader != null) {
+				java.io.FileInputStream fis=new java.io.FileInputStream(file);
+				
+				ret = loader.loadValidatorConfig(fis, file.getName());
+				
+				fis.close();
+			}
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Returning validator config for "+
+							file.getName()+": "+ret);
+		}
+
+		return(ret);		
+	}
+	
+	/**
+	 * This method determines the model type associated with the
+	 * supplied model filename.
+	 * 
+	 * @param name The model filename
+	 * @return The model type, or null if not known
+	 */
+	protected static String getModelType(String name) {
+		String ret=null;
+		int pos=name.lastIndexOf('.');
+		
+		if (pos != -1) {
+			ret = name.substring(pos+1);
+		}
+		
+		return(ret);
+	}
+	
+	private static final Logger logger = Logger.getLogger(ValidatorConfigFactory.class);
+
+	private static java.util.List<ValidatorConfigLoader> m_loaders=
+					new java.util.Vector<ValidatorConfigLoader>();
+	
+	static {
+		m_loaders.add(new org.savara.validator.pi4soa.Pi4SOAValidatorConfigLoader());
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigLoader.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigLoader.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorConfigLoader.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.validator;
+
+/**
+ * This interface is implemented by model specific loaders, to
+ * load a ValidatorConfig for the particular model type.
+ */
+public interface ValidatorConfigLoader {
+
+	/**
+	 * This method determines if the validator config loader
+	 * implementation supports the supplied model type.
+	 *  
+	 * @param modelType The model type
+	 * @return Whether the loader supports the model type
+	 */
+	public boolean isSupported(String modelType);
+	
+	/**
+	 * This method loads the validator config, contained within
+	 * the supplied input stream representing a model of the
+	 * supported type.
+	 * 
+	 * @param is The input stream
+	 * @param modelPath The path to the model file
+	 * @return The validator config
+	 * @throws java.io.IOException Failed to load validator config
+	 */
+	public ValidatorConfig loadValidatorConfig(java.io.InputStream is,
+					String modelPath) throws java.io.IOException;
+	
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorName.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorName.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/ValidatorName.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,134 @@
+/*
+ * 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.validator;
+
+/**
+ * This class represents a key for looking up a service validator.
+ */
+public class ValidatorName {
+
+	/**
+	 * This constructor is initialized with the details used to
+	 * identify the validator.
+	 * 
+	 * @param role The role
+	 */
+	public ValidatorName(String role) {
+		m_role = role;
+		m_validate = false;
+	}
+	
+	/**
+	 * This constructor is initialized with the details used to
+	 * identify the validator.
+	 * 
+	 * @param modelName The model name
+	 * @param role The role
+	 * @param validate Whether to validate, or simply record
+	 */
+	public ValidatorName(String modelName, String role) {
+		m_modelName = modelName;
+		m_role = role;
+		m_validate = true;
+	}
+	
+	/**
+	 * This method returns the model name associated with the
+	 * service validator.
+	 * 
+	 * @return The model name
+	 */
+	public String getModelName() {
+		return(m_modelName);
+	}
+	
+	/**
+	 * This method returns the type associated with the model.
+	 * If no model has been defined for the validator name,
+	 * as in the case of a validator in record mode, then
+	 * this method will return ValidatorName.NO_MODEL_TYPE.
+	 * 
+	 * @return The model type
+	 */
+	public String getModelType() {
+		String ret=null;		
+		int pos=0;
+		
+		if (m_modelName != null &&
+					(pos=m_modelName.lastIndexOf('.')) != -1) {
+			ret = m_modelName.substring(pos+1);
+		} else {
+			ret = NO_MODEL_TYPE;
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the role associated with the Service
+	 * Validator.
+	 * 
+	 * @return The role
+	 */
+	public String getRole() {
+		return(m_role);
+	}
+	
+	/**
+	 * This method determines whether the associated service
+	 * validator is in validation or record mode.
+	 * 
+	 * @return Whether in validation or record mode
+	 */
+	public boolean isValidate() {
+		return(m_validate);
+	}
+	
+	public boolean equals(Object obj) {
+		boolean ret=false;
+		
+		if (obj instanceof ValidatorName) {
+			ret = (obj.toString().equals(toString()) &&
+					((ValidatorName)obj).m_validate == m_validate);
+		}
+
+		return(ret);
+	}
+	
+	public int hashCode() {
+		return(toString().hashCode());
+	}
+
+	public String toString() {
+		String ret=null;
+		
+		if (isValidate()) {
+			ret = m_modelName+":"+m_role;
+		} else {
+			ret = m_role;
+		}
+		
+		return(ret);
+	}
+	
+	public static final String NO_MODEL_TYPE="NoModelType";
+	
+	private String m_modelName=null;
+	private String m_role=null;
+	private boolean m_validate=false;
+}
\ No newline at end of file

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/JMSServiceTracker.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/JMSServiceTracker.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/JMSServiceTracker.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,1196 @@
+/*
+ * Copyright 2005 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Sep 12, 2005 : Initial version created by gary
+ */
+
+// Original version copied from pi4soa service tracker, licensed under Apache version 2
+
+/*
+ * 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.validator.pi4soa;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.jms.QueueConnectionFactory;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.XMLUtils;
+import org.pi4soa.service.Channel;
+import org.pi4soa.service.Identity;
+import org.pi4soa.service.Message;
+import org.pi4soa.service.ServiceException;
+import org.pi4soa.service.behavior.MessageClassification;
+import org.pi4soa.service.behavior.MessageDefinition;
+import org.pi4soa.service.behavior.Receive;
+import org.pi4soa.service.behavior.Send;
+import org.pi4soa.service.behavior.ServiceDescription;
+import org.pi4soa.service.session.Session;
+import org.pi4soa.service.tracker.PublishingServiceTracker;
+import org.pi4soa.service.tracker.ServiceTracker;
+import org.pi4soa.service.tracker.TrackerEvent;
+
+/**
+ * This class provides an implementation of the publishing service
+ * tracker that sends the monitoring information using the JMS
+ * API.
+ *
+ */
+public class JMSServiceTracker implements ServiceTracker {
+
+	private static final String SAVARA_SERVICE_TRACKER_NS = "http://www.savara.org/service/tracker";
+	/**
+	 * This is the default constructor for the JMS service
+	 * tracker implementation.
+	 *
+	 */
+	public JMSServiceTracker() {
+	}
+
+	/**
+	 * This method is invoked to initialize the JMS connection, based
+	 * on the established properties.
+	 * 
+	 */
+	public void initialize() {
+		
+		logger.info("Initializing Savara JMS Service Tracker");
+		
+		javax.naming.Context ctx=null;
+
+		try {
+			if (NamesUtil.isSet(m_jndiInitialContextFactory)) {
+				java.util.Properties jndiProps = new java.util.Properties();
+				jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+								m_jndiInitialContextFactory);
+				jndiProps.setProperty(Context.PROVIDER_URL,
+								m_jndiProviderURL);
+				
+				if (m_jndiFactoryURLPackages != null) {
+					jndiProps.setProperty(Context.URL_PKG_PREFIXES,
+								m_jndiFactoryURLPackages);
+				}
+				
+				ctx = new javax.naming.InitialContext(jndiProps);
+			} else {
+				if (logger.isLoggable(java.util.logging.Level.FINER)) {
+					logger.finer("Creating default initial context");
+				}
+				ctx = new javax.naming.InitialContext();
+			}
+		} catch(Exception e) {
+			logger.severe("Failed to create JNDI initial context: "+e);
+		}
+		
+		// Get connection factory and destination topic
+		if (ctx != null) {
+			
+			try {
+				try {
+					javax.jms.ConnectionFactory factory =
+						(javax.jms.ConnectionFactory)
+							ctx.lookup(m_jmsConnectionFactory);
+		
+					m_connection = factory.createConnection();
+					
+					if (logger.isLoggable(Level.FINER)) {
+						logger.finer("Connection: "+m_connection);
+					}
+					
+				} catch(java.lang.RuntimeException re) {
+					if (m_jmsConnectionFactoryAlternate != null) {
+						QueueConnectionFactory qcf = (QueueConnectionFactory)
+							ctx.lookup(m_jmsConnectionFactoryAlternate);
+						m_connection = qcf.createQueueConnection();
+
+						if (logger.isLoggable(Level.FINER)) {
+							logger.finer("Alternate Connection: "+m_connection);
+						}
+						
+					} else {
+						throw re;
+					}
+				}
+	
+				javax.jms.Destination dest =
+					(javax.jms.Destination)ctx.lookup(m_jmsDestination);
+	
+				m_session = m_connection.createSession(false,
+						javax.jms.Session.AUTO_ACKNOWLEDGE);
+				
+				m_producer = m_session.createProducer(dest);
+				
+				if (logger.isLoggable(Level.FINE)) {
+					logger.fine(Thread.currentThread()+
+							": Created JMS ServiceTracker connection");
+				}
+				
+			} catch(Exception e) {
+				logger.severe("Failed to create JMS connection: "+e);
+			}
+		}
+	}
+	
+	/**
+	 * This method sets the JNDI initial context factory class name.
+	 * 
+	 * @param factory The factory class name
+	 */
+	public void setJNDIInitialContextFactory(String factory) {
+		m_jndiInitialContextFactory = factory;
+	}
+	
+	/**
+	 * This method sets the provider URL that is used when publishing
+	 * the tracker events.
+	 * 
+	 * @param url The provider url
+	 */
+	public void setJNDIProviderURL(String url) {
+		m_jndiProviderURL = url;
+	}
+	
+	/**
+	 * This method sets the JNDI factory URL packages.
+	 * 
+	 * @param pkgs The packages
+	 */
+	public void setJNDIFactoryURLPackages(String pkgs) {
+		m_jndiFactoryURLPackages = pkgs;
+	}
+	
+	/**
+	 * This method sets the JMS connection factory name, to
+	 * be looked up within JNDI.
+	 * 
+	 * @param cf The connection factory
+	 */
+	public void setJMSConnectionFactory(String cf) {
+		m_jmsConnectionFactory = cf;
+	}
+	
+	/**
+	 * This method sets the alternate JMS connection factory name, to
+	 * be looked up within JNDI.
+	 * 
+	 * @param cf The connection factory
+	 */
+	public void setJMSConnectionFactoryAlternate(String cf) {
+		m_jmsConnectionFactoryAlternate = cf;
+	}
+	
+	/**
+	 * This method sets the JMS destination name, to
+	 * be looked up within JNDI.
+	 * 
+	 * @param dest The destination
+	 */
+	public void setJMSDestination(String dest) {
+		m_jmsDestination = dest;
+	}
+	
+	/**
+	 * This method is used to publish the service tracker message.
+	 * 
+	 * @param serviceName The service name
+	 * @param session The session
+	 * @param mesg The message
+	 */
+	protected synchronized void publish(String serviceName, Session session,
+						String mesg) {
+		
+		// Establish JMS connection and topic
+		if (m_initialized == false &&
+				m_jmsConnectionFactory != null &&
+				m_jmsDestination != null) {
+			initialize();
+			
+			m_initialized = true;
+		}
+		
+		if (m_producer != null) {
+			
+			try {
+				if (logger.isLoggable(Level.FINE)) {
+					logger.fine(mesg);
+				}
+				
+				TextMessage tm=m_session.createTextMessage(mesg);
+				
+				if (logger.isLoggable(Level.FINEST)) {
+					logger.finest(Thread.currentThread()+
+						": Sending JMS ServiceTracker record="+tm);
+				}
+
+				m_producer.send(tm);
+			} catch(Exception e) {
+				logger.severe("Failed to publish message: "+e);
+			}
+			
+		} else {
+			logger.warning("Could not publish message: "+mesg);
+		}
+	}
+	
+	/**
+	 * This method closes the service tracker.
+	 *
+	 * @exception ServiceException Failed to close
+	 */
+	public void close() throws ServiceException {
+		
+		try {
+			if (logger.isLoggable(Level.FINE)) {
+				logger.fine(Thread.currentThread()+
+					": Closing JMS ServiceTracker connection");
+			}
+			
+			if (m_session != null) {
+				m_session.close();
+				m_session = null;
+			}
+
+			if (m_connection != null) {
+				m_connection.close();
+				m_connection = null;
+			}
+			
+		} catch(Exception e) {
+			logger.severe("Failed to close JMS connection: "+e);
+						
+			m_initialized = false;
+
+			throw new ServiceException("Failed to close JMS connection", e);
+		}
+		
+		m_initialized = false;
+	}
+	
+	/**
+	 * This method sets whether the message payload should be
+	 * recorded as part of the service tracker send and receive
+	 * events.
+	 * 
+	 * @param val Whether to record the message payload
+	 */
+	public void setRecordMessagePayload(Boolean val) {
+		if (val != null) {
+			m_recordMessagePayload = val.booleanValue();
+		} else {
+			m_recordMessagePayload = false;
+		}
+	}
+	
+	/**
+	 * This method indicates that a new service instance
+	 * has started.
+	 * 
+	 * @param service The service
+	 * @param session The session
+	 */
+	public void serviceStarted(ServiceDescription service,
+				Session session) {
+		String version="";
+		
+		if (service.getVersion() != null) {
+			version = VERSION_ATTR+"=\""+
+					service.getVersion()+"\" ";
+		}
+		
+		String xml="<sd:"+TrackerEvent.SERVICE_STARTED+" "+
+				NAME_ATTR+"=\""+service.getFullyQualifiedName()+
+				"\" "+version+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" />";
+		
+		//record(getServiceName(session), session, xml, INFO, null);
+	}
+
+	/**
+	 * This method indicates that a service instance
+	 * has finished.
+	 * 
+	 * @param service The service
+	 * @param session The session
+	 */
+	public void serviceFinished(ServiceDescription service,
+				Session session) {
+		String version="";
+		
+		if (service.getVersion() != null) {
+			version = VERSION_ATTR+"=\""+
+					service.getVersion()+"\" ";
+		}
+		
+		String xml="<sd:"+TrackerEvent.SERVICE_FINISHED+
+					" "+NAME_ATTR+"=\""+service.getFullyQualifiedName()+
+				"\" "+version+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" />";
+
+		//record(getServiceName(session), session, xml, INFO, null);
+	}
+
+	/**
+	 * This method indicates that a new sub session
+	 * has started within an existing service instance.
+	 * 
+	 * @param parent The parent session
+	 * @param session The session
+	 */
+	public void subSessionStarted(Session parent, Session session) {
+		String xml="<sd:"+TrackerEvent.SUB_SESSION_STARTED+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				PARENT_SESSION_ID_ATTR+"=\""+getSessionId(parent)+
+					"\" "+SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" />";
+
+		//record(getServiceName(session), session, xml, INFO, null);
+	}
+	
+	/**
+	 * This method indicates that an existing
+	 * sub session has finished.
+	 * 
+	 * @param parent The parent session
+	 * @param session The session
+	 */
+	public void subSessionFinished(Session parent, Session session) {
+		String xml="<sd:"+TrackerEvent.SUB_SESSION_FINISHED+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				PARENT_SESSION_ID_ATTR+"=\""+getSessionId(parent)+
+					"\" "+SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" />";
+
+		//record(getServiceName(session), session, xml, INFO, null);
+	}
+	
+	/**
+	 * This method registers the fact that a message has been
+	 * sent from a stateful service.
+	 * 
+	 * @param activity The behavioral activity
+	 * @param session The session
+	 * @param channel The channel
+	 * @param mesg The message that has been handled
+	 */
+	public void sentMessage(Send activity, Session session,
+					Channel channel, Message mesg) {
+		String channelText=getChannelText(channel);
+		String messageText=getMessageText(mesg,
+						activity.getMessageDefinition());
+		
+		String xml="<sd:"+TrackerEvent.SENT_MESSAGE+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" >"+messageText+
+					channelText+"</sd:"+TrackerEvent.SENT_MESSAGE+">";
+
+		record(getServiceName(session), session, xml, INFO, null);
+	}
+
+	/**
+	 * This method registers the fact that a message has been
+	 * sent from a stateless service.
+	 * 
+	 * @param defn The message definition
+	 * @param mesg The message that has been handled
+	 */
+	public void sentMessage(MessageDefinition defn, Message mesg) {
+		String messageText=getMessageText(mesg, defn);
+		String serviceName=getServiceName(defn);
+		
+		String xml="<sd:"+TrackerEvent.SENT_MESSAGE+" "+
+				//SESSION_ID_ATTR+"=\""+serviceName+"\" "+
+					TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" >"+messageText+
+					"</sd:"+TrackerEvent.SENT_MESSAGE+">";
+
+		record(serviceName, null, xml, INFO, null);
+	}
+	
+	/**
+	 * This method registers the fact that a message has been
+	 * received from a stateful service.
+	 * 
+	 * @param activity The behavioral activity
+	 * @param session The session
+	 * @param channel The channel
+	 * @param mesg The message that has been handled
+	 */
+	public void receivedMessage(Receive activity, Session session,
+					Channel channel, Message mesg) {
+		String channelText=getChannelText(channel);
+		String messageText=getMessageText(mesg,
+						activity.getMessageDefinition());
+		
+		String xml="<sd:"+TrackerEvent.RECEIVED_MESSAGE+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+
+				getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" >"+messageText+
+				channelText+"</sd:"+TrackerEvent.RECEIVED_MESSAGE+">";
+
+		record(getServiceName(session), session, xml, INFO, null);
+	}
+	
+	/**
+	 * This method registers the fact that a message has been
+	 * received from a stateless service.
+	 * 
+	 * @param defn The message definition
+	 * @param mesg The message that has been handled
+	 */
+	public void receivedMessage(MessageDefinition defn, Message mesg) {
+		String messageText=getMessageText(mesg, defn);
+		String serviceName=getServiceName(defn);
+		
+		String xml="<sd:"+TrackerEvent.RECEIVED_MESSAGE+" "+
+				//SESSION_ID_ATTR+"=\""+serviceName+"\" "+
+				TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" >"+messageText+
+				"</sd:"+TrackerEvent.RECEIVED_MESSAGE+">";
+
+		record(serviceName, null, xml, INFO, null);
+	}
+
+	/**
+	 * This method registers that a message was not expected.
+	 * 
+	 * @param sdesc The service description, if known
+	 * @param session The session, or null if a stateless service,
+	 * 				or cannot be associated with a session
+	 * @param mesg The message that was not expected
+	 * @param reason The optional reason why the message was
+	 * 					considered to be unexpected
+	 */
+	public void unexpectedMessage(ServiceDescription sdesc,
+			Session session, Message mesg, String reason) {
+		String messageText=getMessageText(mesg, null);
+		
+		// Process the reason field to ensure it has no
+		// character that would cause the XML a problem
+		reason = processAttributeContents(reason);
+		
+		String xml="<sd:"+TrackerEvent.UNEXPECTED_MESSAGE+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+						reason+"</sd:"+DETAILS_NODE+">"+messageText+
+						"</sd:"+TrackerEvent.UNEXPECTED_MESSAGE+">";
+
+		String serviceName=null;
+		
+		if (sdesc != null) {
+			serviceName = sdesc.getFullyQualifiedName();
+		} else {
+			serviceName = getServiceName(session);
+		}
+		
+		String serviceVersion=null;
+		
+		if (sdesc != null) {
+			serviceVersion = sdesc.getVersion();
+		}
+		
+		record(serviceName, serviceVersion, session, mesg, xml, ERROR, null);
+	}
+	
+	/**
+	 * This method registers that an exception was not handled.
+	 * 
+	 * @param session The session, or null if a stateless service
+	 * @param excType The exception type
+	 */
+	public void unhandledException(Session session, String excType) {
+		
+		String xml="<sd:"+TrackerEvent.UNHANDLED_EXCEPTION+
+					" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+					getServiceInstanceId(session)+"\" "+
+					SESSION_ID_ATTR+"=\""+
+					getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+					excType+"</sd:"+DETAILS_NODE+"></sd:"+
+					TrackerEvent.UNHANDLED_EXCEPTION+">";
+
+		record(getServiceName(session), session, xml, ERROR, null);
+	}
+	
+	/**
+	 * This method reports information regarding the processing
+	 * of a service session. The details can either be specified
+	 * as a textual string (unstructured data), 
+	 * or as a structured XML fragment.<p>
+	 * 
+	 * @param session The session, or null if a stateless service
+	 * @param details The details
+	 */
+	public void information(Session session, String details) {
+		String xml="<sd:"+TrackerEvent.INFORMATION+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+getSessionId(session)+
+					"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+					XMLUtils.encodeXMLString(details)+
+					"</sd:"+DETAILS_NODE+"></sd:"+
+					TrackerEvent.INFORMATION+">";
+
+		record(getServiceName(session), session, xml, INFO, null);
+	}
+	
+	/**
+	 * This method reports information regarding the processing
+	 * of a service session. The details can either be specified
+	 * as a textual string (unstructured data), 
+	 * or as a structured XML fragment.<p>
+	 * 
+	 * @param session The session, or null if a stateless service
+	 * @param details The details
+	 * @param exc The optional exception
+	 */
+	public void warning(Session session, String details,
+							Throwable exc) {
+		String excText="";
+		if (exc != null) {
+			try {
+				java.io.StringWriter s=new java.io.StringWriter();
+				java.io.PrintWriter p=new java.io.PrintWriter(s);
+				
+				exc.printStackTrace(p);
+				
+				p.close();
+				s.close();
+				
+				excText = "<sd:"+EXCEPTION_NODE+">"+s.toString()+"</sd:"+EXCEPTION_NODE+">";
+			} catch(Exception e) {
+				logger.severe("Failed to record exception stack trace: "+e);
+				
+				excText = "<sd:"+EXCEPTION_NODE+">"+exc.getLocalizedMessage()+"</sd:"+EXCEPTION_NODE+">";
+			}
+		}
+								
+		String xml="<sd:"+TrackerEvent.WARNING+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+getSessionId(session)+
+							"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+							XMLUtils.encodeXMLString(details)+
+							"</sd:"+DETAILS_NODE+">"+excText+"</sd:"+
+							TrackerEvent.WARNING+">";
+
+		record(getServiceName(session), session, xml, WARNING, exc);
+	}
+	
+	/**
+	 * This method reports information regarding the processing
+	 * of a service session. The details can either be specified
+	 * as a textual string (unstructured data), 
+	 * or as a structured XML fragment.<p>
+	 * 
+	 * @param session The session, or null if a stateless service
+	 * @param details The details
+	 * @param exc The optional exception
+	 */
+	public void error(Session session, String details,
+							Throwable exc) {
+		String excText="";
+		if (exc != null) {
+			try {
+				java.io.StringWriter s=new java.io.StringWriter();
+				java.io.PrintWriter p=new java.io.PrintWriter(s);
+				
+				exc.printStackTrace(p);
+				
+				p.close();
+				s.close();
+				
+				excText = "<sd:"+EXCEPTION_NODE+">"+s.toString()+"</sd:"+EXCEPTION_NODE+">";
+			} catch(Exception e) {
+				logger.severe("Failed to record exception stack trace: "+e);
+				
+				excText = "<sd:"+EXCEPTION_NODE+">"+exc.getLocalizedMessage()+"</sd:"+EXCEPTION_NODE+">";
+			}
+		}
+						
+		
+		String xml="<sd:"+TrackerEvent.ERROR+
+				" "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+				getServiceInstanceId(session)+"\" "+
+				SESSION_ID_ATTR+"=\""+getSessionId(session)+
+					"\" "+TIMESTAMP_ATTR+"=\""+
+					System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+					XMLUtils.encodeXMLString(details)+
+					"</sd:"+DETAILS_NODE+">"+excText+"</sd:"+
+					TrackerEvent.ERROR+">";
+
+		record(getServiceName(session), session, xml, ERROR, exc);
+	}
+	
+	/**
+	 * Check the format of the specified session id.
+	 * 
+	 * @param session The initial session
+	 * @return The reformatted session id
+	 */
+	protected String getSessionId(Session session) {
+		String ret=null;
+		
+		if (session != null) {
+			ret = session.getId().getSessionId();
+		}
+		
+		if (ret == null) {
+			ret = "";
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines whether a long expanded form
+	 * of id should be used for the service instance id.
+	 * 
+	 * @return Whether the expanded form of id is used
+	 */
+	protected boolean isIdExpanded() {
+		return(true);
+	}
+	
+	/**
+	 * This method returns the service instance id
+	 * associated with the specified session.
+	 * 
+	 * @param session The session
+	 * @return The service instance id
+	 */
+	protected String getServiceInstanceId(Session session) {
+		String ret=null;
+		
+		if (session != null) {
+			if (isIdExpanded()) {
+				ret = session.getId().getServiceDescriptionName()+
+						"/"+session.getId().getServiceInstanceId();				
+			} else {
+				ret = session.getId().getServiceInstanceId();
+			}
+		}
+		
+		if (ret == null) {
+			ret = "";
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the service name associated with the
+	 * supplied session.
+	 * 
+	 * @param session The session
+	 * @return The service name
+	 */
+	protected String getServiceName(Session session) {
+		String ret="";
+		
+		if (session != null && session.getId() != null) {
+			ret = session.getId().getServiceDescriptionName();
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the service name associated with the
+	 * supplied message definition.
+	 * 
+	 * @param defn The message definition
+	 * @return The service name
+	 */
+	protected String getServiceName(MessageDefinition defn) {
+		String ret="";
+
+		if (defn != null && defn.getServiceDescription() != null) {
+			ret = defn.getServiceDescription().getFullyQualifiedName();
+		}
+		
+		return(ret);		
+	}
+	
+	/**
+	 * This method constructs the session related information
+	 * to be recorded.
+	 * 
+	 * @param session The session
+	 * @return The session text
+	 */
+	protected String getSessionIdentityText(Session session) {
+		return(getSessionIdentityText(session, null));
+	}
+	
+	/**
+	 * This method constructs the session related information
+	 * to be recorded.
+	 * 
+	 * @param session The session
+	 * @param mesg The optional message
+	 * @return The session text
+	 */
+	public String getSessionIdentityText(Session session, Message mesg) {
+		StringBuffer identities=new StringBuffer();
+		
+		if (session != null && session.getSessionIdentity() != null) {
+			identities.append("<sd:"+SESSION_IDENTITY_NODE+">"+
+					"<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+					session.getSessionIdentity().getName()+"\" >"+
+					XMLUtils.encodeXMLString(session.getSessionIdentity().getFullId())+
+					"</sd:"+IDENTITY_NODE+">"+
+					"</sd:"+SESSION_IDENTITY_NODE+">");
+		}
+		
+		java.util.Iterator<Identity> ids=null;
+		
+		if (session != null) {
+			ids = session.getPrimaryIdentities().iterator();
+		}
+		
+		// If session has no identity information, but a
+		// message is supplied, then try getting identity
+		// from it.
+		if ((ids == null || ids.hasNext() == false) &&
+				mesg != null && mesg.getMessageIdentities() != null) {
+			ids = mesg.getMessageIdentities().iterator();
+		}
+		
+		if (ids != null && ids.hasNext()) {
+			identities.append("<sd:"+PRIMARY_IDENTITIES_NODE+">");
+			
+			while (ids.hasNext()) {
+				Identity cur=ids.next();
+				
+				identities.append("<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+						cur.getName()+"\" >");
+				identities.append(XMLUtils.encodeXMLString(cur.getFullId()));
+				identities.append("</sd:"+IDENTITY_NODE+">");
+			}
+			
+			identities.append("</sd:"+PRIMARY_IDENTITIES_NODE+">");
+		}
+		
+		return(identities.toString());
+	}
+	
+	/**
+	 * This method returns the XML text associated with the
+	 * message.
+	 * 
+	 * @param mesg The message
+	 * @param defn The message definition from the description
+	 * @return The message text
+	 */
+	public String getMessageText(Message mesg, MessageDefinition defn) {
+		String type=null;
+		
+		if (defn == null) {
+			type = (mesg.isRequest()?REQUEST_RPC_MESSAGE_TYPE:RESPONSE_RPC_MESSAGE_TYPE);
+
+			if (mesg.isRPCStyle() == false) {
+				type = MESSAGE_STYLE_MESSAGE_TYPE;
+			}
+		} else {
+			type = (defn.getClassification()==MessageClassification.REQUEST?
+					REQUEST_RPC_MESSAGE_TYPE:RESPONSE_RPC_MESSAGE_TYPE);
+		}
+		
+		if (NamesUtil.isSet(mesg.getFaultName())) {
+			type = FAULT_RPC_MESSAGE_TYPE;
+		}
+		
+		return(getMessageTextForType(mesg, type));
+	}
+	
+	/**
+	 * This method returns the XML text associated with the
+	 * message.
+	 * 
+	 * @param mesg The message
+	 * @param type The message classification (request/response/message/fault)
+	 * @return The message text
+	 */
+	protected String getMessageTextForType(Message mesg, String type) {
+		String ret=null;
+		String fault="";
+		String messageType="";
+		String identities="";
+		String valueText=getMessagePayload(mesg);
+		String endpoint="";
+		
+		if (NamesUtil.isSet(mesg.getFaultName())) {
+			fault = FAULT_ATTR+"=\""+mesg.getFaultName()+"\" ";
+		}
+		
+		if (NamesUtil.isSet(mesg.getType())) {
+			messageType = MESSAGE_TYPE_ATTR+"=\""+mesg.getType()+"\" ";
+		}
+		
+		if (mesg.getSessionIdentity() != null) {
+			identities = "<sd:"+SESSION_IDENTITY_NODE+">"+
+					"<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+					mesg.getSessionIdentity().getName()+"\" >"+
+					mesg.getSessionIdentity().getFullId()+
+					"</sd:"+IDENTITY_NODE+">"+
+					"</sd:"+SESSION_IDENTITY_NODE+">";
+			
+			if (mesg.getChannelIdentity() != null) {
+				identities += "<sd:"+CHANNEL_IDENTITY_NODE+">"+
+						"<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+						mesg.getChannelIdentity().getName()+"\" >"+
+						mesg.getChannelIdentity().getFullId()+
+						"</sd:"+IDENTITY_NODE+">"+
+						"</sd:"+CHANNEL_IDENTITY_NODE+">";
+			}
+		} else if (mesg.getMessageIdentities() != null &&
+				mesg.getMessageIdentities().size() > 0) {
+
+			identities += "<sd:"+PRIMARY_IDENTITIES_NODE+">";
+			
+			for (int i=0; i < mesg.getMessageIdentities().size(); i++) {
+				Identity id=(Identity)mesg.getMessageIdentities().get(i);
+
+				identities += "<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+						id.getName()+"\" >";
+				identities += id.getFullId();
+				identities += "</sd:"+IDENTITY_NODE+">";
+			}
+			
+			identities += "</sd:"+PRIMARY_IDENTITIES_NODE+">";
+		}
+		
+		if (mesg.getServiceEndpoint() != null) {
+			endpoint = mesg.getServiceEndpoint().toText(null);
+		}
+		
+		String serviceType=mesg.getServiceType();
+		if (serviceType == null) {
+			serviceType = "";
+		}
+		
+		ret = "<sd:"+MESSAGE_NODE+" "+OPERATION_ATTR+"=\""+
+				(mesg.getOperationName()==null?"":mesg.getOperationName())+
+				"\" "+TYPE_ATTR+"=\""+type+"\" "+fault+
+				messageType+SERVICE_TYPE_ATTR+"=\""+
+				serviceType+"\" ><sd:"+ENDPOINT_NODE+">"+
+				endpoint+"</sd:"+ENDPOINT_NODE+">"+identities+
+				valueText+"</sd:"+MESSAGE_NODE+">";
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method constructs the message payload value for the
+	 * send and receive tracker events. The information is only
+	 * provided if the service tracker is configured to supply
+	 * it, as the performance impact of transporting large
+	 * message payloads in tracker messages would not be appropriate
+	 * for production environments - however it may be useful
+	 * in development and test environments. If the supplied
+	 * message is a multi-part message containing a single part
+	 * then the single part will be extracted and used. If a
+	 * multi-part message with multiple parts, then the map
+	 * textual representation will be provided. If the value is
+	 * a DOM representation, then it will be converted to a
+	 * string. All other situations will rely on the 'toString'
+	 * representation of the value to be appropriate.
+	 * 
+	 * @param mesg The message
+	 * @return The payload
+	 */
+	protected String getMessagePayload(Message mesg) {
+		String ret="";
+		
+		if (m_recordMessagePayload) {
+			Object value=mesg.getValue();
+			if (mesg.isMultiPart() && ((java.util.Map)value).size() == 1) {
+				value = ((java.util.Map)value).values().iterator().next();
+			}
+			
+			if (value instanceof org.w3c.dom.Node) {
+				try {
+					value = XMLUtils.getText((org.w3c.dom.Node)value);
+				} catch(Exception e) {
+					logger.severe("Failed to convert message DOM value" +
+							"to string: "+e);
+					value = "";
+				}
+			}
+			
+			if (value != null) {
+				ret = "<sd:"+VALUE_NODE+">"+value.toString()+
+							"</sd:"+VALUE_NODE+">";
+			}
+		}
+
+		return(ret);
+	}
+	
+	/**
+	 * This method returns the XML text associated with the
+	 * channel.
+	 * 
+	 * @param channel The channel
+	 * @return The channel text
+	 */
+	protected String getChannelText(Channel channel) {
+		
+		if (channel == null) {
+			return("");
+		}
+		
+		StringBuffer identities=new StringBuffer();
+		
+		java.util.Set<Identity> ids=channel.getPrimaryIdentities();
+		
+		if (ids != null && ids.size() > 0) {
+			identities.append("<sd:"+PRIMARY_IDENTITIES_NODE+">");
+			
+			java.util.Iterator<Identity> iter=ids.iterator();
+			while (iter.hasNext()) {
+				Identity id=iter.next();
+				
+				identities.append("<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+						id.getName()+"\" >");
+				identities.append(XMLUtils.encodeXMLString(id.getFullId()));
+				identities.append("</sd:"+IDENTITY_NODE+">");
+			}
+			
+			identities.append("</sd:"+PRIMARY_IDENTITIES_NODE+">");
+		}
+		
+		return("<sd:"+CHANNEL_NODE+" "+NAME_ATTR+"=\""+
+				channel.getName()+"\" "+TYPE_ATTR+"=\""+
+				channel.getType()+"\" >"+
+				identities.toString()+"</sd:"+CHANNEL_NODE+">");
+	}
+	
+	/**
+	 * This method processes the supplied value to deal with any
+	 * unwanted characters that would be inappropriate for an
+	 * XML attribute value.
+	 * 
+	 * @param value The value
+	 * @return The processed value
+	 */
+	protected String processAttributeContents(String value) {
+		String ret=value;
+		
+		ret = ret.replaceAll("\"", "");
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method records the tracker information. This method
+	 * also takes the optional 'message', used to derive session
+	 * identity, if the session does not currently have any
+	 * identity. This situation should only occur if the first
+	 * message to a service is an unexpected message. 
+	 * 
+	 * @param serviceName The service name
+	 * @param serviceVersion The optional service version
+	 * @param session The session
+	 * @param mesg The message
+	 * @param xml The information to be recorded
+	 * @param type The type of information (INFO, WARNING, ERROR)
+	 * @param exc The optional exception
+	 */
+	protected void record(String serviceName, String serviceVersion,
+			Session session, Message mesg, String xml, String type, Throwable exc) {
+		
+		String message=build(serviceName, serviceVersion,
+						session, mesg, xml);
+			
+		publish(serviceName, session, message);
+	}
+	
+	/**
+	 * This method records the tracker information.
+	 * 
+	 * @param serviceName The service name
+	 * @param session The session
+	 * @param xml The information to be recorded
+	 * @param type The type of information (INFO, WARNING, ERROR)
+	 * @param exc The optional exception
+	 */
+	protected void record(String serviceName, Session session,
+				String xml, String type, Throwable exc) {
+		record(serviceName, null, session, null, xml, type, exc);
+	}
+	
+	/**
+	 * This method constructs the service tracker message to be
+	 * published.
+	 * 
+	 * @param serviceName The service name
+	 * @param serviceVersion The optional service version
+	 * @param session The session
+	 * @param mesg The optional message
+	 * @param xml The XML for the current tracker event
+	 * @return The message
+	 */
+	protected String build(String serviceName, String serviceVersion,
+			Session session, Message mesg, String xml) {
+		StringBuffer ret=new StringBuffer();
+		String versionText="";
+		String nameText="";
+		
+		if (serviceName != null) {
+			nameText = NAME_ATTR+"=\""+serviceName+"\" ";
+		}
+		
+		if (serviceVersion != null) {
+			versionText=VERSION_ATTR+"=\""+serviceVersion+"\" ";
+			
+		} else if (session != null && session.getId() != null &&
+				session.getId().getServiceDescriptionVersion() != null) {
+			versionText=VERSION_ATTR+"=\""+
+					session.getId().getServiceDescriptionVersion()+
+						"\" ";
+		}
+		
+		ret.append("<sd:record xmlns:sd=\""+
+				SAVARA_SERVICE_TRACKER_NS+"\" "+nameText+versionText+">");
+		
+		ret.append(getSessionIdentityText(session, mesg));
+		
+		ret.append("<sd:events>");
+		
+		ret.append(xml);
+		
+		ret.append("</sd:events>");
+		ret.append("</sd:record>");
+		
+		return(ret.toString());
+	}
+
+	/**
+	 * This method determines whether message payload will be
+	 * recorded.
+	 * 
+	 * @param bool Whether the message payload is recorded
+	 */
+	public void setRecordMessagePayload(String bool) {
+		logger.info("Record message payload: "+bool);
+		
+		if (bool != null && bool.equalsIgnoreCase("true")) {
+			m_recordMessagePayload = true;
+		} else {
+			m_recordMessagePayload = false;
+		}
+	}
+	
+    private static Logger logger = Logger.getLogger(JMSServiceTracker.class.getName());	
+
+    private boolean m_recordMessagePayload=false;
+    
+	public static final String RECORD_MESSAGE_PAYLOAD = "pi4soa.tracker.messagePayload";
+
+	public static final String INFO="info";
+	public static final String WARNING="warning";
+	public static final String ERROR="error";	
+	
+	public static final String MESSAGE_NODE="message";
+	public static final String DETAILS_NODE="details";
+	public static final String OPERATION_ATTR="operation";
+	public static final String FAULT_ATTR="fault";
+	public static final String NAME_ATTR="name";
+	public static final String TIMESTAMP_ATTR="timestamp";
+	public static final String TYPE_ATTR="type";
+	public static final String MESSAGE_TYPE_ATTR="messageType";
+	public static final String SERVICE_TYPE_ATTR="serviceType";
+	public static final String EXCEPTION_NODE="exception";
+	public static final String SERVICE_INSTANCE_ID_ATTR="serviceInstanceId";
+	public static final String SESSION_ID_ATTR="sessionId";
+	public static final String PARENT_SESSION_ID_ATTR="parentSessionId";
+	
+	public static final String VERSION_ATTR = "version";
+	public static final String FAULT_RPC_MESSAGE_TYPE = "fault";
+	public static final String RESPONSE_RPC_MESSAGE_TYPE = "response";
+	public static final String REQUEST_RPC_MESSAGE_TYPE = "request";
+	public static final String MESSAGE_STYLE_MESSAGE_TYPE = "message";
+	public static final String SESSION_IDENTITY_NODE = "sessionIdentity";
+	public static final String CHANNEL_IDENTITY_NODE = "channelIdentity";
+	public static final String IDENTITY_NODE = "identity";
+	public static final String PRIMARY_IDENTITIES_NODE = "primaryIdentities";
+	public static final String ENDPOINT_NODE = "endpoint";
+	public static final String CHANNEL_NODE = "channel";
+	public static final String VALUE_NODE = "value";
+
+	protected static final String TRACKER_JNDI_INITIAL_CONTEXT_FACTORY_PROPERTY = "pi4soa.tracker.jndi.initialContextFactory";
+	protected static final String TRACKER_JNDI_PROVIDER_URL_PROPERTY = "pi4soa.tracker.jndi.providerURL";
+	protected static final String TRACKER_JNDI_FACTORY_URL_PACKAGES_PROPERTY = "pi4soa.tracker.jndi.factoryURLPackages";
+	protected static final String TRACKER_JMS_TOPIC_CONNECTION_FACTORY_PROPERTY = "pi4soa.tracker.jms.topicConnectionFactory";
+	protected static final String TRACKER_JMS_TOPIC_PROPERTY = "pi4soa.tracker.jms.topic";
+	protected static final String TRACKER_JMS_CONNECTION_FACTORY_PROPERTY = "pi4soa.tracker.jms.connectionFactory";
+	protected static final String TRACKER_JMS_CONNECTION_FACTORY_ALTERNATE_PROPERTY = "pi4soa.tracker.jms.connectionFactoryAlternate";
+	protected static final String TRACKER_JMS_DESTINATION_PROPERTY = "pi4soa.tracker.jms.destination";
+	protected static final String TRACKER_JMS_CLIENT_ID_PROPERTY = "pi4soa.tracker.jms.clientId";
+	protected static final String TRACKER_JMS_DURABLE_SUBSCRIPTION_PROPERTY = "pi4soa.tracker.jms.durableSubscription";
+
+	private boolean m_initialized=false;
+	private String m_jndiInitialContextFactory=null;
+	private String m_jndiProviderURL=null;
+	private String m_jndiFactoryURLPackages=null;
+	private String m_jmsConnectionFactory=null;
+	private String m_jmsConnectionFactoryAlternate=null;
+	private String m_jmsDestination=null;
+	
+	private javax.jms.Connection m_connection=null;
+	private javax.jms.Session m_session=null;
+	private javax.jms.MessageProducer m_producer=null;
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceRecorder.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceRecorder.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceRecorder.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,159 @@
+/*
+ * 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.validator.pi4soa;
+
+import org.apache.log4j.Logger;
+
+import org.savara.validator.AbstractServiceValidator;
+import org.savara.validator.ValidatorName;
+import org.pi4soa.common.util.MessageUtil;
+import org.pi4soa.service.ServiceException;
+import org.pi4soa.service.behavior.*;
+import org.pi4soa.service.monitor.*;
+
+/**
+ * This class implements the pi4soa service validator responsible for
+ * recording a stream of ESB messages.
+ */
+public class Pi4SOAServiceRecorder extends AbstractServiceValidator {
+
+	/**
+	 * This is the constructor for the pi4soa service
+	 * recorder implementation.
+	 * 
+	 * @param name The validator name
+	 */
+	public Pi4SOAServiceRecorder(ValidatorName name) {
+		super(name);
+		
+		initialize();
+	}
+	
+	/**
+	 * This method initializes the service recorder.
+	 */
+	protected void initialize() {
+		try {
+			// Use XML configuration, to enable alternative
+			// runtime configuration to be specified by
+			// including a pi4soa.xml file in the environment
+			DefaultMonitorConfiguration conf=
+				new XMLMonitorConfiguration();
+			
+			conf.setValidateBehaviour(getValidatorName().isValidate());
+
+			m_monitor = ServiceMonitorFactory.getServiceMonitor(conf);
+			
+			ServiceDescription sdesc=BehaviorFactory.eINSTANCE.createServiceDescription();
+			sdesc.setName(getValidatorName().getRole());
+			
+			// Register service description
+			m_monitor.getConfiguration().getServiceRepository().
+						addServiceDescription(sdesc);
+			
+			logger.debug("Created monitor for service description "+sdesc.getFullyQualifiedName());
+			
+		} catch(Exception e) {
+			logger.error("Failed to initialize service monitor: "+e);
+		}
+	}
+	
+	/**
+	 * This method returns the model type associated with this
+	 * service recorder.
+	 * 
+	 * @return The model type
+	 */
+	public static String getModelType() {
+		return(ValidatorName.NO_MODEL_TYPE);
+	}
+	
+	/**
+	 * This method is called to update the model associated
+	 * with the service validator.
+	 */
+	public void update() {
+	}
+	
+	/**
+	 * This method processes a sent message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process sent message 
+	 */
+	public void messageSent(String mesgType, java.io.Serializable msg) throws Exception {
+     	
+    	if (msg == null) {
+    		throw new ServiceException("Failed to obtain value from message: "+msg);
+    	}
+    	
+    	if (mesgType == null) {
+    		mesgType = MessageUtil.getMessageType(msg);
+    	}
+
+    	org.pi4soa.service.Message mesg=
+    			m_monitor.createMessage(mesgType,
+    				null, null, msg, null, null);
+    	
+    	synchronized(m_monitor) {
+    		m_monitor.messageSent(mesg);
+    	}
+	}
+	
+	/**
+	 * This method processes a received message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process received message 
+	 */
+	public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception {
+     	
+    	if (msg == null) {
+    		throw new ServiceException("Failed to obtain value from message: "+msg);
+    	}
+    	
+    	if (mesgType == null) {
+    		mesgType = MessageUtil.getMessageType(msg);
+    	}
+
+    	org.pi4soa.service.Message mesg=
+    			m_monitor.createMessage(mesgType,
+    				null, null, msg, null, null);
+    	
+    	synchronized(m_monitor) {
+    		m_monitor.messageReceived(mesg); 
+    	}
+	}
+	
+	/**
+	 * This method closes the service validator.
+	 * 
+	 * @throws Exception Failed to close the service validator
+	 */
+	public void close() throws Exception {
+		m_monitor.close();
+	}
+
+	private static final Logger logger = Logger.getLogger(Pi4SOAServiceRecorder.class);
+
+	private org.pi4soa.service.monitor.ServiceMonitor m_monitor=null;
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceValidator.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAServiceValidator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -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.validator.pi4soa;
+
+import org.apache.log4j.Logger;
+
+import org.savara.validator.AbstractServiceValidator;
+import org.savara.validator.ValidatorName;
+import org.pi4soa.common.util.MessageUtil;
+import org.pi4soa.service.ServiceException;
+import org.pi4soa.service.behavior.*;
+import org.pi4soa.service.monitor.*;
+
+/**
+ * This class implements the pi4soa service validator responsible for
+ * validating a stream of ESB messages against a choreography model.
+ */
+public class Pi4SOAServiceValidator extends AbstractServiceValidator {
+
+	private static final String CDM_MODEL_TYPE = "cdm";
+
+	/**
+	 * This is the constructor for the pi4soa service
+	 * validator implementation.
+	 * 
+	 * @param name The validator name
+	 * @throws Exception Failed to initialize service validator
+	 */
+	public Pi4SOAServiceValidator(ValidatorName name)
+						throws Exception {
+		super(name);
+		
+		update();
+	}
+	
+	/**
+	 * This method returns the model type associated with this
+	 * service validator.
+	 * 
+	 * @return The model type
+	 */
+	public static String getModelType() {
+		return CDM_MODEL_TYPE;
+	}
+	
+	/**
+	 * This method is called to update the model associated
+	 * with the service validator.
+	 * 
+	 * @throws Exception Failed to update the service validator
+	 */
+	public void update() throws Exception {
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("Update: "+getValidatorName());
+		}
+		
+		java.io.InputStream is=getModel();
+		
+		if (is != null) {
+			org.pi4soa.service.behavior.ServiceDescription sdesc=
+				org.pi4soa.service.util.DescriptionRetrievalUtil.instance().getServiceDescription(is,
+								getValidatorName().getRole());
+			
+			try {
+				is.close();
+			} catch(Exception e) {
+				logger.error("Failed to close model '"+
+						getValidatorName()+"' input stream", e);
+			}
+
+	       	if (sdesc != null) {
+				
+				if (m_monitor == null) {
+					
+					if (logger.isDebugEnabled()) {
+						logger.debug("Service monitor for '"+
+									sdesc.getFullyQualifiedName()+
+									"' being created");
+					}
+
+					try {
+						// Use XML configuration, to enable alternative
+						// runtime configuration to be specified by
+						// including a pi4soa.xml file in the environment
+						DefaultMonitorConfiguration conf=
+							new XMLMonitorConfiguration();
+						
+						conf.setValidateBehaviour(getValidatorName().isValidate());
+
+						m_monitor = ServiceMonitorFactory.getServiceMonitor(conf);
+						
+						// Register service description
+						m_monitor.getConfiguration().getServiceRepository().
+									addServiceDescription(sdesc);
+						
+						logger.debug("Created monitor for service description "+sdesc.getFullyQualifiedName());
+
+					} catch(Exception e) {
+						logger.error("Failed to initialize service monitor: "+e);
+					}
+				} else {
+					
+			    	synchronized(m_monitor) {
+						// Service monitor already in use for the service
+						// description, so update description
+						try {
+							// Clear previous version of the service description
+							ServiceDescription[] sdescs=
+								m_monitor.getConfiguration().getServiceRepository().getServiceDescriptions();
+							
+							for (int i=0; sdescs != null && i < sdescs.length; i++) {
+								m_monitor.getConfiguration().getServiceRepository().
+											removeServiceDescription(sdescs[i]);
+							}
+							
+							logger.debug("Updating service description for "+sdesc.getFullyQualifiedName());
+							
+							m_monitor.getConfiguration().getServiceRepository().addServiceDescription(sdesc);
+						} catch(Exception e) {
+							logger.error("Failed to update service description '"+
+											sdesc.getFullyQualifiedName()+"'", e);
+						}
+			    	}
+				}
+			} else {
+				logger.error("Unable to obtain service description for validator '"+
+								getValidatorName()+"'");
+	       	}
+		} else {
+			logger.error("Unable to obtain model for validator '"+
+							getValidatorName()+"'");
+			
+			throw new java.io.IOException("Failed to locate model '"+
+					getValidatorName().getModelName()+"'");
+		}
+	}
+	
+	/**
+	 * This method processes a sent message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process sent message 
+	 */
+	public void messageSent(String mesgType, java.io.Serializable msg) throws Exception {
+    	
+    	if (msg == null) {
+    		throw new ServiceException("Failed to obtain value from message: "+msg);
+    	}
+    	
+    	if (mesgType == null) {
+    		mesgType = MessageUtil.getMessageType(msg);
+    	}
+    	
+    	org.pi4soa.service.Message mesg=
+    			m_monitor.createMessage(mesgType,
+    				null, null, msg, null, null);
+    	
+    	synchronized(m_monitor) {
+    		m_monitor.messageSent(mesg);
+    	}
+	}
+	
+	/**
+	 * This method processes a received message against a service
+	 * behavioural description.
+	 * 
+	 * @param mesgType The optional message type
+	 * @param msg The message
+	 * @throws Exception Failed to process received message 
+	 */
+	public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception {
+    	
+    	if (msg == null) {
+    		throw new ServiceException("Failed to obtain value from message: "+msg);
+    	}
+    	
+    	if (mesgType == null) {
+    		mesgType = MessageUtil.getMessageType(msg);
+    	}
+
+    	org.pi4soa.service.Message mesg=
+    			m_monitor.createMessage(mesgType,
+    				null, null, msg, null, null);
+    	
+    	synchronized(m_monitor) {
+    		m_monitor.messageReceived(mesg); 
+    	}
+	}
+	
+	/**
+	 * This method closes the service validator.
+	 * 
+	 * @throws Exception Failed to close the service validator
+	 */
+	public void close() throws Exception {
+		m_monitor.close();
+	}
+
+	private static final Logger logger = Logger.getLogger(Pi4SOAServiceValidator.class);
+
+	private org.pi4soa.service.monitor.ServiceMonitor m_monitor=null;
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAValidatorConfigLoader.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAValidatorConfigLoader.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/Pi4SOAValidatorConfigLoader.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,70 @@
+/*
+ * 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.validator.pi4soa;
+
+import org.savara.validator.DefaultValidatorConfig;
+import org.savara.validator.ValidatorConfig;
+import org.savara.validator.ValidatorConfigLoader;
+
+/**
+ * This class provides the pi4soa implementation of the
+ * validator config loader.
+ */
+public class Pi4SOAValidatorConfigLoader implements ValidatorConfigLoader {
+
+	public static final String PI4SOA_MODEL_TYPE="cdm";
+	
+	/**
+	 * This method determines if the validator config loader
+	 * implementation supports the supplied model type.
+	 *  
+	 * @param modelType The model type
+	 * @return Whether the loader supports the model type
+	 */
+	public boolean isSupported(String modelType) {
+		return(PI4SOA_MODEL_TYPE.equals(modelType));
+	}
+	
+	/**
+	 * This method loads the validator config, contained within
+	 * the supplied input stream representing a model of the
+	 * supported type.
+	 * 
+	 * @param is The input stream
+	 * @param modelPath The path to the model file
+	 * @return The validator config
+	 * @throws java.io.IOException Failed to load validator config
+	 */
+	public ValidatorConfig loadValidatorConfig(java.io.InputStream is,
+					String modelPath) throws java.io.IOException {
+		ValidatorConfig ret=null;
+		
+		org.pi4soa.cdl.Package cdlpack=
+			org.pi4soa.service.util.DescriptionRetrievalUtil.instance().getCDLPackage(is);
+		
+		ValidatorConfigGenerator generator=new ValidatorConfigGenerator();
+		
+		org.w3c.dom.Element validator=
+				generator.generate(cdlpack, modelPath);
+		
+		ret = new DefaultValidatorConfig(PI4SOA_MODEL_TYPE,
+					validator);
+		
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/ValidatorConfigGenerator.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/ValidatorConfigGenerator.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/pi4soa/ValidatorConfigGenerator.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,322 @@
+/*
+ * 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.validator.pi4soa;
+
+import java.util.Collections;
+import org.apache.log4j.Logger;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jboss.util.xml.DOMWriter;
+import org.pi4soa.cdl.*;
+import org.pi4soa.common.annotations.*;
+import org.pi4soa.common.xml.XMLUtils;
+
+/**
+ * This class provides a generator for the JBossESB Validator
+ * configuration.
+ */
+public class ValidatorConfigGenerator {
+
+	private static final String VALIDATE_ATTR = "validate";
+	private static final String ROLE_ATTR = "role";
+	private static final String MODEL_ATTR = "model";
+	private static final String SERVICE_ELEMENT = "service";
+	private static final String VALIDATOR_ELEMENT = "validator";
+
+	public static void main(String[] args) {
+		if (args.length != 1) {
+			System.err.println("Usage: ValidatorConfigGenerator cdmPath");
+			System.exit(1);
+		}
+		
+		try {
+			java.io.FileInputStream is=new java.io.FileInputStream(args[0]);
+			
+			org.pi4soa.cdl.Package cdlpack=org.pi4soa.cdl.CDLManager.load(is);
+			
+			is.close();
+			
+			ValidatorConfigGenerator gen=new ValidatorConfigGenerator();
+			
+			org.w3c.dom.Element config=gen.generate(cdlpack, args[0]);
+			
+			System.out.println("CONFIG:\r\n"+XMLUtils.getText(config, true));
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * The default constructor.
+	 */
+	public ValidatorConfigGenerator() {
+	}
+	
+	/**
+	 * This method generates the validator configuration associated
+	 * with the supplied choreography.
+	 * 
+	 * @param cdlpack The CDL package
+	 * @param model The model (choreography file name)
+	 * @return The validator config
+	 */
+	public org.w3c.dom.Element generate(org.pi4soa.cdl.Package cdlpack,
+					String model) {
+		org.w3c.dom.Element ret=null;
+		
+		try {
+			ret = createValidatorConfig();
+		
+			// Create the new entries for the supplied choreography
+			if (cdlpack != null) {
+				createEntries(ret, model, cdlpack);
+			} else {
+				logger.error("Choreography not supplied for '"+model+"'");
+			}
+			
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug(DOMWriter.printNode(ret, true));
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method creates the initial template for the 
+	 * validator config.
+	 * 
+	 * @return The initial validator config
+	 * @throws Exception Failed to generate validator config
+	 */
+	protected org.w3c.dom.Element createValidatorConfig()
+							throws Exception {
+		org.w3c.dom.Element ret=null;
+		
+		org.w3c.dom.Document doc=
+				javax.xml.parsers.DocumentBuilderFactory.
+				newInstance().newDocumentBuilder().newDocument();
+		
+		ret = doc.createElement(VALIDATOR_ELEMENT);
+		
+		doc.appendChild(ret);
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method creates the entries in the validator config.
+	 * 
+	 * @param validator The validator config
+	 * @param model The model
+	 * @param cdlpack The choreography description
+	 */
+	protected void createEntries(org.w3c.dom.Element validator,
+						String model, org.pi4soa.cdl.Package cdlpack) {
+		
+		for (int i=0; i < cdlpack.getTypeDefinitions().getParticipantTypes().size(); i++) {
+			org.pi4soa.cdl.ParticipantType ptype=
+				cdlpack.getTypeDefinitions().getParticipantTypes().get(i);
+			
+			org.w3c.dom.Element service=
+				validator.getOwnerDocument().createElement(SERVICE_ELEMENT);
+		
+			service.setAttribute(MODEL_ATTR, model);
+			service.setAttribute(ROLE_ATTR, ptype.getName());
+			service.setAttribute(VALIDATE_ATTR, Boolean.TRUE.toString());
+			
+			cdlpack.visit(new InputOutputAnalyser(ptype, service));
+
+			if (service.getFirstChild() != null) {
+				validator.appendChild(service);
+			}
+		}
+	}
+	
+	private static Logger logger = Logger.getLogger(ValidatorConfigGenerator.class);
+
+	public class InputOutputAnalyser extends DefaultCDLVisitor {
+		
+		private static final String DESTINATION_TYPE_ENDPOINT_ADDRESS = "endpoint address";
+		private static final String TYPE_ATTR = "type";
+		private static final String DYNAMIC_REPLY_TO_ATTR = "dynamicReplyTo";
+		private static final String VALIDATOR_ANNOTATION = "validator";
+		private static final String VALIDATOR_ELEMENT = "validator";
+		private static final String DESTINATION_ELEMENT = "destination";
+		private static final String NAME_ATTR = "name";
+		private static final String EPR_ATTR = "epr";
+		private static final String INPUT_ELEMENT = "input";
+		private static final String OUTPUT_ELEMENT = "output";
+		
+		public InputOutputAnalyser(org.pi4soa.cdl.ParticipantType ptype,
+							org.w3c.dom.Element service) {
+			m_participantType = ptype;
+			m_service = service;
+			
+			m_templateProcessor =
+				org.pi4soa.common.annotations.AnnotationsManagerFactory.getAnnotationsManager().getTemplateProcessor(VALIDATOR_ANNOTATION);
+		}
+		
+		/**
+		 * This method inspects the supplied interaction.
+		 * 
+		 */
+		public void interaction(Interaction interaction) {
+			if (m_participantType.getRoleTypes().contains(interaction.getFromRoleType()) ||
+					(interaction.getFromParticipant() != null &&
+						Collections.disjoint(m_participantType.getRoleTypes(),
+								interaction.getFromParticipant().getRoleTypes()) == false)) {
+				
+				for (int i=0; i < interaction.getExchangeDetails().size(); i++) {
+					processExchangeDetails(interaction.getExchangeDetails().get(i), true);
+				}
+			} else if (m_participantType.getRoleTypes().contains(interaction.getToRoleType()) ||
+					(interaction.getToParticipant() != null &&
+							Collections.disjoint(m_participantType.getRoleTypes(),
+									interaction.getToParticipant().getRoleTypes()) == false)) {
+				for (int i=0; i < interaction.getExchangeDetails().size(); i++) {
+					processExchangeDetails(interaction.getExchangeDetails().get(i), false);
+				}
+			}
+		}
+		
+		/**
+		 * This method checks the supplied exchange details to determine
+		 * if there is a 'jbossesb' annotation containing information
+		 * about a destination to be validated.
+		 * 
+		 * @param details The exchange details
+		 * @param from Whether the 'from' details should be checked,
+		 * 				otherwise the 'to' details will be checked
+		 */
+		protected void processExchangeDetails(ExchangeDetails details, boolean from) {
+
+			for (int i=0; i < details.getSemanticAnnotations().size(); i++) {
+				SemanticAnnotation sa=details.getSemanticAnnotations().get(i);
+				org.w3c.dom.Element dest=null;
+				
+				if (sa.getAnnotation() != null && sa.getName() != null &&
+						sa.getName().equals(VALIDATOR_ANNOTATION)) {
+					try {
+						// Transform the text representation to DOM
+						DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+						fact.setNamespaceAware(true);
+						
+						DocumentBuilder builder=fact.newDocumentBuilder();
+						org.w3c.dom.Document doc=
+								builder.parse(new java.io.ByteArrayInputStream(
+										sa.getAnnotation().getBytes()));
+						
+						if (doc.getDocumentElement() != null &&
+								doc.getDocumentElement().getNodeName().equals(
+											VALIDATOR_ELEMENT)) {
+							org.w3c.dom.NodeList nl=
+								doc.getDocumentElement().getElementsByTagName(DESTINATION_ELEMENT);
+							
+							if (nl.getLength() == 1) {
+								dest = (org.w3c.dom.Element)nl.item(0);
+							} else if (nl.getLength() > 1) {
+								logger.error("Too many destination elements ("+
+										nl.getLength()+") found");
+							} else {
+								logger.error("No destinations found");
+							}
+						}
+						
+					} catch(Exception e) {
+						logger.error("Failed to load validator annotation", e);
+					}
+				}
+				
+				if (dest != null) {
+					processDestination(details, dest, from);
+				}
+			}
+		}
+				
+		/**
+		 * This method processes the destination information
+		 * associated with the exchange details.
+		 * 
+		 * @param details The exchange details
+		 * @param dest The destination DOM element
+		 * @param from Whether the 'from' or 'to' role should
+		 * 					be considered
+		 */
+		protected void processDestination(ExchangeDetails details,
+					org.w3c.dom.Element dest, boolean from) {
+			String elemName=null;
+			
+			if (dest != null) {
+				if (from) {
+					if (details.getAction() == ExchangeActionType.REQUEST) {
+						elemName = OUTPUT_ELEMENT;
+					} else if (dest.getAttribute(TYPE_ATTR).trim().length() == 0 ||
+							dest.getAttribute(TYPE_ATTR).equals(DESTINATION_TYPE_ENDPOINT_ADDRESS)) {
+						elemName = INPUT_ELEMENT;
+					}
+				} else {
+					if (details.getAction() == ExchangeActionType.REQUEST) {
+						elemName = INPUT_ELEMENT;
+					} else if (dest.getAttribute(TYPE_ATTR).trim().length() == 0 ||
+							dest.getAttribute(TYPE_ATTR).equals(DESTINATION_TYPE_ENDPOINT_ADDRESS)) {
+						elemName = OUTPUT_ELEMENT;
+					}
+				}
+				
+				if (elemName != null) {
+					org.w3c.dom.Element elem=m_service.getOwnerDocument().createElement(elemName);
+					
+					// Parameter has been stored in a structured manner
+					// to support use of templates and presentations,
+					// so need to extract the value
+					java.util.List<TemplateParameter> params=
+						m_templateProcessor.getTemplateParameters(dest.getAttribute(NAME_ATTR));
+					
+					if (params != null && params.size() > 0) {
+						elem.setAttribute(EPR_ATTR, params.get(0).getValue());
+					}
+					
+					if (dest.hasAttribute(DYNAMIC_REPLY_TO_ATTR)) {
+						params=m_templateProcessor.getTemplateParameters(dest.getAttribute(DYNAMIC_REPLY_TO_ATTR));
+					
+						if (params != null && params.size() > 0) {
+					
+							if (params.get(0).getValue().equalsIgnoreCase("true")) {
+								elem.setAttribute(DYNAMIC_REPLY_TO_ATTR, "true");
+							}
+						}
+					}
+					
+					if (elem.hasAttribute(EPR_ATTR)) {
+						m_service.appendChild(elem);
+					}
+				}
+			}
+		}
+
+		private ParticipantType m_participantType=null;
+		private org.w3c.dom.Element m_service=null;
+		private org.pi4soa.common.annotations.TemplateProcessor m_templateProcessor=null;
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.service;
+
+import java.util.logging.Logger;
+
+import org.savara.validator.ServiceValidator;
+import org.savara.validator.ServiceValidatorManager;
+import org.jboss.util.naming.NonSerializableFactory;
+
+import javax.naming.*;
+
+/**
+ * This is the JBoss Savara Service Validator Service managing the Service Validator.
+ *
+ * @author gbrown
+ *
+ */
+public class ServiceValidatorService extends org.jboss.system.ServiceMBeanSupport implements ServiceValidatorServiceMBean {
+
+	private final static Logger logger = Logger.getLogger(ServiceValidatorService.class.getName());
+
+	private String m_jndiName=null;
+	private ServiceValidatorManager m_serviceValidatorManager=null;
+  
+	/**
+	 * The default constructor.
+	 */
+	public ServiceValidatorService() {
+	}
+
+	/**
+	 * This method starts the service, instantiating the
+	 * Service Validation Manager and registering it with JNDI.
+	 */
+	protected void startService() throws Exception {
+		logger.info("Starting Savara Service Validator Manager");
+
+		m_serviceValidatorManager = new ServiceValidatorManager();
+
+		rebind();
+	}
+
+	/**
+	 * This method stops the service, closing the
+	 * Service Validation Manager and unregistering it from JNDI.
+	 */
+	protected void stopService() throws Exception {
+		logger.info("Stopping Savara Service Validator Manager");
+
+		unbind(m_jndiName);
+
+		m_serviceValidatorManager.close();
+
+		m_serviceValidatorManager = null;
+	}
+
+	/**
+	 * This method returns the JNDI name used to register the
+	 * Service Validation Manager.
+	 */
+	public String getJndiName() {
+		return m_jndiName;
+	}
+
+	/**
+	 * This method sets the JNDI name associated with the
+	 * BPEL engine.
+	 *
+	 * @param jndiName The JNDI name
+	 * @throws NamingException Failed to register BPEL engine against
+	 * 					the JNDI name
+	 */
+	public void setJndiName(String jndiName) throws NamingException {
+		String oldName = m_jndiName;
+		m_jndiName = jndiName;
+
+		if (super.getState() == STARTED) {
+			unbind(oldName);
+			try {
+				rebind();
+			} catch(Exception e) {
+				NamingException ne = new NamingException("Failed to update jndiName");
+				ne.setRootCause(e);
+				throw ne;
+			}
+		}
+	}
+
+	private void rebind() throws NamingException {
+		InitialContext rootCtx = new InitialContext();
+		Name fullName = rootCtx.getNameParser("").parse(m_jndiName);
+		logger.info("fullName="+fullName);
+		NonSerializableFactory.rebind(fullName, m_serviceValidatorManager, true);
+	}
+
+	private void unbind(String jndiName) {
+		try {
+			InitialContext rootCtx = new InitialContext();
+			rootCtx.unbind(jndiName);
+			NonSerializableFactory.unbind(jndiName);
+		} catch(NamingException e) {
+			logger.severe("Failed to unbind map: "+e);
+		}
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.service;
+
+import javax.naming.NamingException;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * The MBean for the Service Validator Service.
+ * 
+ * @author gbrown
+ *
+ */
+public interface ServiceValidatorServiceMBean extends ServiceMBean {
+	
+	/**
+	 * This method returns the JNDI name used to register the
+	 * Service Validator.
+	 */
+    public String getJndiName();
+    
+    /**
+     * This method sets the JNDI name associated with the
+     * Service Validator.
+     * 
+     * @param jndiName The JNDI name
+     * @throws NamingException Failed to register Service Validator against
+     * 					the JNDI name
+     */
+    public void setJndiName(String jndiName) throws javax.naming.NamingException;
+    	
+}

Added: branches/experimental/2.0.x/validators/jboss/esb/pom.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,106 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.validators</groupId>
+	<artifactId>savara-validator-jbossesb</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Validators::JBoss::ESB</name>
+	
+	<parent>
+		<groupId>org.savara.validators</groupId>
+		<artifactId>jboss</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+		<dependencies>	
+			<dependency>
+				<groupId>org.savara.validators</groupId>
+				<artifactId>savara-validator-jboss</artifactId>
+	    		<version>${savara.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>log4j</groupId>
+				<artifactId>log4j</artifactId>
+	    		<version>${log4j.version}</version>
+				<scope>provided</scope>
+			</dependency>
+			<dependency>
+				<groupId>org.jboss.savara.dependencies.esb</groupId>
+				<artifactId>jbossesb-rosetta</artifactId>
+	    		<version>${rosetta.version}</version>
+				<scope>provided</scope>
+			</dependency>
+			<dependency>
+				<groupId>junit</groupId>
+				<artifactId>junit</artifactId>
+            	<version>${junit.version}</version>
+				<scope>test</scope>
+			</dependency>
+
+		</dependencies>
+	
+	<build>
+		<plugins>
+		  <plugin>
+	        <artifactId>maven-assembly-plugin</artifactId>
+	        <executions>
+	          <execution>
+	            <id>dist</id>
+	            <phase>package</phase>
+	            <goals>
+	              <goal>single</goal>
+	            </goals>
+	            <configuration>
+	              <finalName>savara-validator-jbossesb.esb</finalName>
+	              <appendAssemblyId>true</appendAssemblyId>
+	              <descriptors>
+	                <descriptor>src/main/configs/esb-assembly.xml</descriptor>
+	              </descriptors>
+	            </configuration>
+	          </execution>
+	        </executions>
+	      </plugin>
+		  <plugin>
+			<artifactId>maven-javadoc-plugin</artifactId>
+			<executions>
+			  <execution>
+			    <id>generate-javadoc</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>jar</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<configuration>
+			  <doclet>org.jboss.apiviz.APIviz</doclet>
+			  <docletArtifact>
+			    <groupId>org.jboss.apiviz</groupId>
+			    <artifactId>apiviz</artifactId>
+			    <version>1.2.4.GA</version>
+			  </docletArtifact>
+			  <aggregate>true</aggregate>
+			  <attach>false</attach>
+			  <additionalparam>
+			    -d ${project.build.directory}/javadoc
+			    -charset UTF-8
+			    -docencoding UTF-8
+			    -version
+			    -author
+			    -breakiterator
+			    -windowtitle "${project.name} ${project.version} API Reference"
+			    -doctitle "${project.name} ${project.version} API Reference"
+			    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+			    -link http://java.sun.com/javase/6/docs/api/
+			    -sourceclasspath ${project.build.outputDirectory}
+			  </additionalparam>
+			  <encoding>UTF-8</encoding>
+			  <locale>en_US</locale>
+			</configuration>
+		   </plugin>
+	    </plugins>
+	</build>
+	
+</project>
+

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/deployment.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/deployment.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/deployment.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+  <depends>jboss.esb:deployment=jbossesb.esb</depends>
+  <depends>jboss.savara:service=ServiceValidatorManager</depends>
+</jbossesb-deployment>

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-esb.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-esb.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-esb.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,6 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+     <!--
+     		jbossesb internal services 
+     -->
+</jbossesb>

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-scanning.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-scanning.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-scanning.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+	<!-- prevent scanning for annotations -->
+</scanning>

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-structure.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-structure.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/META-INF/jboss-structure.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<structure>
+    <context>
+        <path name=""/>
+        <metaDataPath>
+            <path name="META-INF"/>
+        </metaDataPath>        
+        <classpath>
+            <path name=""/>
+            <path name="" suffixes=".jar" />
+            <path name="lib" suffixes=".jar" />
+        </classpath>
+    </context>
+</structure>

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/esb-assembly.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/esb-assembly.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/configs/esb-assembly.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,27 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+  <id>dist</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>src/main/configs</directory>
+      <outputDirectory>/</outputDirectory>
+      <excludes>
+        <exclude>esb-assembly.xml</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
+  
+     <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+            <includes>
+               <include>org.savara.validators:savara-validator-jbossesb</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+  
+</assembly>

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,135 @@
+/*
+ * 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.validator.jbossesb;
+
+import org.apache.log4j.Logger;
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.NameSpaceUtil;
+import org.pi4soa.common.xml.XMLUtils;
+
+/**
+ * This class provides utility functions for processing
+ * ESB messages.
+ */
+public class ESBUtil {
+
+	public static final String SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
+
+	/**
+	 * This method returns the message content associated
+	 * with the supplied JBoss ESB message.
+	 * 
+	 * @param message The esb message
+	 * @return The message content
+	 */
+	public static java.io.Serializable getMessage(
+			org.jboss.soa.esb.message.Message message) {
+		java.io.Serializable ret=null;
+		
+		ret = (java.io.Serializable)message.getBody().get();
+
+		// Check if should return a multipart message
+		if (ret == null) {
+			
+			// Check if single or multipart message
+			if (message.getBody().getNames() != null &&
+					message.getBody().getNames().length == 1) {
+				
+				Object mesg=message.getBody().get(message.getBody().getNames()[0]);
+				
+				if (logger.isDebugEnabled()) {
+					logger.debug("MESSAGE("+
+							message.getBody().getNames()[0]+")="+mesg);
+				}
+				
+				if (mesg instanceof java.io.Serializable) {
+					ret = (java.io.Serializable)mesg;
+				}
+				
+			} else if (message.getBody().getNames() != null &&
+					message.getBody().getNames().length > 1) {
+				
+				java.util.Hashtable<String,Object> multipart=
+							new java.util.Hashtable<String,Object>();
+				
+				for (int i=0; i < message.getBody().getNames().length; i++) {
+					multipart.put(message.getBody().getNames()[i],
+							message.getBody().get(message.getBody().getNames()[i]));
+				}
+				
+				ret = multipart;
+			}
+		}
+		
+		if (ret instanceof byte[]) {
+			ret = new String((byte[])ret);
+		}
+		
+		ret = getBody(ret);
+		
+		return(ret);
+	}
+	
+	public static java.io.Serializable getBody(java.io.Serializable value) {
+		java.io.Serializable ret=null;
+		
+		if (value instanceof org.w3c.dom.Element &&
+				((org.w3c.dom.Element)value).getLocalName().equals("Envelope") &&
+				((org.w3c.dom.Element)value).getNamespaceURI().equals(
+								SOAP_ENVELOPE)) {
+			
+			org.w3c.dom.NodeList bodylist=((org.w3c.dom.Element)value).
+						getElementsByTagNameNS(SOAP_ENVELOPE, "Body");
+			
+			for (int i=0; ret == null && i < bodylist.getLength(); i++) {
+				if (bodylist.item(i) instanceof org.w3c.dom.Element &&
+						bodylist.item(i).getLocalName().equals("Body")) {
+					org.w3c.dom.NodeList children=((org.w3c.dom.Element)bodylist.item(i)).getChildNodes();
+				
+					for (int j=0; ret == null && j < children.getLength(); j++) {
+						if (children.item(j) instanceof org.w3c.dom.Element) {
+							ret = (java.io.Serializable)children.item(j);
+						}
+					}
+				}
+			}
+		} else if (value instanceof String) {
+			
+			try {
+				org.w3c.dom.Node node=XMLUtils.getNode((String)value);
+				
+				ret = getBody((java.io.Serializable)node);
+				
+				// Convert to string
+				if (ret instanceof org.w3c.dom.Node) {
+					ret = XMLUtils.getText((org.w3c.dom.Node)ret);
+				}
+				
+			} catch(Exception e) {
+				logger.warn("Failed to obtain message body from value: "+value);
+			}
+			
+		} else {
+			ret = value;
+		}
+
+		return(ret);
+	}
+	
+	private static Logger logger = Logger.getLogger(ESBUtil.class);	
+}

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,285 @@
+/*
+ * 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.validator.jbossesb;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+import org.savara.validator.Endpoint;
+import org.savara.validator.ServiceValidator;
+import org.savara.validator.ServiceValidatorManager;
+import org.jboss.soa.esb.message.*;
+import org.jboss.soa.esb.couriers.*;
+
+/**
+ * This class represents the filter used to intercept ESB
+ * messages an apply them to relevant Service Validators.
+ */
+public class JBossESBInterceptor extends org.jboss.soa.esb.filter.InputOutputFilter {
+	
+	private static final String TOPIC_PREFIX = "topic/";
+	private static final String QUEUE_PREFIX = "queue/";
+	private static final String JMS_PROTOCOL_PREFIX = "jms:";
+
+	private static final Logger logger = Logger.getLogger(JBossESBInterceptor.class);
+	
+	private ServiceValidatorManager m_serviceValidatorManager=null;
+	
+	/**
+	 * The default constructor.
+	 */
+	public JBossESBInterceptor() {
+	}
+	
+	/**
+	 * This method returns the service validator manager.
+	 * 
+	 * @return The service validator manager
+	 */
+	protected ServiceValidatorManager getServiceValidatorManager() {
+		if (m_serviceValidatorManager == null) {
+			try {
+				InitialContext ctx = new InitialContext();
+				m_serviceValidatorManager =
+					(ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
+			} catch (NamingException e) {
+				throw new RuntimeException("Failed to locate Savara Service Validator Manager");
+			}
+		}
+		
+		return(m_serviceValidatorManager);
+	}
+	
+	/**
+	 * This method is invoked when a message is sent by an
+	 * ESB service.
+	 * 
+	 * @param msg The ESB message
+	 * @param params The parameters
+	 * @throws CourierException Failed to validate message
+	 */
+	public Message onOutput(Message msg, java.util.Map params)
+			throws CourierException {
+		
+		Endpoint endpoint=getEndpoint(msg);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getOutputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageSent(null, ESBUtil.getMessage(msg));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle sent message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid sent message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		throw new CourierException("Failed to handle sent message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames, ex);
+		        	}
+				} else {
+				
+					// Check whether a dynamic reply is expected
+					if (getServiceValidatorManager().isOutputDynamicReplyTo(endpoint)) {
+						
+						// Register interest in the 'reply-to' endpoint
+						Endpoint replyTo=getReplyToEndpoint(msg);
+						
+						if (replyTo != null) {
+							getServiceValidatorManager().registerInputReplyToValidators(replyTo,
+											validators);
+						} else {
+							logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
+						}
+					}
+				}
+			}
+		}
+	        
+		return(msg);
+	}
+	
+	/**
+	 * This method is invoked when a message is received by an
+	 * ESB service.
+	 * 
+	 * @param msg The ESB message
+	 * @param params The parameters
+	 * @throws CourierException Failed to validate message
+	 */
+	public Message onInput(Message msg, java.util.Map params)
+			throws CourierException {
+		
+		Endpoint endpoint=getEndpoint(msg);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getInputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageReceived(null, ESBUtil.getMessage(msg));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid received message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		throw new CourierException("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames, ex);
+		        	}
+				} else {
+				
+					// Check whether a dynamic reply is expected
+					if (getServiceValidatorManager().isInputDynamicReplyTo(endpoint)) {
+						
+						// Register interest in the 'reply-to' endpoint
+						Endpoint replyTo=getReplyToEndpoint(msg);
+						
+						if (replyTo != null) {
+							getServiceValidatorManager().registerOutputReplyToValidators(replyTo,
+											validators);
+						} else {
+							logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
+						}
+					}
+				}
+			}
+		}
+
+		return(msg);
+	}
+	
+	/**
+	 * This method returns an endpoint associated with the 'to'
+	 * destination of the supplied message.
+	 * 
+	 * @param msg The message
+	 * @return The endpoint, or null if not relevant
+	 */
+	protected Endpoint getEndpoint(Message msg) {
+		Endpoint ret=null;
+		
+		if (msg != null && msg.getHeader() != null && 
+				msg.getHeader().getCall() != null &&
+				msg.getHeader().getCall().getTo() != null &&
+				msg.getHeader().getCall().getTo().getAddr() != null) {
+				
+			String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
+			int ind=-1;
+			
+			if (key.startsWith(JMS_PROTOCOL_PREFIX) && 
+					((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+					(ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+				ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
+			}
+		}
+		
+		logger.debug("Destination for message '"+msg+"' is: "+ret);
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method returns an endpoint associated with the 'to'
+	 * destination of the supplied message.
+	 * 
+	 * @param msg The message
+	 * @return The endpoint, or null if not relevant
+	 */
+	protected Endpoint getReplyToEndpoint(Message msg) {
+		Endpoint ret=null;
+		
+		if (msg != null && msg.getHeader() != null && 
+				msg.getHeader().getCall() != null &&
+				msg.getHeader().getCall().getReplyTo() != null &&
+				msg.getHeader().getCall().getReplyTo().getAddr() != null) {
+				
+			String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
+			int ind=-1;
+			
+			if (key.startsWith(JMS_PROTOCOL_PREFIX) && 
+					((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+					(ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+				ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
+			}
+		}
+		
+		logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
+
+		return(ret);
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ValidatorFilter.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ValidatorFilter.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/main/java/org/savara/validator/jbossesb/ValidatorFilter.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.validator.jbossesb;
+
+/**
+ * 
+ * @deprecated Use JBossESBInterceptor instead
+ */
+public class ValidatorFilter extends JBossESBInterceptor {
+
+	/**
+	 * The default constructor.
+	 */
+	public ValidatorFilter() {
+	}
+	
+}

Added: branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,76 @@
+package org.savara.validator.jbossesb;
+
+import static org.junit.Assert.*;
+
+import org.pi4soa.common.xml.XMLUtils;
+
+public class ESBUtilTest {
+
+	@org.junit.Test
+	public void testGetBodyText() {
+		
+		String mesg="<soap:Envelope xmlns:soap=\""+ESBUtil.SOAP_ENVELOPE+"\" >"+
+			"<soap:Header>"+
+				"<m:Trans xmlns:m=\"http://www.w3schools.com/transaction/\" "+
+						"soap:mustUnderstand=\"1\">234</m:Trans>"+
+			"</soap:Header>"+
+		  	"<soap:Body>"+
+				"<m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">"+
+					"<m:Item>Apples</m:Item>"+
+				"</m:GetPrice>"+
+			"</soap:Body>"+
+			"</soap:Envelope>";
+		
+		String expected="<m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">"+
+							"<m:Item>Apples</m:Item>"+
+						"</m:GetPrice>";
+		
+		java.io.Serializable result=ESBUtil.getBody(mesg);
+		
+		if ((result instanceof String) == false) {
+			fail("Result should be a string");
+		}
+		
+		if (result.equals(expected) == false) {
+			fail("Failed to match body");
+		}
+	}
+	
+	@org.junit.Test
+	public void testGetBodyXML() {
+		
+		String mesg="<soap:Envelope xmlns:soap=\""+ESBUtil.SOAP_ENVELOPE+"\" >"+
+			"<soap:Header>"+
+				"<m:Trans xmlns:m=\"http://www.w3schools.com/transaction/\" "+
+						"soap:mustUnderstand=\"1\">234</m:Trans>"+
+			"</soap:Header>"+
+		  	"<soap:Body>"+
+				"<m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">"+
+					"<m:Item>Apples</m:Item>"+
+				"</m:GetPrice>"+
+			"</soap:Body>"+
+			"</soap:Envelope>";
+		
+		try {
+			org.w3c.dom.Node mesgxml=XMLUtils.getNode(mesg);
+			
+			String expected="<m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">"+
+								"<m:Item>Apples</m:Item>"+
+							"</m:GetPrice>";
+			
+			java.io.Serializable result=ESBUtil.getBody((java.io.Serializable)mesgxml);
+			
+			if ((result instanceof org.w3c.dom.Node) == false) {
+				fail("Result should be a DOM Node");
+			}
+			
+			String resulttext=XMLUtils.getText((org.w3c.dom.Node)result);
+			
+			if (resulttext.equals(expected) == false) {
+				fail("Failed to match body");
+			}
+		} catch(Exception e) {
+			fail("Failed to get body from XML: "+e);
+		}
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/pom.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,25 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara.validators</groupId>
+    <artifactId>jboss</artifactId>
+    <packaging>pom</packaging>
+    <name>Savara::Validators::JBoss</name>
+    <version>2.0.0-SNAPSHOT</version>
+    
+    <parent>
+	  <groupId>org.savara</groupId>
+	  <artifactId>validators</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+    <modules>
+		<module>common</module>
+		<module>esb</module>
+		<module>wsnative</module>
+    </modules>
+
+</project>

Added: branches/experimental/2.0.x/validators/jboss/wsnative/pom.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,119 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.validators</groupId>
+	<artifactId>savara-validator-jbossws-native</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Validators::JBoss::WS-Native</name>
+	
+	<parent>
+		<groupId>org.savara.validators</groupId>
+		<artifactId>jboss</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+
+		<dependencies>	
+			<dependency>
+				<groupId>org.savara.validators</groupId>
+				<artifactId>savara-validator-jboss</artifactId>
+	    		<version>${savara.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>log4j</groupId>
+				<artifactId>log4j</artifactId>
+	    		<version>${log4j.version}</version>
+				<scope>provided</scope>
+			</dependency>
+		    <dependency>
+			  <groupId>org.jboss.jbossas</groupId>
+			  <artifactId>jboss-as-client</artifactId>
+		      <version>${jboss.version}</version>
+			  <type>pom</type>
+			  <scope>provided</scope>
+			</dependency>
+		    <dependency>
+			  <groupId>org.jboss.ws</groupId>
+			  <artifactId>jbossws-framework</artifactId>
+		      <version>${jbossws.version}</version>
+			  <scope>provided</scope>
+			</dependency>
+		    <dependency>
+			  <groupId>org.jboss.ws.native</groupId>
+			  <artifactId>jbossws-native-core</artifactId>
+		      <version>${jbossws.version}</version>
+			  <scope>provided</scope>
+			</dependency>
+			<dependency>
+				<groupId>junit</groupId>
+				<artifactId>junit</artifactId>
+            	<version>${junit.version}</version>
+				<scope>test</scope>
+			</dependency>
+
+		</dependencies>
+	
+	<build>
+		<plugins>
+		  <plugin>
+	        <artifactId>maven-assembly-plugin</artifactId>
+	        <executions>
+	          <execution>
+	            <id>dist</id>
+	            <phase>package</phase>
+	            <goals>
+	              <goal>single</goal>
+	            </goals>
+	            <configuration>
+	              <finalName>savara-validator-jbossws-native.sar</finalName>
+	              <appendAssemblyId>true</appendAssemblyId>
+	              <descriptors>
+	                <descriptor>src/main/configs/ws-native-assembly.xml</descriptor>
+	              </descriptors>
+	            </configuration>
+	          </execution>
+	        </executions>
+	      </plugin>
+		  <plugin>
+			<artifactId>maven-javadoc-plugin</artifactId>
+			<executions>
+			  <execution>
+			    <id>generate-javadoc</id>
+			    <phase>package</phase>
+			    <goals>
+			      <goal>jar</goal>
+			    </goals>
+			  </execution>
+			</executions>
+			<configuration>
+			  <doclet>org.jboss.apiviz.APIviz</doclet>
+			  <docletArtifact>
+			    <groupId>org.jboss.apiviz</groupId>
+			    <artifactId>apiviz</artifactId>
+			    <version>1.2.4.GA</version>
+			  </docletArtifact>
+			  <aggregate>true</aggregate>
+			  <attach>false</attach>
+			  <additionalparam>
+			    -d ${project.build.directory}/javadoc
+			    -charset UTF-8
+			    -docencoding UTF-8
+			    -version
+			    -author
+			    -breakiterator
+			    -windowtitle "${project.name} ${project.version} API Reference"
+			    -doctitle "${project.name} ${project.version} API Reference"
+			    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+			    -link http://java.sun.com/javase/6/docs/api/
+			    -sourceclasspath ${project.build.outputDirectory}
+			  </additionalparam>
+			  <encoding>UTF-8</encoding>
+			  <locale>en_US</locale>
+			</configuration>
+		   </plugin>
+	    </plugins>
+	</build>
+	
+</project>
+

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean class="org.savara.validator.jbosswsnative.service.JBossWSNativeServiceValidatorService"
+        				name="JBossWSNativeServiceValidator">
+    <!--
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.savara:service=ServiceValidatorManager", exposedInterface=org.savara.validator.service.ServiceValidatorServiceMBean.class,registerDirectly=true)</annotation>
+    -->
+    <depends>jboss.savara:service=ServiceValidatorManager</depends>
+  </bean>
+
+</deployment>

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,3 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+	<!-- prevent scanning for annotations -->
+</scanning>

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<structure>
+    <context>
+        <path name=""/>
+        <metaDataPath>
+            <path name="META-INF"/>
+        </metaDataPath>        
+        <classpath>
+            <path name=""/>
+            <path name="" suffixes=".jar" />
+            <path name="lib" suffixes=".jar" />
+        </classpath>
+    </context>
+</structure>

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,27 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+  <id>dist</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>src/main/configs</directory>
+      <outputDirectory>/</outputDirectory>
+      <excludes>
+        <exclude>ws-native-assembly.xml</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
+  
+     <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+            <includes>
+               <include>org.savara.validators:savara-validator-jbossws-native</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+  
+</assembly>

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.validator.jbosswsnative;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.validator.Endpoint;
+import org.savara.validator.ServiceValidatorManager;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * Common abstract base class for the client and server JBossWS
+ * native interceptors.
+ *
+ */
+public abstract class AbstractJBossWSNativeInterceptor extends GenericSOAPHandler {
+
+	private static Log logger = LogFactory.getLog(AbstractJBossWSNativeInterceptor.class);
+
+	private ServiceValidatorManager m_serviceValidatorManager=null;
+
+	/**
+	 * This method returns the service validator manager.
+	 * 
+	 * @return The service validator manager
+	 */
+	protected ServiceValidatorManager getServiceValidatorManager() {
+		if (m_serviceValidatorManager == null) {
+			try {
+				InitialContext ctx = new InitialContext();
+				m_serviceValidatorManager =
+					(ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
+			} catch (NamingException e) {
+				throw new RuntimeException("Failed to locate Savara Service Validator Manager");
+			}
+		}
+		
+		return(m_serviceValidatorManager);
+	}
+	
+	/**
+	 * This method returns the message content.
+	 * 
+	 * @param soapCtx The SOAP message context
+	 * @return The message content
+	 * @throws Exception Failed to get the message content
+	 */
+	public static java.io.Serializable getMessage(SOAPMessageContext soapCtx) throws Exception {
+		java.io.Serializable ret=null;
+				
+		SOAPElement elem = getMessageBody(soapCtx);
+		if (elem != null) {
+			ret = DOMWriter.printNode(elem, true);
+		}
+		
+		return(ret);
+	}
+	
+	/**
+	 * This method determines the message type associated with the supplied SOAP
+	 * message context.
+	 * 
+	 * @param soapCtx The SOAP message context
+	 * @return The message type
+	 * @throws SOAPException Failed to determine the message type
+	 */
+	public static String getMessageType(SOAPMessageContext soapCtx, boolean request) throws SOAPException {
+		String ret=null;
+		
+		if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+			org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+				(org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
+		    org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+		    
+		    if (opmetadata != null) {
+		    	ParameterMetaData pmd=null;
+		    	
+		    	if (request && opmetadata.getInputParameters().size() == 1) {
+			    	pmd = opmetadata.getInputParameters().get(0);	
+		    	} else if (!request && opmetadata.getOutputParameters().size() == 1) {
+			    	pmd = opmetadata.getOutputParameters().get(0);	
+		    	}
+		    	
+		    	if (pmd != null) {
+			    	// TODO: Find out why 'genericParam' is generated when the parameter
+			    	// is a complex type
+					if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
+						
+						// Extract message value
+			            SOAPElement elem=getMessageBody(soapCtx);
+			            
+			            if (elem != null) {
+			            	ret = elem.getElementQName().toString();
+			            }
+	
+					} else {
+						ret = pmd.getXmlName().toString();
+					}
+		    	}
+		    }
+		}
+
+		return(ret);
+	}
+	
+	protected static SOAPElement getMessageBody(SOAPMessageContext soapCtx) throws SOAPException {
+		SOAPElement ret=null;
+		
+		// Extract message value
+        SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
+		
+    	java.util.Iterator<?> iter=soapBody.getChildElements();
+    	while (ret == null && iter.hasNext()) {
+    		Object body=iter.next();
+    		
+    		if (body instanceof SOAPElement) {
+    			ret = (SOAPElement)body;
+    		}
+    	}
+        
+        if (ret instanceof SOAPFault) {
+        	SOAPFault fault=(SOAPFault)ret;
+        	
+        	ret = (SOAPElement)fault.getDetail().getChildElements().next();
+        }
+
+        return(ret);
+	}
+
+	/**
+	 * This method returns the endpoint associated with the supplied SOAP
+	 * message context.
+	 * 
+	 * @param soapCtx The SOAP message context
+	 * @return The endpoint
+	 */
+	public static Endpoint getEndpoint(SOAPMessageContext soapCtx) {
+		QName service=(QName)soapCtx.get(MessageContext.WSDL_SERVICE);
+        
+		if (logger.isDebugEnabled()) {
+			logger.debug("Service for endpoint = "+service);
+		}
+		
+		if (service == null && soapCtx instanceof SOAPMessageContextJAXWS) {
+			SOAPMessageContextJAXWS smc=(SOAPMessageContextJAXWS)soapCtx;
+			
+			if (smc.getEndpointMetaData() != null &&
+							smc.getEndpointMetaData().getServiceMetaData() != null) {
+				service = smc.getEndpointMetaData().getServiceMetaData().getServiceName();
+			}			
+		}
+
+		return(service == null ? null : new Endpoint(service.toString()));
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.jbosswsnative;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.validator.Endpoint;
+import org.savara.validator.ServiceValidator;
+
+public class JBossWSNativeClientInterceptor extends AbstractJBossWSNativeInterceptor {
+	
+	private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
+
+	public JBossWSNativeClientInterceptor() {
+		if (logger.isDebugEnabled()) {
+			logger.debug("JBossWSNativeClientInterceptor created");
+		}
+	}
+   
+	protected boolean handleInbound(MessageContext ctx) {
+		boolean ret=true;
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+		Endpoint endpoint=getEndpoint(soapCtx);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getOutputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageReceived(getMessageType(soapCtx, false), getMessage(soapCtx));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid received message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		ret = false;
+		        	}
+				}
+			}
+		}
+
+		return(ret);
+	}
+
+	protected boolean handleOutbound(MessageContext ctx) {
+		boolean ret=true;
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+		Endpoint endpoint=getEndpoint(soapCtx);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getOutputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageSent(getMessageType(soapCtx, true), getMessage(soapCtx));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid received message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		ret = false;
+		        	}
+				}
+			}
+		}
+
+		return(ret);
+	}
+
+	public boolean handleFault(MessageContext ctx) {
+		return handleOutbound(ctx);
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.jbosswsnative;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.validator.Endpoint;
+import org.savara.validator.ServiceValidator;
+
+public class JBossWSNativeServerInterceptor extends AbstractJBossWSNativeInterceptor {
+	
+	private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
+   
+	public JBossWSNativeServerInterceptor() {
+		if (logger.isDebugEnabled()) {
+			logger.debug("JBossWSNativeServerInterceptor created");
+		}
+	}
+   
+	protected boolean handleInbound(MessageContext ctx) {
+		boolean ret=true;
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+		Endpoint endpoint=getEndpoint(soapCtx);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getInputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageReceived(getMessageType(soapCtx, true), getMessage(soapCtx));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid received message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		ret = false;
+		        	}
+				}
+			}
+		}
+
+		return(ret);
+	}
+
+	protected boolean handleOutbound(MessageContext ctx) {
+		boolean ret=true;
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+		Endpoint endpoint=getEndpoint(soapCtx);
+		
+		if (endpoint != null) {
+			java.util.List<ServiceValidator> validators=
+					getServiceValidatorManager().getInputServiceValidators(endpoint);
+			
+			if (validators != null && validators.size() > 0) {
+				boolean validated=false;
+				Exception ex=null;
+
+				for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+			        try {
+			        	validators.get(i).messageSent(getMessageType(soapCtx, false), getMessage(soapCtx));
+			        	validated = true;
+			        } catch(Exception t) {
+			        	// Ignore
+			        	ex = t;
+			        }
+				}
+				
+				// Only raise exception if none of the service
+				// validators were able to validate the message
+				if (validated == false) {
+					String vnames="";
+					
+					for (int i=0; validators != null &&
+							i < validators.size(); i++) {
+						if (vnames.length() > 0) {
+							vnames += ", ";
+						}
+						vnames += validators.get(i).getValidatorName();
+					}
+					
+		        	logger.error("Failed to handle received message on endpoint '"+
+		        			endpoint+"' validated against: "+vnames);
+		        	
+		        	if (logger.isDebugEnabled()) {
+		        		logger.debug("Invalid received message", ex);
+		        	}
+		        	
+		        	if (getServiceValidatorManager().isManagedMode()) {
+		        		ret = false;
+		        	}
+				}
+			}
+		}
+
+		return(ret);
+	}
+
+	public boolean handleFault(MessageContext ctx) {
+		return handleOutbound(ctx);
+	}
+}

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.jbosswsnative.service;
+
+import java.util.logging.Logger;
+
+import javax.naming.*;
+
+/**
+ * This is the JBossWS Native Savara Service Validator Service managing the Service Validator.
+ *
+ * @author gbrown
+ *
+ */
+public class JBossWSNativeServiceValidatorService extends org.jboss.system.ServiceMBeanSupport implements JBossWSNativeServiceValidatorServiceMBean {
+
+	private final static Logger logger = Logger.getLogger(JBossWSNativeServiceValidatorService.class.getName());
+
+	/**
+	 * The default constructor.
+	 */
+	public JBossWSNativeServiceValidatorService() {
+	}
+
+	/**
+	 * This method starts the service, instantiating the
+	 * Service Validation Manager and registering it with JNDI.
+	 */
+	protected void startService() throws Exception {
+		logger.info("Starting Savara JBossWS Native Service Validator Adapter");
+	}
+
+	/**
+	 * This method stops the service, closing the
+	 * Service Validation Manager and unregistering it from JNDI.
+	 */
+	protected void stopService() throws Exception {
+		logger.info("Stopping Savara JBossWS Native Service Validator Adapter");
+	}
+
+}

Added: branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java
===================================================================
--- branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java	                        (rev 0)
+++ branches/experimental/2.0.x/validators/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.validator.jbosswsnative.service;
+
+import javax.naming.NamingException;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * The MBean for the JBossWS Native Service Validator Service.
+ * 
+ * @author gbrown
+ *
+ */
+public interface JBossWSNativeServiceValidatorServiceMBean extends ServiceMBean {
+	
+}

Added: branches/experimental/2.0.x/validators/pom.xml
===================================================================
--- branches/experimental/2.0.x/validators/pom.xml	                        (rev 0)
+++ branches/experimental/2.0.x/validators/pom.xml	2010-12-10 22:38:20 UTC (rev 502)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.savara</groupId>
+    <artifactId>validators</artifactId>
+    <packaging>pom</packaging>
+    <name>Savara::Validators</name>
+    <version>2.0.0-SNAPSHOT</version>
+    
+    <parent>
+	  <groupId>org</groupId>
+	  <artifactId>savara</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+	</parent>
+  
+    <modules>
+		<module>jboss</module>
+    </modules>
+
+</project>



More information about the savara-commits mailing list