HiLang definition Extension property


Extents

| Documentation | Property | Name| ID | Expression | Prelude |

Elements extent consists of one or more Extent separated by commas. Each Extent is either a relation to another element, or an expression. When an Entity is extended with a segment, a reference to the owner is added to the start of the concrete element key. Extents are not stored with the element they extend but are navigable from as if they were part of the body. Extents add to immutable elements and avoid the need to version non-immutable ones. The notation uses open collection “[“and close collection “]” like a mathematical vector/matrix

Extent

Relations are either references to other entities, segments, or aspects (one of). In this example Attribute is a relation to another entity (using the self KeyRef<> property of the element), while ObjectMetric is a segment that inherits the key (as owner) from the parent element.

Resources : Plan.Tasks.TaskResource, to reference a single aspect value or a segment collection SubTasks : Plan.Tasks.Task (Parent = this) to reference an entity using join conditions - in this example all Tasks that reference this task with a key or value Parent BIWBS = Parent = null ? Project.WBS + "." + WBS : Parent.BIWBS + "." + WBS to derive the extension property from an expression

Plan.Tasks.Task is an example where different extent properties are used to navigate aspects, segments and other entities

entity Plan.Tasks.Task : Versioned
(
   Project     : Plan.Project,                         /* composite key                    /*
   Id          : Int32
)
{
   Parent      : Plan.Tasks.Task,                      /* Reference to parent              */
   WBS         : String,
   Duration    : Plan.Duration,                        /* value type included in store     */
   Cost        : Decimal,
   Valid       = Project  = null ||                    /* value computed prior to bind     */
                 Duration = null ||
                 Name     = null 
                 ? false : true
}
[
   Actual      : Plan.Tasks.Actual,                    /* reference to an aspect           */
   After       : Plan.Tasks.TaskLink,                  /* reference segemnts               */
   SubTasks    : Plan.Tasks.Task (Parent = this),      /* join when neeed                  */
   @CubeMeasure(Aggregate.First)                       /* expression extent                */
   BIWBS       = Parent = null ? Project.WBS + "." + WBS : Parent.BIWBS + "." + WBS,  
   "Cost of prior tasks that can not be recovered"
   @CubeMeasure(Aggregate.Sum)
   SunkCost    = 0.0 + sum (After.LinkCost),           /* recursive calculation            */
   PctComplete = Actual.Duration.Time / Duration.Time,
   @CubeMeasure(Aggregate.Sum) 
   PlanCost    = Cost +                                /* complex calculation              */
                 sum (SubTasks.PlanCost) +
                 sum (Resources.UseCost) + 
                 0.0 + (sum (Resources.TimeCost) * Duration.Time),
];
Copyright © Cepheis 2024