use v5.42;
use experimental 'class';

class Daje::Workflow::Details::Analyser{
    field $activities :reader;
    field $loader :param;
    field $routes :reader;

    method analyze() {

        my $workflow = $loader->workflow();
        while (my ($wfl_key, $wfl_val) = each(%{$workflow})) {
            my $len = scalar @{$wfl_val};
            for(my $j = 0; $j < $len; $j++) {
                my $acti = @{$wfl_val}[$j]->{state}->{activities};
                my $leng = scalar @{$acti};
                for(my $k = 0; $k < $leng; $k++) {
                    my $activity->{workflow} = $wfl_key;
                    $activity->{state} = @{$wfl_val}[$j]->{name};;
                    $activity->{activity} = @{$acti}[$k]->{name};
                    push @{$activities}, $activity;
                    my $route = "/$wfl_key/@{$acti}[$k]->{name}/";
                    push (@{$routes}, $route);
                }
            }
            my $test = 1;
        }
    }
}


1;





#################### pod generated by Pod::Autopod - keep this line to make pod updates possible ####################

=head1 NAME

lib::Daje::Workflow::Details::Analyser - lib::Daje::Workflow::Details::Analyser


=head1 DESCRIPTION

pod generated by Pod::Autopod - keep this line to make pod updates possible ####################


=head1 REQUIRES

L<experimental> 

L<v5.42> 


=head1 METHODS


=cut

