Forums

Covering OroCommerce, OroCRM, OroPlatform topics, including community updates and company announcements.

Forums OroCommerce Cam I pass parameter to my custome schedule job

This topic contains 2 replies, has 2 voices, and was last updated by Ayman Hussein Ayman Hussein 6 months, 2 weeks ago.

  • Creator
    Topic
  • #32818
    Ayman Hussein
    Ayman Hussein
    Participant

    I have created new schedule job ‘watcher-job’ and I override execute function inside WatcherJobCommand class, Now I need to implement my logic inside it depends on types like:

    can i pass new param to when call oro:cron:watcherjob and catch it in execute function.

    Thanks,
    Ayman


    arh922

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #32819
    vseniuk
    vseniuk
    Participant

    Hello Ayman,

    Please look at this example:

    We have a console command that was created according to the documentation and it implements \Oro\Bundle\CronBundle\Command\CronCommandInterface.

    This command will be executed by cron every minute. If you want pass some options to it, you should define them as a defaults:

    Now command will be executed by cron every minute with type=1. Also you can execute this command manually and put another value of option type. Example: app/console oro:cron:example --type=2.

    You cannot executed command by cron with dynamic option.

    #32820
    Ayman Hussein
    Ayman Hussein
    Participant

    Thank you @vseniuk, I got it.


    arh922

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No
ssossossossossosso