4 replies [Last post]
nicksageek's picture
Offline
Bug Finder
Joined: 09/20/2007
Juice: 53
Was this information Helpful?

Our IT department reads and writes to the Ubercart database and marks orders from Pending to Processing, then when it has shipped it plugs in tracking info and marks it Complete.

How can I get Workflow-ng to detect this change and notify the customer of the changes when the database is being edited from outside. This would save hand processing all the orders. Is there a cron job, or page I could access?

Thanks in advance,

Nick

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Workflow-ng detecting database change from outside

Workflow-ng is used whenever workflow_ng_invoke_event() is called. If the database is changed through some script, it can call that function for the 'order_status_update' event and pass it all the needed information. Look through the code to find how Übercart uses it so you can emulate it.

nicksageek's picture
Offline
Bug Finder
Joined: 09/20/2007
Juice: 53
Re: Re: Workflow-ng detecting database change from outside

Lyle, thank you, the only issue with that is our IT department works in VB6 and SQL, I'm not sure if there is a SQL, or VB6 script that can invoke the workflow_ng_invoke_event() for Ubercart. They work from outside using an ODBC driver.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Workflow-ng detecting database change from outside

You can deal with this by writing a little server-side PHP to invoke the workflow-ng event. Your external application can run that PHP by sending an HTTP GET. Probably the best way to do this is to keep it within the Drupal framework by writing a trivial module which defines a MENU_CALLBACK.

<tr>.
nicksageek's picture
Offline
Bug Finder
Joined: 09/20/2007
Juice: 53
Re: Re: Re: Re: Workflow-ng detecting database change from outsi

Thanks TR, I'll get this testing and see if it solves my problem.