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.
- 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.
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.Inspecting the node type converter
In this section, you locate and inspect the node type converter that defines the parent name as <Unknown>.- Sign in as a user with the Service Administrator role, navigate to Views, and open the Charts of Accounts Redesign view.
- Inspect the Account Mapping viewpoint.
- In the Account Mapping viewpoint inspector, select the Data Chain tab.
- Select the Node Types data chain object, and then select the OldGL node type.
- In the OldGL node type inspector, select the Converters tab, and then click Edit.
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.
- For the Parent property, change operation from Copy to Transform. Then click fx (Edit Expression) to open Expression Builder.
- In Expression Builder, in the return statement, enter <Unknown>, and then click Apply.
- Click Save to save the converter.
Creating a subscription
- In the inspector, in the bottom left corner select the Account Mapping tab.
- Select the Subscriptions tab, and then click Create.
- Set the source viewpoint to Old GL Account in the Charts of Accounts Redesign view, and then click Create.
- Select the Definition tab, and then click Edit.
- Add Barry Dylan as the Default Assignee, and then select Enabled and Auto-Submit.
- 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.
- Close the inspector.
- In the View Modified dialog box, click OK to reload the view.
- Close the view.
![Subscription tab](images/03-creating-subscription-07.png)
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.
- In the upper left corner, click
(Navigate) to open Navigator, and then select Properties.
- Select the CoreStats.Parent property, and then select Inspect from the property's action menu (
).
- In the Financial Cloud application, select OldGL.
Click Edit.
- In the Default Type drop-down list, select Calculate and Store.
In the Default Value box, click fx (Edit Expression) to open Expression Builder.
- Download the expression from this
JSON
file. In Expression Builder, click(Load from File) button.
- In the File Open dialog, select the downloaded
JSON
file, and then click Open. Verify the expression, and then click Apply. - Click Save.
- In the warning message, click Yes, and then close the property inspector.
Creating a request to test the expression
- Navigate to Views, open the Charts of Accounts Redesign view, and then click New Request.
- In the Old GL Account viewpoint, search and select node 4001.
- Click
(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.
- 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
- Submit the request.
- Close the view.
Viewing the request results
- 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.
- 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.
Related Links
Calculating and storing the parent of a node
F84229-02
January 2024