标签:snippet ssi home hub 实时 变更 enc targe sch
jBPM 6 中底层架构基于 Maven,所以我们能够非常easy的进行 Maven jBPM 6 集成演示样例,本文分三个部分:
例如以下图
如图所看到的,我们有两台server,jBPM 6 server和clientserver:
Maven jBPM 6集成实际上就简化为 Maven settings.xml的配置问题。
例如以下配置
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <servers> <server> <id>guvnor-m2-repo</id> <username>admin</username> <password>password1!</password> <configuration> <wagonProvider>httpclient</wagonProvider> <httpConfiguration> <all> <usePreemptive>true</usePreemptive> </all> </httpConfiguration> </configuration> </server> </servers> <profiles> <profile> <id>guvnor-m2-repo</id> <repositories> <repository> <id>guvnor-m2-repo</id> <name>BRMS Repository</name> <url>http://10.66.218.46:8080/business-central/maven2/</url> <layout>default</layout> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>guvnor-m2-repo</activeProfile> </activeProfiles> </settings>
KieServices kServices = KieServices.Factory.get(); ReleaseId releaseId = kServices.newReleaseId( "com.redhat.gss", "01081954", "1.1-SNAPSHOT" ); KieContainer kContainer = kServices.newKieContainer( releaseId ); KieBase kbase = kContainer.getKieBase(); KieSession ksession = kbase.newKieSession();
借助于 Maven 的特性,KieScanner 能够周期性的扫描远程jBPM 6 server执行的Maven Repo。当有远程公布有变更时。KieScanner 会自己主动更新 KieRepository,使其为最新的公布,例如以下代码
KieServices kServices = KieServices.Factory.get(); ReleaseId releaseId = kServices.newReleaseId( "org.kie.example", "project1", "1.0.0-SNAPSHOT" ); KieContainer kContainer = kServices.newKieContainer( releaseId ); KieScanner kScanner = kServices.newKieScanner( kContainer ); kScanner.start( 1000 * 10); while(true) { KieSession ksession = kContainer.newKieSession(); ksession.fireAllRules(); Thread.sleep(10000); }
关于这一部分的深入原理參照 https://github.com/kylinsoong/jBPM-Drools-Example/blob/master/drools-6-examples/kie-mvn/kie-mvn-architecture.md
JBoss 系列一 O O:Maven jBPM 6 集成演示样例
标签:snippet ssi home hub 实时 变更 enc targe sch
原文地址:http://www.cnblogs.com/cynchanpin/p/7356529.html