skipcheck

TM1 client · Docs · Dimensions and hierarchies

EdgeService

import io.skipcheck.tm1.client.service.dimension.EdgeService;

Edges: /Dimensions('d')/Hierarchies('h')/Edges, the parent-child links of a hierarchy, each keyed by its parent's and its component's names.

List a hierarchy's edges:

// Every parent-child link of the hierarchy, as "parent > child (weight)"
return tm1.edges()
    .list("Region", "Region", ODataQuery.none())
    .map(edge -> edge.parentName() + " > " + edge.componentName() + " (" + edge.weight() + ")");

Change an edge's weight:

// Make Cost count negatively in Margin
return tm1.edges().update("Account", "Account", "Margin", "Cost", EdgePatch.builder().weight(-1.0).build());

Move an element to another parent:

// Move North from Total to Total Sales: add the new edge, then delete the old
return tm1.edges()
    .create("Region", "Region",
            EdgePatch.builder().parentName("Total Sales").componentName("North").weight(1.0).build())
    .flatMap(edge -> tm1.edges().delete("Region", "Region", "Total", "North").thenReturn(edge));

Members

EdgeService constructorA service sending its requests through session.
listGET …/Hierarchies('h')/Edges, streamed.
getGET …/Edges(ParentName='p',ComponentName='c').
createMakes an element a child of a consolidation.
updateChanges the edge's weight.
deleteTakes an element out of a consolidation; the element stays in the hierarchy.
parentGET …/Edges(…)/Parent.
componentGET …/Edges(…)/Component.
hierarchyGET …/Edges(…)/Hierarchy.

EdgeService

constructor
EdgeService(Tm1Session session)

A service sending its requests through session.

Parameters

session
the session

list

Flux<Edge> list(String dimension, String hierarchy, ODataQuery query)

GET …/Hierarchies('h')/Edges, streamed.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
query
what to select, expand, filter and order

Returns

the hierarchy's edges

TM1 REST Navigation Hierarchy/Edges

get

Mono<Edge> get(String dimension, String hierarchy, String parent, String component, ODataQuery query)

GET …/Edges(ParentName='p',ComponentName='c').

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name
query
what to select and expand

Returns

the edge, or a Tm1NotFoundException if there's none

TM1 REST Navigation Hierarchy/Edges

create

Mono<Edge> create(String dimension, String hierarchy, EdgePatch edge)

POST …/Edges: makes an element a child of a consolidation.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
edge
the new edge: parent, component and, optionally, weight

Returns

the edge as created

TM1 REST Navigation Hierarchy/Edges

update

Mono<Void> update(String dimension, String hierarchy, String parent, String component, EdgePatch patch)

PATCH …/Edges(ParentName='p',ComponentName='c'): changes the edge's weight.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name
patch
the changes

Returns

completes when the edge is changed

TM1 REST Navigation Hierarchy/Edges

delete

Mono<Void> delete(String dimension, String hierarchy, String parent, String component)

DELETE …/Edges(ParentName='p',ComponentName='c'): takes an element out of a consolidation; the element stays in the hierarchy.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name

Returns

completes when the edge is deleted

TM1 REST Navigation Hierarchy/Edges

parent

Mono<Element> parent(String dimension, String hierarchy, String parent, String component, ODataQuery query)

GET …/Edges(…)/Parent.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name
query
what to select and expand

Returns

the edge's parent

TM1 REST Navigation Edge/Parent

component

Mono<Element> component(String dimension, String hierarchy, String parent, String component, ODataQuery query)

GET …/Edges(…)/Component.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name
query
what to select and expand

Returns

the edge's component

TM1 REST Navigation Edge/Component

hierarchy

Mono<Hierarchy> hierarchy(String dimension, String hierarchy, String parent, String component, ODataQuery query)

GET …/Edges(…)/Hierarchy.

Parameters

dimension
the dimension's name
hierarchy
the hierarchy's name
parent
the parent's name
component
the component's name
query
what to select and expand

Returns

the edge's hierarchy

TM1 REST Navigation Edge/Hierarchy

Also in the Javadoc.