Show TOC

Procedure documentationPerforming Complex Data Transformation with Functions Locate this document in the navigation structure

 

You create a function to perform a complex data transformation. This function relates all of its inputs to exactly one output. The names and types of the input parameters and the value type, which the function returns are specified in the function's signature. You define how the function does the data transformation when you implement the function.

You can reuse functions from one project in another.

When you create functions, you do the following:

  1. Define the function type.

    You define one of the following function types:

    • Expression function

      You define how the function does the data transformation with an expression.

    • Mapping function

      You define how the function does the data transformation with a mapping.

    • EJB function

      You define how the function does the data transformation with an Enterprise Java Beans (EJB) implementation. You specify the Java Naming Directory Interface (JNDI) name of the EJB. The EJB has a special method that executes the EJB function.

    • Ruleset function

      You define how the function does the data transformation with a ruleset.

  2. Define the function name.

  3. Define the function return type.

    The return type is the type of value that is produced after the data transformation.

  4. Define the function input parameters.

Prerequisites

You have opened the Process Composer perspective in the SAP NetWeaver Developer Studio and have expanded your project in Project Explorer view.

Procedure

  1. Expand Process Modeling.

  2. In the context menu of the Rules and Functions folder, choose one of the following function types depending on your needs:

    • New Expression Function... type

    • New Mapping Function... type

    • New EJB Function... type

    • New Ruleset... type

  3. In the dialog that appears, specify a function name in the Function name field.

    Note Note

    The function namespace is predefined and it is the namespace of the development component (DC) that contains your project and where you create your function. You can also use functions created in different DCs in your current project. To do that, you proceed as follows:

    1. You declare dependencies to the DC containing the function you want to use. For more information about dependencies, see Defining Development Component Dependencies.

    2. You define the namespace prefix of the DC containing the function you want to use, before using the function.

    End of the note.
  4. Select a function return type from the Return type dropdown menu.

    Note Note

    The return type of a ruleset should be either primitive XSD type or it should match the parameter type.

    End of the note.
  5. (Optional) Select the Multiple Occurrences checkbox if the function return type is a list of elements.

  6. Choose the Add pushbutton to add function parameters.

  7. Click the parameter's type in the Type field to activate the dropdown menu and select a type.

    Note Note

    You can click the parameter's name in the Name filed if you want to rename the parameter.

    End of the note.
  8. (Optional) Select the checkbox in the Multiple Occurrences field if the parameter type is a list of elements.

  9. Choose the Finish pushbutton.

Result

You have created a function and have defined its signature. You can change the function name and signature and you can define the function implementation when you edit the function. For more information about editing functions, see Editing Functions.