I'm working on a scheduled sequence that need to do the following tasks:
call GetNew data service getting possible new xml data
if xml exists
with the xml data, get the ID and save it into a property
call UpdateStatus data service with the parameters ID and PROCESSING
call the ProcessOrder service passing the xml data
if the return is success
call the external SetStatus service with SUCCESS
otherwise
call the external SetStatus service with ERROR
call UpdateStatus data service again with the parameters ID and PROCESSING
otherwise
do nothing
For do that, I've build the following sequence:
payload -- to build a GetNew request
callout -- to call the GetNew data service
property -- to save the ID from the possible new message
filter -- verify if the ID property exists
then
clone
payload -- to build a UpdateStatus PROCESSING request
callout -- call the UpdateStatus
xslt -- transform the XML from GetNew to the ProcessOrder
in
send -- to the ProcessOrder endpoint
out
property -- save the status of the ProcessOrder response
payload -- to build the SetStatus request
callout -- call the external SetStatus service with the status
payload -- to build a UpdateStatus PROCESSED request
callout -- call the UpdateStatus
else
drop
I would like to know if this is a good practice, or if I should split it into many sequences, or replace the callouts by send, and how is the best way to deal with SoapFaults using this approach.
Thanks in advance.