org.jbpm.process.core.impl

## Class DataTransformerRegistry

- java.lang.Object
- - org.jbpm.process.core.impl.DataTransformerRegistry

-     public class DataTransformerRegistry
      extends Object

  Registry for all available on runtime `DataTransformer`s for performing data input and output transformation. Be default it discovers and registers all available JSR 223 compliant scripting languages wrapped with `JavaScriptingDataTransformer`.
  Discovery is based on `ScriptEngineManager.getEngineFactories()` thus any scripting engines should follow instructions for Java Scripting.
  Each Java Scripting engine will get dedicated instance of `JavaScriptingDataTransformer` which will be registered under one or more key in the registry. The key will be built as follows>
  - constant prefix for URI like syntax : http://www.java.com/
  - names provided by given ScriptEngineFactory - JavaScript, js,....
  For example default JavaScript scripting engine will be registered under following keys:
  - http://www.java.com/js
  - http://www.java.com/rhino
  - http://www.java.com/JavaScript
  - http://www.java.com/javascript
  - http://www.java.com/ECMAScript
  - http://www.java.com/ecmascript
  when defining the language for transformation that of data input/output the complete key should be provided. `<dataInputAssociation>
  <sourceRef>s</sourceRef>
  <targetRef>_2_param</targetRef>
  <transformation language="http://www.java.com/javascript">s.toUpperCase()</transformation>
  </dataInputAssociation>
  `
  Besides JSR 223 scripting engine, there is MVEL based transformer available out of the box that is registered under `http://www.mvel.org/2.0` key.
  Custom implementations can be provided and if they are compliant with JSR 223 then follows above registration approach otherwise they need to be registered manually with `register` method.
  See Also:
    `JavaScriptingDataTransformer`

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DataTransformerRegistry()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.kie.api.runtime.process.DataTransformer` | `find(String languge)`
    `static DataTransformerRegistry` | `get()`
    `void` | `register(String language, org.kie.api.runtime.process.DataTransformer transformer)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DataTransformerRegistry

          protected DataTransformerRegistry()

  - ### Method Detail

    - #### get

          public static DataTransformerRegistry get()

    - #### register

          public void register(String language,
                               org.kie.api.runtime.process.DataTransformer transformer)

    - #### find

          public org.kie.api.runtime.process.DataTransformer find(String languge)

Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.