jboss默认进程名称

(文章来宾与北美红帽公司高级解决方案架构师杰伊·保拉杰合着)

几周的提示与技巧文章将深入探讨JBoss BPM Suite,特别是有关如何在两个流程之间进行通信的问题。 在深入了解解决方案细节之前,让我们首先约束将要讨论的用例。

关于两个进程之间的通信方式可能有很多解释,但是我们将从这里开始,以一种简单的方式让一个进程调用另一个进程。 我们还将通过提供的RestAPI展示这种简单的用法,我们将利用该API提供可部署的工件,您可以将其用作任何BPM流程中的自定义工作处理程序。

该工件是一个我们标记为RestApi.java的类,它包含设置和详细信息,使您可以从现有过程中启动另一个过程。

在本文结尾处,我们提供了完整的课程,但首先,我们仔细研究了各个活动部分。

每个类的顶部包括将要使用的各种导入的对象或类,我们对“知识就是一切”(KIE)API组件最感兴趣,您将在其中找到它们以及代表我们的医疗保健示例领域模型的一些对象。

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;
}

使用运行时引擎,我们现在可以访问和创建我们的会话,然后我们就可以在其中启动流程实例。

调用以下方法来启动流程实例,并且仅出于清楚的目的,该方法包含创建要提交到我们流程中的数据集合。 您应该很容易看到可以根据需要将其抽象出来,以便将过程变量映射到您的类中。

// 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());
}

通过这种方法,我们可以设置流程所需的医生,患者和其他医疗详细信息,将它们收集到地图中,然后将其提交给流程实例以将其全部启动。

现在,我们可以将所有这些联系在一起,以便在调用此方法时运行的主类将设置我们的RestAPI,并在每次调用它时启动一个新的流程实例。

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

我们希望通过本医学示例的简单介绍可以使您了解如何利用提供的JBoss BPM Suite RestAPI来发挥自己的优势。 在这种情况下,我们将其用于与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跨进程通信相关推荐

  1. javamac系统通过pid获取进程名称_线上环境 Linux 系统调用追踪

    提到如何动态追踪进程中的系统调用,相信大家第一时间都能想到 strace,它的基本用法非常简单,非常适合用来解决 "为什么这个软件无法在这台机器上运行?" 这类问题.但如果需要分析 ...

  2. python更改进程名称_更改python脚本的进程名称 - python

    有没有办法更改在Linux上运行python脚本的进程的名称? 当我执行ps时,我得到的只是"python"进程名称. 参考方案 http://code.google.com/p/ ...

  3. 设置java进程名称_如何为Java程序设置进程名称? - java

    如果启动了Java程序,它将在系统进程中监视名称java.许多Java程序很难区分.因此,如果存在设置名称的方法,它将很好地显示在过程监视器中.我知道这在不同的操作系统上可能会有所不同. 一个简单的方 ...

  4. linux 查看进程端口_如何简单有效的查看windows进程使用了哪些端口

    概述 对于运维有时在排查网络问题时需要去查看进程使用的端口,下面整了一个bat脚本,主要利用netstat命令找出使用TCP协议通信的端口,并将结果分割:将第二个参数(IP加端口)传给%%i,第五个参 ...

  5. android 指定进程名称,android 根据进程名杀死指定、特定进程

    private void killProcess(String killName) { // 获取一个ActivityManager 对象 ActivityManager activityManage ...

  6. jboss1.7_快速指南:剖析JBoss BPM跨进程通信

    jboss1.7 (文章来宾与北美红帽公司高级解决方案架构师杰伊·保拉杰共同撰写) 几周的提示与技巧文章将深入探讨JBoss BPM Suite,特别是有关如何在两个流程之间进行通信的问题. 在进入解 ...

  7. 快速指南:剖析JBoss BPM跨进程通信

    (文章来宾与北美红帽公司高级解决方案架构师杰伊·保拉杰共同撰写) 几周的提示与技巧文章将深入探讨JBoss BPM Suite,特别是有关如何在两个流程之间进行通信的问题. 在进入解决方案详细信息之前 ...

  8. 如何恢复隐藏的窗口 已知进程名称_如何判断Linux系统是否被黑客入侵?可以用这种方法...

    恶意软件有时会使用Linux内核进程伪装来隐藏其运行时,让我们研究一下如何使用这种策略来揭露Linux恶意软件. Linux内核进程伪装了什么? 在Linux上,内核创建了许多线程来帮助完成系统任务, ...

  9. ant-design tree 设置默认选中状态_快速掌握文件夹位置的更改和文件的默认打开方式及重命名的操作...

    大家好,我是波仔,很高兴来跟大家一起分享与探讨,今天我们来分享一下,谈谈电脑中文件夹如何更改它的位置和文件的默认打开方式以及批量的重命名的一些操作. 在Windows 10的操作系统中,用户的文件夹默 ...

最新文章

  1. (亲测可行)ubuntu16.04+Opencv3.4.3+opencv_contrib3.4.3安装编译全过程
  2. 学习python是干嘛的-学 Python 都用来干嘛的?
  3. make 学习体会(一)
  4. 我的世界java版怎么装在u盘_我的世界选择器参数怎么使用?
  5. Ubuntu 用户安装 MATE
  6. iOS 钥匙串的基本使用
  7. python的固定有没有固定字符_python每次处理固定个数的字符的方法总结
  8. mysql field id doesnt have a default value_为什么出现“Field ID'doesn't have a default value”?...
  9. C#串口通信工作笔记0001---嵌入式_串口通信_数据发送
  10. CJSON之完全基于C库函数的使用
  11. 登录账号用户名判断_如何设计 QQ、微信等第三方账号登陆 ?
  12. EXCEL滚动表格时保持第一行标题不动
  13. html实现2048小游戏,html+css+js适合前端小白的实战全解(超详细)——2048小游戏(二)...
  14. Raft和PBFT算法对比
  15. android 禁止其他应用开机启动项,禁止各种APP开机后自动运行的方案
  16. java Virtual Machine Launcher
  17. 网卡82546驱动linux,Linux e1000e网卡驱动
  18. [置顶]我的2011体会--不是每个程序员都是适合创业,即使你工作了十年
  19. 高数_证明_绝对收敛的级数也收敛
  20. poj 2152 Fire - 经典树形dp

热门文章

  1. P4145-上帝造题的七分钟2/花神游历各国【并查集,树状数组】
  2. codeforces1559 D2. Mocha and Diana (Hard Version)(并查集+启发式合并+随机化)
  3. 【模板】一维树状数组
  4. 牛客练习赛 65 (待补E-网络流)
  5. 【DP】翻硬币(jzoj 3921)
  6. 洛谷P1373 小a和uim之大逃离 动态规划
  7. JFreeChart(三)之条形图
  8. 聚集索引、辅助索引、覆盖索引、联合索引
  9. 【深入理解JVM】:类加载器与双亲委派模型
  10. Java命令学习系列(四)——jstat