日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jboss默认进程名称_快速指南:剖析JBoss BPM跨进程通信

發(fā)布時間:2023/12/3 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jboss默认进程名称_快速指南:剖析JBoss BPM跨进程通信 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

jboss默認進程名稱

(文章來賓與北美紅帽公司高級解決方案架構師杰伊·保拉杰合著)

幾周的提示與技巧文章將深入探討JBoss BPM Suite,特別是有關如何在兩個流程之間進行通信的問題。 在深入了解解決方案細節(jié)之前,讓我們首先約束將要討論的用例。


關于兩個進程之間的通信方式可能有很多解釋,但是我們將從這里開始,以一種簡單的方式讓一個進程調用另一個進程。 我們還將通過提供的RestAPI展示這種簡單的用法,我們將利用該API提供可部署的工件,您可以將其用作任何BPM流程中的自定義工作處理程序。

該工件是一個我們標記為RestApi.java的類,它包含設置和詳細信息,使您可以從現有過程中啟動另一個過程。

在本文結尾處,我們提供了完整的課程,但首先,我們仔細研究了各個活動部分。

每個類的頂部包括將要使用的各種導入的對象或類,我們對“知識就是一切”(KIE)API組件最感興趣,您將在其中找到它們以及代表我們的醫(yī)療保健示例領域模型的一些對象。

package org.jboss.demo.heathcare;import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;// JBoss BPM Suite API import org.kie.api.runtime.KieSession; import org.kie.api.runtime.manager.RuntimeEngine; import org.kie.api.runtime.process.ProcessInstance; import org.kie.services.client.api.RemoteRestRuntimeEngineFactory;// Domain model. import com.redhat.healthcare.CaseContext; import com.redhat.healthcare.Doctor; import com.redhat.healthcare.PatientInfo; import com.redhat.healthcare.Prescription; import com.redhat.healthcare.Rxdetail;

接下來,我們將找到RestAPI類的實際開始,我們在其中設置使用API??所需的一些屬性以及一個構造函數,以確保我們的JBoss BPM Suite服務器正在運行。 請注意,流程部署ID以及用戶名和密碼都是虛構的,因此與實際流程數據的任何相似之處都是偶然的。

String deploymentId = "com.redhat.healthcare:patients:1.0"; String bpmUrl = "http://localhost:8080/business-central"; String userId = "admin"; String password = "bpmsuite1!"; URL deploymentUrl;// Constructor to check for availability of BPM server. // public RestApi() {super();try {this.deploymentUrl = new URL();} catch (MalformedURLException e) {e.printStackTrace();} }

測試的URL假定是基本的默認本地安裝,因此,如果您的安裝使用其他設置,則需要對此進行調整。

下一個代碼片段重點介紹了一種核心幫助程序方法,該方法為我們提供了對運行時引擎的引用。 這是通過RestAPI將我們綁定到特定部署com.redhat.healthcare:Patients:1.0的引擎,使我們可以啟動該部署中的流程。

// Get a runtime engine based on RestAPI and our deployment. // public RuntimeEngine getRuntimeEngine() {RemoteRestRuntimeEngineFactory restSessionFactory = new RemoteRestRuntimeEngineFactory(deploymentId, deploymentUrl, userId, password);// create REST requestRuntimeEngine engine = restSessionFactory.newRuntimeEngine();return engine; }

使用運行時引擎,我們現在可以訪問和創(chuàng)建我們的會話,然后我們就可以在其中啟動流程實例。

調用以下方法來啟動流程實例,并且僅出于清楚的目的,該方法包含創(chuàng)建要提交到我們流程中的數據集合。 您應該很容易看到可以根據需要將其抽象出來,以便將過程變量映射到您的類中。

// Setup our session, fill the data needed for process // instances and starting our process. // public void startProcess() {String taskUserId = userId;// create REST request.RuntimeEngine engine = getRuntimeEngine();KieSession ksession = engine.getKieSession();// setup data for submission to process instance.Doctor doctor = new Doctor();doctor.setAddress("3018 winter");doctor.setCity("madison");doctor.setGender("M");doctor.setGroupId("UW1001");doctor.setHospital("1001");doctor.setName("jey");doctor.setState("WI");PatientInfo pat = new PatientInfo();pat.setAge(12);pat.setName("jey");pat.setSymbtom("Diabetes Insipidus");pat.setType("Diabetes");Rxdetail rxdetail = new Rxdetail();List<rxdetail> details = new ArrayList<rxdetail>();rxdetail.setDrugName("xx");rxdetail.setOther("red");rxdetail.setQty(11);rxdetail.setRxNum(11);details.add(rxdetail);CaseContext cont = new CaseContext();cont.setApprovalReq("N");cont.setApprovalReq("Supervisor");Prescription prescription = new Prescription();prescription.setDoctor(doctor);prescription.setPatientInfo(pat);prescription.setRxdetails(details);// collect all data in our map.Map<string object=""> params = new HashMap<string object="">();params.put("prescription", prescription);params.put("caseContext", cont);// start process.ProcessInstance processInstance = ksession.startProcess("healthcare.patientCaseProcess", params);// verify process started.System.out.println("process id " + processInstance.getProcessId());System.out.println("process id " + processInstance.getId()); }

通過這種方法,我們可以設置流程所需的醫(yī)生,患者和其他醫(yī)療詳細信息,將它們收集到地圖中,然后將其提交給流程實例以將其全部啟動。

現在,我們可以將所有這些聯(lián)系在一起,以便在調用此方法時運行的主類將設置我們的RestAPI,并在每次調用它時啟動一個新的流程實例。

// Start our process by using RestAPI. // public static void main(String[] ar) {RestApi api = new RestApi();api.startProcess(); }

我們希望通過本醫(yī)學示例的簡單介紹可以使您了解如何利用提供的JBoss BPM Suite RestAPI來發(fā)揮自己的優(yōu)勢。 在這種情況下,我們將其用于與BPM服務器上部署的任何其他進程與特定部署中的特定進程進行通信。

這是RestApi類:

package org.jboss.demo.heathcare;import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;// JBoss BPM Suite API import org.kie.api.runtime.KieSession; import org.kie.api.runtime.manager.RuntimeEngine; import org.kie.api.runtime.process.ProcessInstance; import org.kie.services.client.api.RemoteRestRuntimeEngineFactory;// Domain model. import com.redhat.healthcare.CaseContext; import com.redhat.healthcare.Doctor; import com.redhat.healthcare.PatientInfo; import com.redhat.healthcare.Prescription; import com.redhat.healthcare.Rxdetail;String deploymentId = "com.redhat.healthcare:patients:1.0"; String bpmUrl = "http://localhost:8080/business-central"; String userId = "admin"; String password = "bpmsuite1!"; URL deploymentUrl;// Constructor to check for availability of BPM server. // public RestApi() {super();try {this.deploymentUrl = new URL();} catch (MalformedURLException e) {e.printStackTrace();} }// Get a runtime engine based on RestAPI and our deployment. // public RuntimeEngine getRuntimeEngine() {RemoteRestRuntimeEngineFactory restSessionFactory = new RemoteRestRuntimeEngineFactory(deploymentId, deploymentUrl, userId, password);// create REST requestRuntimeEngine engine = restSessionFactory.newRuntimeEngine();return engine; }// Setup our session, fill the data needed for process // instances and starting our process. // public void startProcess() {String taskUserId = userId;// create REST request.RuntimeEngine engine = getRuntimeEngine();KieSession ksession = engine.getKieSession();// setup data for submission to process instance.Doctor doctor = new Doctor();doctor.setAddress("3018 winter");doctor.setCity("madison");doctor.setGender("M");doctor.setGroupId("UW1001");doctor.setHospital("1001");doctor.setName("jey");doctor.setState("WI");PatientInfo pat = new PatientInfo();pat.setAge(12);pat.setName("jey");pat.setSymbtom("Diabetes Insipidus");pat.setType("Diabetes");Rxdetail rxdetail = new Rxdetail();List<rxdetail> details = new ArrayList<rxdetail>();rxdetail.setDrugName("xx");rxdetail.setOther("red");rxdetail.setQty(11);rxdetail.setRxNum(11);details.add(rxdetail);CaseContext cont = new CaseContext();cont.setApprovalReq("N");cont.setApprovalReq("Supervisor");Prescription prescription = new Prescription();prescription.setDoctor(doctor);prescription.setPatientInfo(pat);prescription.setRxdetails(details);// collect all data in our map.Map<string object=""> params = new HashMap<string object="">();params.put("prescription", prescription);params.put("caseContext", cont);// start process.ProcessInstance processInstance = ksession.startProcess("healthcare.patientCaseProcess", params);// verify process started.System.out.println("process id " + processInstance.getProcessId());System.out.println("process id " + processInstance.getId()); }// Start our process by using RestAPI. // public static void main(String[] ar) {RestApi api = new RestApi();api.startProcess(); }

翻譯自: https://www.javacodegeeks.com/2014/12/quick-guide-dissecting-jboss-bpm-cross-process-communication.html

jboss默認進程名稱

總結

以上是生活随笔為你收集整理的jboss默认进程名称_快速指南:剖析JBoss BPM跨进程通信的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。