此内容没有您所选择的语言版本。

7.19. Passing Parameters to a jBPM5 Process on signalEvent


// create the ESB message
Message esbMessage = MessageFactory.getInstance().getMessage();
// set the process event type as defined in the process definition
esbMessage.getProperties().setProperty("processEventType", "NewMessage");
// add a parameter
esbMessage.getProperties().setProperty("name", "Hardy");

// setup data required to identify the intended target process instance
ContextImpl ctxi = (ContextImpl) esbMessage.getContext();
// set the session id
ctxi.setContext("jbpm5-session-id", sessionId);
// set the instance id.
ctxi.setContext("jbpm5-processinstance-id", processInstanceId);
Copy to Clipboard Toggle word wrap
The following 'name' property will be assigned on process start when the 'name' ESB message property will be set:
<definition ...>
 
    <itemDefinition id="_nameItem" structureRef="String" />
 
    <process name="Hello" tns:packageName="defaultPackage" ...>
        <property id="name" itemSubjectRef="_nameItem"/>
        <!-- ... -->
    </process>
    <!-- ... -->
</definition>
Copy to Clipboard Toggle word wrap
To define a process property of type java.util.Map:
<definition ...>

  <itemDefinition id="_objectMapItem" structureRef="java.util.Map" />

  <process name="Hello" tns:packageName="defaultPackage" ...>

    <property id="objectMap" itemSubjectRef="_objectMapItem"/>
    <!-- ... -->
  </process>
  <!-- ... -->
</definition>
Copy to Clipboard Toggle word wrap
To extract parameters:
String name2 = objectMap.get("name"); // will retrieve the Hardy string
Copy to Clipboard Toggle word wrap

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat