Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWITCHYARD-1955: Move to Drools/jBPM modules #647

Merged
merged 1 commit into from Mar 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
78 changes: 78 additions & 0 deletions bpm/pom.xml
Expand Up @@ -37,6 +37,54 @@
</delimiters> </delimiters>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>extract-jbpm-orm</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-executor</artifactId>
<version>${version.org.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-human-task-audit</artifactId>
<version>${version.org.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>${artifactId.jbpm-human-task-orm}</artifactId>
<version>${version.org.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-kie-services</artifactId>
<version>${version.org.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-persistence-jpa</artifactId>
<version>${version.org.jbpm}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<includes>META-INF/*orm.xml</includes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
Expand Down Expand Up @@ -99,4 +147,34 @@
<artifactId>jbpm-workitems</artifactId> <artifactId>jbpm-workitems</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<profiles>
<profile>
<id>components-bpm-profile-product</id>
<activation>
<property>
<name>switchyard.product</name>
</property>
</activation>
<properties>
<artifactId.jbpm-human-task-orm>jbpm-human-task-core</artifactId.jbpm-human-task-orm>
</properties>
</profile>
<profile>
<id>components-bpm-profile-community</id>
<activation>
<property>
<name>!switchyard.product</name>
</property>
</activation>
<properties>
<artifactId.jbpm-human-task-orm>jbpm-human-task-jpa</artifactId.jbpm-human-task-orm>
</properties>
<dependencies>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-human-task-jpa</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>
Expand Up @@ -25,7 +25,6 @@
import org.kie.api.event.rule.MatchCreatedEvent; import org.kie.api.event.rule.MatchCreatedEvent;
import org.kie.api.event.rule.RuleFlowGroupActivatedEvent; import org.kie.api.event.rule.RuleFlowGroupActivatedEvent;
import org.kie.api.event.rule.RuleRuntimeEventListener; import org.kie.api.event.rule.RuleRuntimeEventListener;
import org.kie.api.event.rule.WorkingMemoryEventListener;
import org.kie.api.runtime.KieRuntime; import org.kie.api.runtime.KieRuntime;
import org.kie.api.runtime.KieSession; import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.StatelessKieSession; import org.kie.api.runtime.StatelessKieSession;
Expand All @@ -40,7 +39,6 @@
* *
* @author David Ward &lt;<a href="mailto:dward@jboss.org">dward@jboss.org</a>&gt; &copy; 2012 Red Hat Inc. * @author David Ward &lt;<a href="mailto:dward@jboss.org">dward@jboss.org</a>&gt; &copy; 2012 Red Hat Inc.
*/ */
@SuppressWarnings("deprecation")
public final class Listeners { public final class Listeners {
private static final Logger LOG = Logger.getLogger(Listeners.class); private static final Logger LOG = Logger.getLogger(Listeners.class);


Expand Down Expand Up @@ -167,10 +165,10 @@ public static void registerListener(EventListener listener, KieRuntimeEventManag
if (listener instanceof RuleRuntimeEventListener) { if (listener instanceof RuleRuntimeEventListener) {
// current (kie) // current (kie)
manager.addEventListener((RuleRuntimeEventListener)listener); manager.addEventListener((RuleRuntimeEventListener)listener);
} else if (listener instanceof WorkingMemoryEventListener) { }/* else if (listener instanceof WorkingMemoryEventListener) {
// deprecated (kie) // deprecated (kie 6.0) and now removed (kie 6.1)
manager.addEventListener((WorkingMemoryEventListener)listener); manager.addEventListener((WorkingMemoryEventListener)listener);
}/* else if (listener instanceof org.drools.core.event.WorkingMemoryEventListener) { } else if (listener instanceof org.drools.core.event.WorkingMemoryEventListener) {
// legacy (drools) // legacy (drools)
org.drools.core.event.WorkingMemoryEventListener droolsListener = (org.drools.core.event.WorkingMemoryEventListener)listener; org.drools.core.event.WorkingMemoryEventListener droolsListener = (org.drools.core.event.WorkingMemoryEventListener)listener;
if (manager instanceof StatelessKnowledgeSessionImpl) { if (manager instanceof StatelessKnowledgeSessionImpl) {
Expand Down
Expand Up @@ -13,7 +13,7 @@
*/ */
package org.switchyard.component.rules.config.model; package org.switchyard.component.rules.config.model;


import org.kie.api.event.rule.DebugWorkingMemoryEventListener; import org.kie.api.event.rule.DebugRuleRuntimeEventListener;
import org.switchyard.component.common.knowledge.LoggerType; import org.switchyard.component.common.knowledge.LoggerType;
import org.switchyard.component.common.knowledge.annotation.Channel; import org.switchyard.component.common.knowledge.annotation.Channel;
import org.switchyard.component.common.knowledge.annotation.Fault; import org.switchyard.component.common.knowledge.annotation.Fault;
Expand All @@ -34,7 +34,7 @@
*/ */
@Rules( @Rules(
channels=@Channel(name="theName", operation="theOperation", reference="theReference", value=RulesModelTests.TestChannel.class), channels=@Channel(name="theName", operation="theOperation", reference="theReference", value=RulesModelTests.TestChannel.class),
listeners=@Listener(DebugWorkingMemoryEventListener.class), listeners=@Listener(DebugRuleRuntimeEventListener.class),
loggers=@Logger(interval=2000, log="theLog", type=LoggerType.CONSOLE), loggers=@Logger(interval=2000, log="theLog", type=LoggerType.CONSOLE),
manifest=@Manifest( manifest=@Manifest(
//container=@Container(baseName="theBase", scan=true, scanInterval=1000, releaseId="theGroupId:theArtifactId:theVersion", sessionName="theSession"), //container=@Container(baseName="theBase", scan=true, scanInterval=1000, releaseId="theGroupId:theArtifactId:theVersion", sessionName="theSession"),
Expand Down
Expand Up @@ -27,7 +27,7 @@
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.kie.api.builder.ReleaseId; import org.kie.api.builder.ReleaseId;
import org.kie.api.event.rule.DebugWorkingMemoryEventListener; import org.kie.api.event.rule.DebugRuleRuntimeEventListener;
import org.kie.api.runtime.Channel; import org.kie.api.runtime.Channel;
import org.switchyard.common.io.pull.StringPuller; import org.switchyard.common.io.pull.StringPuller;
import org.switchyard.common.io.resource.ResourceDetail; import org.switchyard.common.io.resource.ResourceDetail;
Expand Down Expand Up @@ -130,7 +130,7 @@ private void doTestModel(SwitchYardModel switchyard, String xml, ClassLoader loa
Assert.assertEquals("theOperation", channel.getOperation()); Assert.assertEquals("theOperation", channel.getOperation());
Assert.assertEquals("theReference", channel.getReference()); Assert.assertEquals("theReference", channel.getReference());
ListenerModel listener = rules.getListeners().getListeners().get(0); ListenerModel listener = rules.getListeners().getListeners().get(0);
Assert.assertEquals(DebugWorkingMemoryEventListener.class, listener.getClazz(loader)); Assert.assertEquals(DebugRuleRuntimeEventListener.class, listener.getClazz(loader));
LoggerModel logger = rules.getLoggers().getLoggers().get(0); LoggerModel logger = rules.getLoggers().getLoggers().get(0);
Assert.assertEquals(Integer.valueOf(2000), logger.getInterval()); Assert.assertEquals(Integer.valueOf(2000), logger.getInterval());
Assert.assertEquals("theLog", logger.getLog()); Assert.assertEquals("theLog", logger.getLog());
Expand Down
Expand Up @@ -20,7 +20,7 @@
<channel class="org.switchyard.component.rules.config.model.RulesModelTests$TestChannel" name="theName" operation="theOperation" reference="theReference"/> <channel class="org.switchyard.component.rules.config.model.RulesModelTests$TestChannel" name="theName" operation="theOperation" reference="theReference"/>
</channels> </channels>
<listeners> <listeners>
<listener class="org.kie.api.event.rule.DebugWorkingMemoryEventListener"/> <listener class="org.kie.api.event.rule.DebugRuleRuntimeEventListener"/>
</listeners> </listeners>
<loggers> <loggers>
<logger interval="2000" log="theLog" type="CONSOLE"/> <logger interval="2000" log="theLog" type="CONSOLE"/>
Expand Down
Expand Up @@ -20,7 +20,7 @@
<channel class="org.switchyard.component.rules.config.model.RulesModelTests$TestChannel" name="theName" operation="theOperation" reference="theReference"/> <channel class="org.switchyard.component.rules.config.model.RulesModelTests$TestChannel" name="theName" operation="theOperation" reference="theReference"/>
</channels> </channels>
<listeners> <listeners>
<listener class="org.kie.api.event.rule.DebugWorkingMemoryEventListener"/> <listener class="org.kie.api.event.rule.DebugRuleRuntimeEventListener"/>
</listeners> </listeners>
<loggers> <loggers>
<logger interval="2000" log="theLog" type="CONSOLE"/> <logger interval="2000" log="theLog" type="CONSOLE"/>
Expand Down