Create Context » History » Revision 41
Revision 40 (Tomislav Pleše, 09/29/2025 11:19 AM) → Revision 41/68 (Tomislav Pleše, 09/29/2025 11:23 AM)
# Create Context |- T-001: Shard-01 | |- T-004: Point | |- T-015: Point |- T-001: Shard-02 | |- T-016: Point | |- T-017: Point | |- T-005: Shard-01 | | |- T-006: Point | | |- T-014: Point | | |- T-007: Shard-01 | | | |- T-010: Point | | | |- T-013: Point | | |- T-007: Shard-02 | | | |- T-011: Point | | | |- T-012: Point <-- starting point | | |- T-007: Shard-03 | | |- T-008: Point | |- T-005: Shard-02 | | |- T-018: Point | |- T-005: Shard-03 | |- T-009: Point |- T-001: Shard-03 |- T-002: Point |- T-003: Point Context: [012, 011, 007(S01+S02), 014, 006, 005(S01), 017, 016, 001(S01+S02) ] | PointId | 012 | 007 | 005 | 001 | |------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| | StartingPoint [in code] | 012 | 012 | 012 | 012 | | PreviousPoint [in code] | "" | 012 | 007 | 005 | | ParentPoint | 007 | 005 | 001 | 001 | | PointChildren | null | null | null | [002, 003] | | ShardList | null | [S01, S02, S03] | [S01, S02, S03] | [S01, S02, S03] | | ParentShard | 007-S02 | 005-S01 | 001-S02 | null | | CurrentParentShard [in code] | null | 007-S02 | 005-S01 | 001-S02 | | ShardPointChildren | null | S02[011, 012] | S01[006, 014, 007] | S02[016, 017, 005, 009] | | | | | | | | PRINT full: | 012 | 011, 007(S01+S02) | 014, 006, 005(S01) | 017, 016, 001(S01+S02) | | | | | | | | If (ShardPointChildren == null && currentParentShard == null) Else (PointChildren == null) | * True: not a Shard | * False: It's a shard. Print ShardPointChildren preceding PreviousPoint | * False: It's a shard. Print ShardPointChildren preceding PreviousPoint | * False: It's a shard. Print ShardPointChildren preceding PreviousPoint (else, print PointChildren) | | | | * PRINT [011] | * PRINT [014, 006] | * PRINT [017, 016] | | Print CurrentPoint: If(Shard) => Print from ShardList Else If (!Shard) => Print Point | * Not a Shard: Print Point | * Shard: Print ShardList from CurrentParentShard and those preceding | * Shard: Print ShardList from CurrentParentShard and those preceding | * Shard: Print ShardList from CurrentParentShard and those preceding | | | * PRINT: 012 | * PRINT: 007- [S01+S02] | * PRINT: 005-[S01] | * PRINT: 001-[S01+S02] | | If (ParentShard == null) | * False: Set CurrentParentShard = ParentShard | * False: Set CurrentParentShard = ParentShard | * False: Set CurrentParentShard = ParentShard | True: | | If (ParentPoint == PointId) | * False: Set PreviousPoint = currentPoint | * False: Set PreviousPoint = currentPoint | * False: Set PreviousPoint = currentPoint | * True: This is Root ParentPoint - END | | | * Go to ParentPoint: 007 | Go to ParentPoint: 005 | Go to ParentPoint: 001 | | FLOW ContextArgs * String? nextPointId; * String? nextPointParentId; * String? nextPointShardId; * String? error; Decision points in the flow: * Is previousPoint = null - new Root Point? * Is previousPoint = Root - directly under Root - root.pointChildren[] -> previousPoint = Root * Is previousPoint = rootChild - under Regular Point - root.pointChildren[] -> previousPoint = Child Point * Is previousPoint = Shard - directly under Shard * Is previousPoint = shardChild - under * Is it a child of a Point /w Shard? * If yes: * If no: print currentPoint * Pseudo-Code * What I need to addTo.messages[] in currentPoint? * What's the nextPoint? 1. currentPoint(T-012) = newPoint -> addTo.messages[] addToMessages[] * CurrentPoint != Root -> nextPoint.exists * True: * What's the nextCurrentPoint? Is it a Sub Prompt (Sharding) product? (isNextPointAShard? -> nextPoint.shardsList[] != null || nextPoint.pointChilren[] != null) * True: * previousPoint = currentPoint; * currentPoint = nextPoint * False: * previousPoint = currentPoint; * currentPoint = nextPoint.parentPoint * False: * 2. currentPoint(T-007) * Does currentPoint have Shards? (currentPoint.shardsList[] != null) * True: * Find Shard: currentShard = currentPoint.shardsList.findPreviousPoint.parentShardId; * Find previousPoint in the shardChildren: currentShard.shardChildren.findPreviousPoint * addTo.messages[].from.currentShard.shardChildren.fromPreviousPointIndex-1 addToMessages[].from.currentShard.shardChildren.fromPreviousPointIndex-1 * addTo.messages[].from.shardsList.fromCurrentShardIndex.fromAnchorEndPoisition addToMessages[].from.shardsList.fromCurrentShardIndex.fromAnchorEndPoisition * Does currentPoint have pointChildren (is it Root)? - if the flow goes through shardChildren (Root has Shards), then pointChildren come only after last Shard - so, not relevant * True: not relevant * False: not relevant * False: Does currentPoint have pointChildren (is it Root)? * True: * Find previousPoint in pointChildren: currentPoint.pointChildren.findPreviousPoint * addTo.messages[].from.pointChildren.fromPreviousPointIndex-1 addToMessages[].from.pointChildren.fromPreviousPointIndex-1 * addTo.messages[].currentPoint addToMessages[].currentPoint * False: * addTo.messages[].currentPoint addToMessages[].currentPoint