Make a method call after order submitted #427
Replies: 9 comments
-
Hi @VladimirBV, |
Beta Was this translation helpful? Give feedback.
-
yes, not a file but a string with xml, so maybe to send to mule api web service |
Beta Was this translation helpful? Give feedback.
-
Hi, if file creation is not required and if you are on SFRA then you could
create the logic of calling the api and plugin it in as a middleware on the
onComplete event.
Also, please do not call the muel api synchronously as it will impact
storefront performance rather call asynchronously using a promise(or
timeout).
…On Fri, Jul 5, 2019, 5:02 PM VladimirBV ***@***.***> wrote:
yes, not a file but a string with xml, so maybe to send to mule api web
service
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/orgs/SalesforceCommerceCloud/teams/community/discussions/77/comments/2?email_source=notifications&email_token=AKECNZPJKA6X4I3667QLBY3P54R2TA5CNFSM4H6KERVKYY3PNVWWK3TUL52HS4DFWNCGS43DOVZXG2LPNZIG643UKJSXA3DZVJRW63LNMVXHIX3JMTHAAAQDJA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKECNZN2O3CJAF7IWQCKSADP54R2TANCNFSM4H6KERVA>
.
|
Beta Was this translation helpful? Give feedback.
-
I would not call this type of a backend integration from client-side. Promises are not supported server-side. Everything you do on server-side controller, even if it is event-based is run in synchronous manner. |
Beta Was this translation helpful? Give feedback.
-
Why didn't anyone suggest the commerce cloud default approach? Have a job run every minute or so which writes order files to disk and puts its on the ftp? |
Beta Was this translation helpful? Give feedback.
-
Hello Zlatin,
Promises are supported server side, it is being used in b2c connectors,
that's how i now it works; let me know if that's not the case.
Holger, not always FTP offline approach works in requirements where real
time synchup is required, what he is explicitly looking for is and
mentioned is real time integration.
Vladimir, now you have all the options, see which one works for you
…On Sat, Jul 6, 2019, 3:04 AM Holger Nestmann ***@***.***> wrote:
Why didn't anyone suggest the commerce cloud default approach? Have a job
run every minute or so which writes order files to disk and puts its on the
ftp?
See this for a couple of examples:
https://github.com/SalesforceCommerceCloud/job-components
This allows scalable order intake and steady delivery to the OMS/Warehouse
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/orgs/SalesforceCommerceCloud/teams/community/discussions/77/comments/5?email_source=notifications&email_token=AKECNZJCWZKNCLZ3JBY2TW3P56SL3A5CNFSM4H6KERVKYY3PNVWWK3TUL52HS4DFWNCGS43DOVZXG2LPNZIG643UKJSXA3DZVJRW63LNMVXHIX3JMTHAAAQDPU>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKECNZPA2XFZGXZCTURTESTP56SL3ANCNFSM4H6KERVA>
.
|
Beta Was this translation helpful? Give feedback.
-
Promises are emulated server-side using https://github.com/SalesforceCommerceCloud/marketing-cloud-connector/blob/205f76731bb78c4589791648e07877715a57486e/cartridges/synchronous-promise.js in MC connector, but there is no native platform support for them. They are also run in a synchronous manner, as is everything that is run server-side. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@VladimirBV typical design-pattern is to do synchronous integration (using API) after order submitted (paid) and have a fallback job, that re-processes orders that has failed this synchronous integration. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I need to write a prototype with my own cartridge, I need to call a method dw.order.Order.getOrderExportXML(..) after order submitted(payed) and send a file to FTP. How can I do this?
Beta Was this translation helpful? Give feedback.
All reactions