X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDX%2FOp%2FProposeAction.pm;h=e63eb40ee907ebab437bf96195133ccb382991ee;hb=577a2146b78ad2f1703c4231c6a11c9b1ec9827c;hp=b1aa7f351a67173d20ba990791c97beed67e5b78;hpb=6d55e4c6f80e28a5523a7d3744162ed83ff828f3;p=scpubgit%2FDKit.git diff --git a/lib/DX/Op/ProposeAction.pm b/lib/DX/Op/ProposeAction.pm index b1aa7f3..e63eb40 100644 --- a/lib/DX/Op/ProposeAction.pm +++ b/lib/DX/Op/ProposeAction.pm @@ -21,11 +21,12 @@ sub run { my @deps = $state->action_dependencies(map $_->id, @vars); my $action = $self->builder->(map $state->resolve_value($_), @vars) ->but(dependencies => \@deps); + my ($rec_state, $action_id) = $state->record_action($action); my ($fact_type, $value) = $action->expected_effect; - my $final_value = $value->but(required_action => $action); + my $final_value = $value->but(required_action => $action_id); my $fact_set = $state->facts->{$fact_type}->with_value($final_value); - $state->but(facts => { %{$state->facts}, $fact_type => $fact_set }) - ->then($self->next); + $rec_state->but(facts => { %{$state->facts}, $fact_type => $fact_set }) + ->then($self->next); } 1;