AnsweredAssumed Answered

Problem with triggering SugarBPM process

Question asked by Yury Voloshin on Jun 4, 2019
Latest reply on Jun 6, 2019 by Yury Voloshin

I have SugarBPM process (formerly known as Advanced Workflow) that sends an email when a field in Meetings module changes to 1. The value of this field is set by a Scheduled Job, which runs a MySQL query like this:

$Query = "
   UPDATE
         meetings m
         JOIN meetings_cstm mc ON mc.id_c = m.id
   SET
         mc.end_passed_c = IF(m.date_end < CURRENT_TIMESTAMP, 1, 0)
   WHERE
         m.deleted = 0
   ;
   ";

$db->query($Query);

 

The Scheduled Job sets the values as expected. But the SugarBPM process is not triggered when end_passed_c changed to 1. I suspect this happens because the value is changed by a MySQL query instead of $bean->save(), and calling $bean->save() is needed to trigger a SugarBPM process. Is this correct, or is there another problem here?

 

P. S. I'm trying to avoid using $bean->save() because this function triggers sending record assignment notifications in Meetings module. If there is no way to trigger this process while using an UPDATE MySQL query, then I'll have to send the email manually using PHP code from the scheduled job.

Outcomes