Skip to content

Conversation

@jezhiggins
Copy link
Contributor

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.

Only used by the Finding state resources in tymly-core, which is where this code should have been
all along.
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.
Currently only support DayOfWeek property
@codecov
Copy link

codecov bot commented Dec 12, 2020

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%) ⬆️
lib/state-machines/state-types/Base-state.js 98.86% <100.00%> (+0.01%) ⬆️
...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%) ⬆️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants