+sub FindDependencies {
+ my $self = shift;
+ my ($walker, $deps) = @_;
+
+ $self->SUPER::FindDependencies($walker, $deps);
+
+ my $applied = RT::ObjectScrips->new( $self->CurrentUser );
+ $applied->LimitToScrip( $self->id );
+ $deps->Add( in => $applied );
+
+ $deps->Add( out => $self->ScripConditionObj );
+ $deps->Add( out => $self->ScripActionObj );
+ $deps->Add( out => $self->TemplateObj );
+}
+
+sub __DependsOn {
+ my $self = shift;
+ my %args = (
+ Shredder => undef,
+ Dependencies => undef,
+ @_,
+ );
+ my $deps = $args{'Dependencies'};
+ my $list = [];
+
+ my $objs = RT::ObjectScrips->new( $self->CurrentUser );
+ $objs->LimitToScrip( $self->Id );
+ push @$list, $objs;
+
+ $deps->_PushDependencies(
+ BaseObject => $self,
+ Flags => RT::Shredder::Constants::DEPENDS_ON,
+ TargetObjects => $list,
+ Shredder => $args{'Shredder'}
+ );
+
+ return $self->SUPER::__DependsOn( %args );
+}
+
+sub Serialize {
+ my $self = shift;
+ my %args = (@_);
+ my %store = $self->SUPER::Serialize(@_);
+
+ # Store the string, not a reference to the object
+ $store{Template} = $self->Template;
+
+ return %store;
+}
+