| 1 | package Daje::Workflow::Activities::Process::Run; | ||
| 2 | use Mojo::Base 'Daje::Workflow::Common::Activity::Base', -base, -signatures; | ||
| 3 | use v5.42; | ||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Workflow::Activities::Process::Run - It's a tool to run a process | ||
| 9 | # | ||
| 10 | # SYNOPSIS | ||
| 11 | # ======== | ||
| 12 | # | ||
| 13 | # use Daje::Workflow::Activities::Process::Run; | ||
| 14 | # | ||
| 15 | # "activity_data": { | ||
| 16 | # "process" : { | ||
| 17 | # "program": "program to run" | ||
| 18 | # } | ||
| 19 | # } | ||
| 20 | # | ||
| 21 | # Mandatory meta data | ||
| 22 | # | ||
| 23 | # - program to run | ||
| 24 | # | ||
| 25 | # | ||
| 26 | # | ||
| 27 | # DESCRIPTION | ||
| 28 | # =========== | ||
| 29 | # | ||
| 30 | # Daje::Workflow::Activities::Process::Run is a process runner | ||
| 31 | # | ||
| 32 | # LICENSE | ||
| 33 | # ======= | ||
| 34 | # | ||
| 35 | # Copyright (C) janeskil1525. | ||
| 36 | # | ||
| 37 | # This library is free software; you can redistribute it and/or modify | ||
| 38 | # it under the same terms as Perl itself. | ||
| 39 | # | ||
| 40 | # AUTHOR | ||
| 41 | # ====== | ||
| 42 | # | ||
| 43 | # janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 44 | # | ||
| 45 | |||
| 46 | sub execute($self) { | ||
| 47 | |||
| 48 | $self->model->insert_history( | ||
| 49 | "Run process", | ||
| 50 | "Daje::Workflow::Activities::Process::Run::execute", | ||
| 51 | 1 | ||
| 52 | ); | ||
| 53 | |||
| 54 | try { | ||
| 55 | my $program = $self->activity_data->{process}->{program}; | ||
| 56 | system $program; | ||
| 57 | } catch($e) { | ||
| 58 | $self->error->add_error($e); | ||
| 59 | }; | ||
| 60 | |||
| 61 | |||
| 62 | } | ||
| 63 | 1; | ||
| 64 | #################### pod generated by Pod::Autopod - keep this line to make pod updates possible #################### | ||
| 65 | |||
| 66 | =head1 NAME | ||
| 67 | |||
| 68 | |||
| 69 | Daje::Workflow::Activities::Process::Run - It's a tool to run a process | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | =head1 SYNOPSIS | ||
| 74 | |||
| 75 | |||
| 76 | use Daje::Workflow::Activities::Process::Run; | ||
| 77 | |||
| 78 | "activity_data": { | ||
| 79 | "process" : { | ||
| 80 | "program": "program to run" | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 84 | Mandatory meta data | ||
| 85 | |||
| 86 | =over | ||
| 87 | |||
| 88 | =item * | ||
| 89 | program to run | ||
| 90 | |||
| 91 | =back | ||
| 92 | |||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | |||
| 97 | =head1 DESCRIPTION | ||
| 98 | |||
| 99 | |||
| 100 | Daje::Workflow::Activities::Process::Run is a process runner | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | =head1 REQUIRES | ||
| 105 | |||
| 106 | L<v5.42> | ||
| 107 | |||
| 108 | L<Mojo::Base> | ||
| 109 | |||
| 110 | |||
| 111 | =head1 METHODS | ||
| 112 | |||
| 113 | =head2 execute($self) | ||
| 114 | |||
| 115 | execute($self)(); | ||
| 116 | |||
| 117 | NAME | ||
| 118 | ==== | ||
| 119 | |||
| 120 | Daje::Workflow::Activities::Process::Run - It's a tool to run a process | ||
| 121 | |||
| 122 | SYNOPSIS | ||
| 123 | ======== | ||
| 124 | |||
| 125 | use Daje::Workflow::Activities::Process::Run; | ||
| 126 | |||
| 127 | "activity_data": { | ||
| 128 | "process" : { | ||
| 129 | "program": "program to run" | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | Mandatory meta data | ||
| 134 | |||
| 135 | =over | ||
| 136 | |||
| 137 | =item * | ||
| 138 | program to run | ||
| 139 | |||
| 140 | =back | ||
| 141 | |||
| 142 | |||
| 143 | |||
| 144 | DESCRIPTION | ||
| 145 | =========== | ||
| 146 | |||
| 147 | Daje::Workflow::Activities::Process::Run is a process runner | ||
| 148 | |||
| 149 | LICENSE | ||
| 150 | ======= | ||
| 151 | |||
| 152 | Copyright (C) janeskil1525. | ||
| 153 | |||
| 154 | This library is free software; you can redistribute it and/or modify | ||
| 155 | it under the same terms as Perl itself. | ||
| 156 | |||
| 157 | AUTHOR | ||
| 158 | ====== | ||
| 159 | |||
| 160 | janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 161 | |||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | =head1 AUTHOR | ||
| 166 | |||
| 167 | |||
| 168 | janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 169 | |||
| 170 | |||
| 171 | |||
| 172 | =head1 LICENSE | ||
| 173 | |||
| 174 | |||
| 175 | Copyright (C) janeskil1525. | ||
| 176 | |||
| 177 | This library is free software; you can redistribute it and/or modify | ||
| 178 | it under the same terms as Perl itself. | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | =cut | ||
| 183 |