DX::Action::SetValue->new(
target_path => $self->target_path,
new_value => $value->but_set_action_builder($self)
+ ->but_set_identity_path($self->target_path)
);
}
target_path => \@add_path,
new_value => $value->but_set_action_builder(
$self->but(target_path => \@add_path)
- )
+ )->but_set_identity_path(\@add_path)
);
}
sub _fmt {
my ($self, $thing, $meta) = @_;
+ return '{}' unless defined($thing);
return $thing unless ref($thing);
my $type = join'_', split '::', lc +(ref($thing) =~ /^(?:DX::)?(.*)/)[0];
$self->${\"_fmt_${type}"}($thing, $meta);
%{$self->revdeps},
$for_id => \@expanded,
};
- my $new_deps = $self->_merge_deps_for($self->deps, $for_id, @expanded);
+ my $new_deps = $self->_merge_deps_for(
+ $self->deps, $for_id, map @{$_}[1..$#$_], @expanded
+ );
ref($self)->new(
deps => $new_deps,
revdeps => $new_revdeps
my %new_revdeps = %{$self->revdeps};
my $new_deps = $self->deps;
$new_deps = $self->_unmerge_deps_for(
- $new_deps, $_, @{$new_revdeps{$_}}
+ $new_deps, $_, map @{$_}[1..$#$_], @{$new_revdeps{$_}}
) for @for_ids;
delete @new_revdeps{@for_ids};
ref($self)->new(
}
sub _expand_deps {
- my ($self, $deps) = @_;
+ my ($self, $dep_groups) = @_;
my @exp;
- assert_DependencyGroupList $deps;
- DEP: foreach my $dep (map @{$_}[1..$#$_], @$deps) {
- my ($type, @path) = @$dep;
- push @exp, [
- $type,
- map { ref() ? @{$_->identity_path or next DEP} : $_ } @path
- ];
- }
- return @exp;
+ assert_DependencyGroupList $dep_groups;
+ map {
+ my ($on, @deps) = @$_;
+ my @exp;
+ DEP: foreach my $dep (@deps) {
+ my ($type, @path) = @$dep;
+ push @exp, [
+ $type,
+ map { ref() ? @{$_->identity_path or next DEP} : $_ } @path
+ ];
+ }
+ (@exp ? [ $on, @exp ] : ());
+ } @$dep_groups;
}
sub _dependents_of {
use DX::ActionPolicy::LockScope;
use Types::Standard qw(ArrayRef);
+use DX::Utils qw(deparse);
use DX::Class;
has scope => (is => 'ro', isa => Scope, required => 1);
use DX::DependencyMap;
use Types::Standard qw(ArrayRef);
+use DX::Utils qw(deparse);
use DX::Class;
has dependency_map => (is => 'ro', isa => DependencyMap, required => 1);
my ($id) = grep $props[$_] eq $prop, 0..$#props;
# 0 is valid, undef means the grep failed
die "Unable to find $prop in proplist" unless defined $id;
- return $self->dependency_map->dependencies_for($id);
+ return $self->dependency_map->dependencies_for($id)||[];
}
1;
package DX::Step::Normal;
use Types::Standard qw(ArrayRef);
+use DX::Utils qw(deparse);
use DX::Class;
with 'DX::Role::Step';
sub apply_to {
my ($self, $old_hyp) = @_;
-#::Dwarn($self->depends_on);
return ($self->_apply_to_hyp($old_hyp), $self->alternative_step);
}
+{ map +($_ => $m->{$_}->to_data), $self->index_list };
}
+sub but_set_identity_path {
+ my ($self, $path) = @_;
+ my $m = $self->members;
+ $self->but(
+ identity_path => $path,
+ members => +{
+ map +($_ => $m->{$_}->but_set_identity_path([ @$path, $_ ])),
+ keys %$m
+ },
+ );
+}
+
1;