I need to write a service that will check to see if TN successfully delivered the message I sent to it.
Should I write the service and use it in the “Execute a service” action under the processing rule along with the “Deliver Document by:” action, or should I write it and invoke it in a flow service after I send the doc to TN?
what are the WmTN service I can invoke to query the status of the particular transaction’s activity tasks…?
Once you send the doc to TN for delivery crate a wrapper flowservice and make use of the wm.tn.task services like getTasks,getTaskStatus etc…for status of the delivery task which will be viewed in the Task tab of TNConsole which gives us the information Done or Failed or Pending.
can you elaborate on what you mean by a wrapper flowservice?
the task services (getTask, getTaskStatus, etc) all seem to require an input of taskID…where can I get the tasks of the doc I just sent to TN? the getTasks service doesn’t seem to have any inputs at all!
can you describe the steps the wrapper flowservice would have?
What i mean is in your flow once you send the document to TN for Delivery then use getTasks(no inputs required)this gives the all the internal identifiers (taskID’s)and so the appropriate taskID and map it to the getTaskStatus.
Please also check the TNBISReference guide for more information,if it is unclear.
I added the tm.tn.task:getTasks after my wm.tn.submit, but it gets ALL tasks? 536 tasks. how can I get just the delivery task of the document I just sent in? I guess I could ASSUME that the last task in the list of tasks is the delivery task, get its status and make sure it is successful, but that doesn’t seem elegant…
shouldn’t there be some way I can get the tasks associated with a certain bizdoc, ie. the one I just sent in?
invoke wm.tn.submit to put the bizdoc into TN (you’ll have to get your document to a bizdoc by using wm.tn.doc.xml:recordToBizdoc or some other method that create the bizdoc).
if the processing rule for the document uses “Deliver document by,” then there will be a a variable called ‘deliveryId’ placed onto the pipeline when the wm.tn:submit service is invoked.
you can then pass that deliveryId to wm.tn.delivery:getDeliveryStatus service.
I did this in a repeating sequence, and I branch on the ‘deliveryStatus’ variable that getDeliveryStatus returns to determine what action to take…
‘DONE’ : signal success and exit the repeat
‘FAILED’ : signal failure, send an email, run a database query, then exit the repeat
$default : do nothing - don’t exit the repeat, so it will continue to getDeliveryStatus until it either gets DONE or FAILED.
Genius! I saw the use of the var deliveryId but in this case it makes it much easier.
Btw, in my case I am using the EDIINT package to send the file using AS2 protocol and i had to add the scope ‘rec_in’ to prefix the var deliveryId in order to get the Task status, as follows:
%rec_in/deliveryId%
This is because the EDIINT services create the deliveryId within a specific context and they create the output vars within the scope ‘rec_in’. It works just fine.