O'Reilly logo

BPEL and Java Cookbook by Jurij Laznik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining and importing the user-defined functions

In this recipe, we will illustrate how to define the custom functions in Java and how to import them into JDeveloper for the XSLT mapper.

How to do it…

The following text will cover the steps needed to define the custom functions and import them into JDeveloper:

  1. We start by opening an empty Java project in JDeveloper.
  2. In the Java project, we create the Java class (ValueWithUnit.java) that is used as a placeholder for the function logic. What we do is concatenate the value of the field with its corresponding unit as follows:
    public class ValueWithUnit {
      public static String formatValueWithUnit(String value, String unit) {
        return value + " " + unit;
        }
      }
  3. Next, we prepare the configuration file. We create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required