Class EssBatchOutlineEdit

java.lang.Object
com.appliedolap.essbase.EssBatchOutlineEdit

public class EssBatchOutlineEdit extends Object
A batch outline edit document, built action by action.

Batch outline editing changes many things about an outline in one transaction, applied in the order they are listed - so this builds a document rather than making calls, and EssCube.batchOutlineEdit(EssBatchOutlineEdit) sends the whole thing once.

 EssBatchOutlineEdit edit = EssBatchOutlineEdit.create();
 edit.addMember("Widget", "Product")
         .consolidation(Consolidation.ADD)
         .alias("Our widget")
         .uda("New");
 edit.updateMember("Cola").formula("100-10;");
 edit.deleteMember("Discontinued");
 EssBatchOutlineEditResult result = cube.batchOutlineEdit(edit);
 

Written out by hand rather than through the generated OtlEditMain, which cannot express an action at all, and whose restructOption is spelled in a way the server answers HTTP 500 to. The vocabulary here is Essbase's own mbredit.xsd, which ships inside the install at products/Essbase/EssbaseServer/bin/mbredit.xsd and is the only complete description of this format - the published REST spec erases it.

Covers the member and dimension actions. The smart-list and dependency-list families the schema also defines are not here: they are Planning-oriented, and adding them without a way to exercise them would be guessing in public. EssCube.batchOutlineEdit(String) takes a document as text for anything this does not model.

  • Constructor Details

    • EssBatchOutlineEdit

      public EssBatchOutlineEdit()
  • Method Details

    • create

      public static EssBatchOutlineEdit create()
    • fromPlanningDimension

      public static EssBatchOutlineEdit fromPlanningDimension(Path dimensionFile, String planType) throws IOException
      An edit that rebuilds a dimension from an EPM Cloud artifact snapshot.

      Reads the dimension's .csv - not the batch-outline-edit XML that sits in the same snapshot, which cannot do this. That file addresses every member by a Planning GUID and carries no names, no parents and no hierarchy: it refreshes properties on members that already exist. The .csv is the one with the dimension in it. See EssPlanningDimensionFile for where they live in a snapshot.

       EssBatchOutlineEdit edit = EssBatchOutlineEdit.fromPlanningDimension(
               Path.of("Artifact Snapshot/HP-Vision/resource/Global Artifacts/"
                       + "Common Dimensions/Standard Dimensions/Account.csv"), "Vision");
       EssBatchOutlineEditResult result = cube.batchOutlineEdit(edit);
       
      Parameters:
      dimensionFile - the dimension's .csv
      planType - which cube's columns to read - Planning records consolidation, storage, formula and solve order per plan type, and they differ
      Returns:
      an edit adding or updating every member of that dimension, parents first. Label-only and dynamic-calc storage is not in it - see EssPlanningDimensionFile.toStorageRefinement(java.lang.String), which is a second call for reasons explained there
      Throws:
      IOException - if the file cannot be read
    • outlineVersion

      public EssBatchOutlineEdit outlineVersion(int outlineVersion)
      The outline version this edit expects, for guarding against a concurrent change.
      Parameters:
      outlineVersion - the version, or -1 to skip the check (the default)
    • validate

      public EssBatchOutlineEdit validate(boolean validate)
      Whether the server validates the outline after applying the edit. Defaults to true, server-side.
    • validateFormulas

      public EssBatchOutlineEdit validateFormulas(boolean validateFormulas)
    • keepTransaction

      public EssBatchOutlineEdit keepTransaction(boolean keepTransaction)
      Whether to hold the edit open as a transaction. Required by a few actions - setting a dimension's data member among them - and off by default.
    • restructure

      public EssBatchOutlineEdit restructure(EssBatchOutlineEdit.Restructure restructure)
    • addMember

      public EssBatchOutlineEdit.MemberAction addMember(String member, String parent)
      Adds a member, failing with a warning if it already exists.

      The new member goes first among its parent's children unless EssBatchOutlineEdit.Action.after(String) places it - so adding several in order means passing each the previous one.

      Parameters:
      member - the new member's name
      parent - the parent to add it under
      Returns:
      the action, for setting the new member's properties
    • addOrUpdateMember

      public EssBatchOutlineEdit.MemberAction addOrUpdateMember(String member, String parent)
      Adds the member, or updates it where it already exists.
    • updateMember

      public EssBatchOutlineEdit.MemberAction updateMember(String member)
      Changes an existing member's properties.
    • deleteMember

      public EssBatchOutlineEdit.Action deleteMember(String member)
    • renameMember

      public EssBatchOutlineEdit.Action renameMember(String member, String newName)
      Parameters:
      newName - what the member should be called afterwards
    • moveMember

      public EssBatchOutlineEdit.Action moveMember(String member, String newParent)
    • associateAttribute

      public EssBatchOutlineEdit.Action associateAttribute(String member, String attributeDimension, String attributeMember)
      Associates one attribute member with a base member.
    • dissociateAttributes

      public EssBatchOutlineEdit.Action dissociateAttributes(String member)
      Removes every attribute association from a base member - all of them, not a named one.
    • updateDimension

      public EssBatchOutlineEdit.DimensionAction updateDimension(String dimension)
      Changes a dimension's own properties.
    • associateAttributeDimension

      public EssBatchOutlineEdit.Action associateAttributeDimension(String dimension, String attributeDimension)
      Attaches an attribute dimension to a base dimension.
    • sortChildren

      public EssBatchOutlineEdit.Action sortChildren(String member, EssBatchOutlineEdit.SortOrder order, boolean recursive)
    • setDataStorage

      public EssBatchOutlineEdit.Action setDataStorage(String member, EssBatchOutlineEdit.DataStorage storage, EssBatchOutlineEdit.ApplyTo applyTo, Integer number)
      Sets data storage across a swathe of members at once. Level-0 members are skipped by the server.
      Parameters:
      number - the level or generation number, required when applyTo is one of those
    • markForDelete

      public EssBatchOutlineEdit.Action markForDelete(String dimension)
      Marks every member of a dimension for deletion, so a following build can spare the ones it mentions and deleteMarked(String) removes the rest. The two halves of how Essbase deletes members that a source system has stopped sending.
    • deleteMarked

      public EssBatchOutlineEdit.Action deleteMarked(String dimension)
    • action

      public EssBatchOutlineEdit.Action action(String element)
      An action this does not model, by its element name and attributes.

      The escape hatch that keeps the rest of the builder honest: rather than pretend to cover the whole schema, anything missing - a smart list, a dependency list - can still be expressed here without dropping to raw XML for the entire document.

      Parameters:
      element - the action's element name, as mbredit.xsd spells it
    • size

      public int size()
      Returns:
      how many actions this document carries
    • toXml

      public String toXml()
      The document, as the XML the endpoint takes.
      Returns:
      a complete otlEditMain document
    • toString

      public String toString()
      Overrides:
      toString in class Object