ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 9 replies, has 4 voices, and was last updated by  KnutFr 1 year, 11 months ago.

  • Creator
    Topic
  • #13915

    KnutFr
    Participant

    Hi,

    I would like to know is it possible to add some specific call (like script or API call) in workflow ?
    For example in my Workflow I would like to call http://localhost/myApiCall which return UserId list for marketing mailing.

    Thanks a lot.
    KnutFR

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #13983

    adrienpit
    Participant

    Hi,

    Same question for me, is it possible ?

    Thanks

    #14019
    Dima Soroka
    Dima Soroka
    Oro Core

    Yes, this is possible with custom actions in workflow definition.

    #14032

    KnutFr
    Participant

    Hi,

    Thanks for your advice, I would like to know if you have a complete example of custom workflow implementation. In my case, I have declared a service and a matching controller which call my script.

    After this step, how can I add this transition in a new/existing workflow?

    Do I have to create whole workflow as a services ?

    Thanks,

    KnutFr

    #14764
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, KnutFr.

    > I would like to know if you have a complete example of custom workflow implementation.
    Not sure what you mean by example of custom workflow implementation. Every workflow has it’s definition – you can change it in code, you can create new one etc.

    > In my case, I have declared a service and a matching controller which call my script.
    Well, it usually better to define actions without controller actions (example). In case you still need to use it – you should handle it as sub request.

    > After this step, how can I add this transition in a new/existing workflow?
    You need either create new workflow or clone existing one, and then add new transition with your action there (here is simple transition and transition definition examples).

    > Do I have to create whole workflow as a services ?
    Well, workflow is not defined as service – workflow is an object that created in runtime based on workflow definition. Usually you need to define worklfow action as a service with special tag and unique alias/action name (example).

    If you still have some workflow related questions – feel free to post them here.

    #14991

    KnutFr
    Participant

    Hi,

    I have implemented a process which sending some mail from defined template :

    But when this process is executed, i have the following error message:

    Do I have forget something in my action declaration ?
    Maybe something is missing in template owner’s profile ?

    Thanks a lot,
    KnutFr

    #14994
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Look’s like CRM can’t find an entity with email contac@egswcn.com – there should be an author for this email (e.g. User entity). Please, try to register user with this email and check again.

    #15014

    KnutFr
    Participant

    Hi,

    Just asking a final question and I think that my process will be complete !
    I have a cron call (oro:cron:checkprocess) which alter some record on a custom entity.
    I have also created a process, triggered on update on those records (from custom entity) but when my cron job is executed and DB alterated, the trigger doesn’t launch my process.

    Am I doing something wrong ?
    Is it possible to directly call a process at the end of execute() cron job method ?

    Again thanks a lot !
    KnutFr

    #15015
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    To make process executed following conditions must be satisfied:
    – process definition is active
    – process trigger listens to changing of entity field (specific or any field)
    – entity field was changed (i.e. defined in entity changeset)

    What might be wrong in your case:
    – process definition is disabled or doesn’t listen to correct event/field
    – you changing field of related entity, not root entity; e.g. you have contact related to your custom entity, and you are changing contact first name – in this case process for custom entity will not be executed

    To find out why your process is not executed you should try to do some actions from UI (make sure process is executed) and check changeset used at UI, and then do the same from CLI – probably, you should see the difference.

    > Is it possible to directly call a process at the end of execute() cron job method ?
    Yes, it’s possible, but not recommended. You can manually run methods handleTrigger and finishTrigger (and maybe including isTriggerApplicable) from ProcessHandler. To understand how they work see ProcessCollectorListener and ExecuteProcessJobCommand classes.

    #15022

    KnutFr
    Participant

    The problem was my code, in fact in my process I modified the field without Entity Manager, when I’m using it everything works fine !

    Again thank you a lot !

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

You must be logged in to reply to this topic.