1 package DX::Step::Normal;
3 use Types::Standard qw(ArrayRef);
4 use DX::Utils qw(deparse);
9 has actions => (is => 'ro', isa => ArrayRef[Action], required => 1);
11 has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1);
13 has alternative_step => (is => 'ro', isa => Step);
16 my ($self, @actions) = @_;
17 $self->but(actions => [ @actions, @{$self->actions} ]);
20 sub but_with_dependencies_on {
21 my ($self, @deps) = @_;
22 $self->but(depends_on => [ @{$self->depends_on}, @deps ]);
25 sub but_with_alternative_step {
26 my ($self, $step) = @_;
27 bless { %$self, alternative_step => $step }, ref($self);
31 my ($self, $old_hyp) = @_;
32 return ($self->_apply_to_hyp($old_hyp), $self->alternative_step);
36 my ($self, $old_hyp) = @_;
37 return undef unless my $hyp = $old_hyp->with_actions(@{$self->actions});
38 return $hyp->resolve_head_dependent_on($self->depends_on);