rename alternatives to adjustments
[scpubgit/DX.git] / lib / DX / Step / ResolveProposition.pm
index cb236d8..17df581 100644 (file)
@@ -12,7 +12,20 @@ with 'DX::Role::Step';
 
 has actions => (is => 'ro', isa => ArrayRef[Action], required => 1);
 
-has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1);
+#has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1);
+
+has depends_on => (is => 'ro', required => 1, coerce => sub {
+  my ($deps) = @_;
+  my @exp;
+  DEP: foreach my $dep (@$deps) {
+    my ($type, @path) = @$dep;
+    push @exp, [
+      $type,
+      map { ref() ? @{$_->value_path or next DEP} : $_ } @path
+    ];
+  }
+  \@exp
+});
 
 has resolves => (is => 'ro', isa => Proposition);
 
@@ -43,9 +56,9 @@ sub apply_to {
   my $ss = $old_ss->but(
     next_step => $ns,
     ($alt_step
-      ? (alternatives => [
-          [ $old_ss->current_hypothesis, $alt_step ],
-          @{$old_ss->alternatives}
+      ? (adjustments_made => [
+          [ $self, $old_ss->current_hypothesis ],
+          @{$old_ss->adjustments_made}
         ])
       : ()
     ),