statebox icon indicating copy to clipboard operation
statebox copied to clipboard

Context object support

Open jezhiggins opened this issue 5 years ago • 1 comments

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.

jezhiggins avatar Dec 12 '20 14:12 jezhiggins

Codecov Report

Merging #313 (4b5cffe) into master (62223d2) will increase coverage by 1.59%. The diff coverage is 100.00%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update a66f0ef...4b5cffe. Read the comment docs.

codecov[bot] avatar Dec 12 '20 14:12 codecov[bot]