You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/06/25 09:48:51 UTC
svn commit: r550404 - in /incubator/servicemix/trunk/archetypes: ./
servicemix-archetypes-itests/ servicemix-bean-service-unit/
servicemix-drools-service-unit/ servicemix-drools-service-unit/src/
servicemix-drools-service-unit/src/main/ servicemix-droo...
Author: gnodet
Date: Mon Jun 25 00:48:50 2007
New Revision: 550404
URL: http://svn.apache.org/viewvc?view=rev&rev=550404
Log:
SM-971: SU archetype for servicemix-drools
Added:
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml (with props)
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml (with props)
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml (with props)
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/router.drl
incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml (with props)
Modified:
incubator/servicemix/trunk/archetypes/pom.xml
incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
incubator/servicemix/trunk/archetypes/servicemix-bean-service-unit/ (props changed)
incubator/servicemix/trunk/archetypes/servicemix-ftp-poller-service-unit/ (props changed)
incubator/servicemix/trunk/archetypes/servicemix-ftp-sender-service-unit/ (props changed)
Modified: incubator/servicemix/trunk/archetypes/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/pom.xml?view=diff&rev=550404&r1=550403&r2=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/pom.xml Mon Jun 25 00:48:50 2007
@@ -54,6 +54,7 @@
<module>servicemix-saxon-xquery-service-unit</module>
<module>servicemix-saxon-xslt-service-unit</module>
<module>servicemix-bean-service-unit</module>
+ <module>servicemix-drools-service-unit</module>
<module>servicemix-archetypes-itests</module>
</modules>
Modified: incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml?view=diff&rev=550404&r1=550403&r2=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml Mon Jun 25 00:48:50 2007
@@ -141,6 +141,11 @@
<artifactId>servicemix-shared-library</artifactId>
<version>${servicemix-version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>servicemix-drools-service-unit</artifactId>
+ <version>${servicemix-version}</version>
+ </dependency>
</dependencies>
<build>
Propchange: incubator/servicemix/trunk/archetypes/servicemix-bean-service-unit/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 25 00:48:50 2007
@@ -0,0 +1,2 @@
+.classpath
+.project
Added: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml?view=auto&rev=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml (added)
+++ incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml Mon Jun 25 00:48:50 2007
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>tooling</artifactId>
+ <version>3.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>servicemix-drools-service-unit</artifactId>
+ <name>ServiceMix :: Archetypes :: DroolsServiceUnit</name>
+
+</project>
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml?view=auto&rev=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml (added)
+++ incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml Mon Jun 25 00:48:50 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+
+-->
+<archetype>
+ <id>servicemix-drools-service-unit</id>
+ <resources>
+ <resource>src/main/resources/xbean.xml</resource>
+ <resource>src/main/resources/router.drl</resource>
+ </resources>
+</archetype>
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/META-INF/maven/archetype.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml?view=auto&rev=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml (added)
+++ incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml Mon Jun 25 00:48:50 2007
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+
+-->
+<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>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>jbi-service-unit</packaging>
+ <version>${version}</version>
+ <name>A Drools Service Unit</name>
+ <url>http://www.myorganization.org</url>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.incubating</id>
+ <name>Apache Incubating Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+ <repositories>
+ <repository>
+ <id>apache.incubating</id>
+ <name>Apache Incubating Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <properties>
+ <servicemix-version>3.2-incubating-SNAPSHOT</servicemix-version>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-drools</artifactId>
+ <version>${servicemix-version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>jbi-maven-plugin</artifactId>
+ <version>${servicemix-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/router.drl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/router.drl?view=auto&rev=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/router.drl (added)
+++ incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/router.drl Mon Jun 25 00:48:50 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.servicemix.drools
+
+import org.apache.servicemix.drools.model.Exchange;
+
+global org.apache.servicemix.drools.model.JbiHelper jbi;
+
+rule "Unspecified id"
+ when
+ me : Exchange( status == Exchange.ACTIVE, in : in != null )
+ eval( in.xpath("/bar:test/@id <= 0") )
+ then
+ jbi.fault( "<fault>Id must be > 0</fault>" );
+end
+
+rule "Route to target1"
+ when
+ me : Exchange( status == Exchange.ACTIVE, in : in != null )
+ eval( in.xpath("/bar:test/@id = 1") )
+ then
+ jbi.route( "service::target1" );
+end
+
+rule "Route to target2"
+ when
+ me : Exchange( status == Exchange.ACTIVE, in : in != null )
+ eval( in.xpath("/bar:test/@id = 2") )
+ then
+ jbi.route( "service::target2" );
+end
+
+rule "Route to target3"
+ when
+ me : Exchange( status == Exchange.ACTIVE, in : in != null )
+ eval( in.getProperty("prop") != null )
+ then
+ jbi.route( "service::target3" );
+end
+
Added: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml?view=auto&rev=550404
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml (added)
+++ incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml Mon Jun 25 00:48:50 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+
+-->
+<beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
+ xmlns:replaceMe="http://servicemix.apache.org/replaceMe">
+
+ <drools:endpoint service="replaceMe:myRouter"
+ endpoint="endpoint"
+ ruleBaseResource="classpath:router.drl"
+ namespaceContext="#nsContext" />
+
+
+ <drools:namespace-context id="nsContext">
+ <drools:namespaces>
+ <drools:namespace prefix="bar">http://servicemix.apache.org/bar</drools:namespace>
+ </drools:namespaces>
+ </drools:namespace-context>
+
+</beans>
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/archetypes/servicemix-drools-service-unit/src/main/resources/archetype-resources/src/main/resources/xbean.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: incubator/servicemix/trunk/archetypes/servicemix-ftp-poller-service-unit/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 25 00:48:50 2007
@@ -0,0 +1,2 @@
+.classpath
+.project
Propchange: incubator/servicemix/trunk/archetypes/servicemix-ftp-sender-service-unit/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 25 00:48:50 2007
@@ -0,0 +1,2 @@
+.classpath
+.project