Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
12.2. Injecting Properties Into Service Implementation
Implementation properties allow you to inject one or more property values into a service implementation. This is based on the property support in the SCA assembly specification. Since the property is injected into service implementation logic, the injection mechanism itself is unique to each implementation type. Here are the details for each implementation type:
- Java: Injected using @Property into a CDI bean
- Camel: Wired into Camel properties component and accessible in a Camel route using Camel’s own varName property notation
- BPEL: Mapped into process variables using <assign> with using
resolveProperty()
XPath custom function - BPMN 2: Inserted into process variables by data input associations
- Drools: Available in a global map
Implementation properties represent environmental properties that you have defined in the SwitchYard application descriptor (
switchyard.xml
) for your bean implementation. Implementation properties in SwitchYard are the properties that you can configure on a specific service implementation. That is, you can make the property value available to service logic executing inside an implementation container. Here is an example:
To access the Implementation Properties, add an @Property annotation to your bean class identifying the property you want to inject:
SwitchYard integrates with the Properties Component in Camel to make system and application properties available inside your route definitions. You can inject properties into your camel route using
{{propertyname}}
expression, where propertyName is the name of the property. For example, the following camel route expects the user.name property to be injected in the last <Log> statement:
12.2.3. Injecting Implementation Properties in BPEL 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can inject properties into your BPEL process definition with using
SwitchYardPropertyFunction.resolveProperty()
XPath custom function. In the example below, bpel:copy
section copies Greeting property value into the ReplySayHelloVar
variable: