Introduction

This 15-minute hands-on tutorial shows you how to define expressions to calculate a parent and then store that value for each request action where the parent cannot be found based on a property of the source node.

Background

When you add a node to a source, and submit the change via a subscription request, you want the Enterprise Data Management Cloud engine to find a specific parent in the target. If the parent can be found based on a property of the source node, then you can accomplish this by creating an expression in the node type converter. Learn how to write such expression in the Finding a parent node using a node type converter expression tutorial.

In this tutorial, the expression logic in the node type converter cannot be used to calculate the parent in the target dimension based on a property of the source node. Therefore, the expression in the node type converter defines the parent name as <Unknown>. To calculate the parent name based on the target data, you define an expression for the CoreStats.Parent property for the target node type.

Note:

The expression logic used in this tutorial is not a universal solution. You are building expressions for this particular case. The logic depends on the source and target applications. For other node types, you may have a different expression. Conceptually, the approach is the same.

Prerequisites

Before starting this tutorial, you must:

  • Have Service Administrator access to your Enterprise Data Management Cloud environment.
  • Create a sample application that consists of pre-loaded sample data and related artifacts for Oracle Enterprise Data Management Cloud. For more information, see the documentation.
  • Caution:

    Please note that creating the sample application will remove all existing applications and artifacts in the environment. Back up your current environment before creating the sample applicationt. For more information on backing up, uploading, and importing applications and artifacts, refer to the Administering Migration for Oracle Enterprise Performance Management Cloud documentation.
  • Create a user, and then add the user to the User group and to the Interactive User group. In this tutorial, this user is Barry Dylan.

Inspecting the node type converter

In this section, you locate and inspect the node type converter that defines the parent name as <Unknown>.
  1. Sign in as a user with the Service Administrator role, navigate to Views, and open the Charts of Accounts Redesign view.
    Charts of Accounts Redesign View
  2. Inspect the Account Mapping viewpoint.
    Inspect Account Mapping viewpoint
  3. In the Account Mapping viewpoint inspector, select the Data Chain tab.
    Data Chain tab - Viewpoints
  4. Select the Node Types data chain object, and then select the OldGL node type.
    Data Chain tab - Node Types
  5. In the OldGL node type inspector, select the Converters tab, and then click Edit.
    Converters of the OldGL node type

Creating an expression in the node type converter

In this section, you add the following expression in the node type converter to explicitly set the parent name as unknown:
	  return "<Unknown>"

For more information about creating expressions, please view our video tutorial Transforming Properties Using Expression Builder.

  1. For the Parent property, change operation from Copy to Transform. Then click fx (Edit Expression) to open Expression Builder.
    Parent property
  2. In Expression Builder, in the return statement, enter <Unknown>, and then click Apply.
    Expression Builder
  3. Click Save to save the converter.
    Parent Property Transformation

Creating a subscription

  1. In the inspector, in the bottom left corner select the Account Mapping tab.
    Viewpoint tab
  2. Select the Subscriptions tab, and then click Create.
    Creating Subscription
  3. Set the source viewpoint to Old GL Account in the Charts of Accounts Redesign view, and then click Create.
    Selecting source view
  4. Select the Definition tab, and then click Edit.
    Subscription - Definition tab
  5. Add Barry Dylan as the Default Assignee, and then select Enabled and Auto-Submit.
    Enabling the subsciption
  6. Save the subscription, and then select the Account Mapping tab in the bottom left corner. Notice that the created subscription is listed on the Subscriptions tab.
  7. Subscription tab
  8. Close the inspector.
  9. In the View Modified dialog box, click OK to reload the view.
    View modified
  10. Close the view.

Creating an expression for calculating and storing the Parent name

In this section, you define the following expression to calculate the parent name based on the target data for the CoreStats.Parent property:

{
return node.properties.Core.Name.substring(0, 2).concat("000")
}

The expression takes out the first two characters from a source node name and then adds three zeros to form the parent name.

  1. In the upper left corner, click Navigate icon (Navigate) to open Navigator, and then select Properties.

    Properties tab

  2. Select the CoreStats.Parent property, and then select Inspect from the property's action menu (Action menu).
    CoreStats.Parent Property
  3. In the Financial Cloud application, select OldGL. Click Edit.
    CoreStats.Property
  4. In the Default Type drop-down list, select Calculate and Store. In the Default Value box, click fx (Edit Expression) to open Expression Builder.
    Default Type
  5. Download the expression from this JSON file. In Expression Builder, click Load from File (Load from File) button.
    Expression Builder
  6. In the File Open dialog, select the downloaded JSON file, and then click Open. Verify the expression, and then click Apply.
    Expression to Calculate Parent
  7. Click Save.
    Default Value Expression
  8. In the warning message, click Yes, and then close the property inspector.
    Save property changes

Creating a request to test the expression

  1. Navigate to Views, open the Charts of Accounts Redesign view, and then click New Request.
    Charts of Accounts Redesign view
  2. In the Old GL Account viewpoint, search and select node 4001.
    Node 4001
  3. Click Node menu (Node menu) to the right of the 4001 node to launch the context menu, and then select Add Child to create a node as a child of the 4001 node.
    Add Child
  4. Close the search results panel and define the child properties:

    Property Definition
    Name 4115
    Description Software
    Description US Software
    Summary No
    Enabled Yes
    Allow Posting Yes
    Account Type Revenue

    New node properties
  5. Submit the request.
    New node added
  6. Close the view.

Viewing the request results

  1. Navigate to Requests, and confirm that a request was sent to the request assignee: Barry Dylan. Verify that the request status is Completed and the request stage is Closed.
    Requests
  2. Navigate to Views, and open the Charts of Accounts Redesign view. In the Account Mapping viewpoint, search and expand node 41000. Verify that a new node 4115 was successfully added under parent 41000.
    Account Mapping viewpoint showing a new node added