Forums › Forums › OroPlatform › OroPlatform – Programming Questions › cronjob for process
This topic contains 5 replies, has 3 voices, and was last updated by Marko 6 years, 9 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- January 24, 2017 at 1:26 am #34343
Hi Team,
I created a process with cron trigger, to send email.
and I setup the crontab like this:PHP1*/1 * * * * /home/thinh/www/oroplatform/app/console oro:cronMy process I config run every minute to test.
But it doesn’t work well
The Job menu I can see the job is success but I dont receive any email. This is display in Job menu:
PHP1Job "oro:cron:run_command:oro:process:handle-trigger---id=19---name=send_email_to_notification_add_evaluation" success uniqueI tried to run this command manual:
PHP1app/console oro:process:handle-trigger --id=19 --name=send_email_to_notification_add_evaluationand it works, I can receive the email.
Do you have any idea?
Thanks, - CreatorTopic
- AuthorReplies
- February 3, 2017 at 4:38 am #34344
Hi
Here is my process:
YAML1234567891011121314151617definitions:send_cron_email:label: ''enabled: trueentity: OroCRM\Bundle\ContactUsBundle\Entity\ContactRequestorder: 10actions_configuration:- @send_email:from: 'mkudelya@gmail.com'to: 'mkudelya@gmail.com'subject: 'Just Test 1'body: 'Body 1'triggers:send_cron_email:-cron: '*/3 * * * *'I’m able to retrieve emails every minute. My version is 1.10.14. Which version are you using ? Can you give me your process yml ?
February 6, 2017 at 6:50 pm #34345Hi,
Sorry for late reply,
This is my process yml. My version is 2.0.0-rc.1 (I am going to upgrade to 2.0.0)
PHP1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162processes:definitions:send_email_to_notification_add_evaluation:label: 'Send email to alert student add evaluation'enabled: trueentity: Phs\Bundle\SchoolBundle\Entity\Courseorder: 10actions_configuration:- '@find_entities':class: Phs\Bundle\SchoolBundle\Entity\Courseattribute: $.result.courseswhere:'@and':- endDates: 'IS NOT NULL'- '@foreach':array: $.result.coursesvalue: $.value.courseactions:- '@tree':conditions:@not_empty: $.value.course.endDatesactions:- '@foreach':array: $.value.course.endDatesvalue: $.result.endDateactions:- '@create_datetime':attribute: $.date- '@tree':conditions:@gt: [$.date, $.result.endDate.endDate]actions:- '@find_entities':class: Phs\Bundle\SchoolBundle\Entity\ClassGroupattribute: $.result.classeswhere:'@and':- intake: $.result.endDate.intake- program: $.program- '@foreach':array: $.result.classesvalue: $.value.classactions:- '@foreach':array: $.value.class.studentsvalue: $.value.studentactions:- '@tree':- @send_email_template:attribute: $.attrfrom: 'thinhnguyen1011@gmail.com'to: 'thinh1011@gmail.com'template: 'course_evaluate_notification'entity: $.value.coursetriggers:send_email_to_notification_add_evaluation:-cron: '*/1 * * * *'It looks quite complicated, but I am sure it works when I run in the command.
February 13, 2017 at 8:47 am #34346Hi
I have analogical behaviour. Probably you found the bug. We will investigate the problem. As workaround i can suggest you put this code to this line:
PHP123456789if (count($commandArguments) > 0) {foreach($commandArguments as $key => $argument) {if (strpos($argument, '=') !== FALSE) {list($name, $value) = explode('=', $argument);$commandArguments[$name] = $value;unset($commandArguments[$key]);}}}June 2, 2017 at 8:11 am #34347Hi Mike Kudelya,
Any update on this issue? I am encountering same issue, btw, your code seems to fix it but I would like to avoid changing the core.
Any chance for a patch?
Many thanks.
June 5, 2017 at 4:12 am #34348Anyone ? :)
- AuthorReplies
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.