Context object support
Implement the Context Object
The specification talks about Context Object, but we already referred to the input as ctx, the context. Consequently, in our code I'm referring to the ExecutionContext rather than the Context Object. It's not the greatest name, but hopefully it's different enough from our existing names to be clear.
The change is relatively small - we simply use the ExecutionContext when we're evaluating a state's inputs. We don't need it anywhere else. There's a small change to the argument parser to accommodate the $$.path construction, and an extra evaluation function, but that's about it.
The ExecutionContext object provides a number of read-only properties, some of which it derives from the state's execution description.
Codecov Report
Merging #313 (4b5cffe) into master (62223d2) will increase coverage by
1.59%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #313 +/- ##
==========================================
+ Coverage 86.06% 87.66% +1.59%
==========================================
Files 35 36 +1
Lines 854 851 -3
==========================================
+ Hits 735 746 +11
+ Misses 119 105 -14
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/state-machines/state-types/Task.js | 92.10% <ø> (+23.58%) |
:arrow_up: |
| lib/state-machines/state-types/Base-state.js | 98.86% <100.00%> (+0.01%) |
:arrow_up: |
| ...te-machines/state-types/execution-context/index.js | 100.00% <100.00%> (ø) |
|
| ...es/state-types/path-handlers/input-path-handler.js | 100.00% <100.00%> (ø) |
|
| .../state-types/path-handlers/input-path-tokeniser.js | 100.00% <100.00%> (ø) |
|
| ...te-types/path-handlers/payload-template-handler.js | 98.48% <100.00%> (+0.02%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a66f0ef...4b5cffe. Read the comment docs.