Problem
Recently we had some problems with the outbound AS2 connection to one of our clients. I decided to check and analyze this situation and needed to gather information about all AS2 sessions between our servers. Our AS2 BP does 3 attempts to connect and if all of them failed, it sends an email to the support team.
Solution
I decided to use the GIS’s DB as the source for my report. I used the following tables:
- WF_INST_S – info about BP instances
- WORKFLOW_CONTEXT – detailed information about all the BP steps
- WFD – info about BP’s name/version
- WFD_VERSIONS – info about default version of BP
- CORRELATION_SET – related information about used envelopes, AS2 connection settings and so on (depends on the BP)
First of all, I needed to find all the instances of AS2 sessions during some period of time. To do it, I needed to know the ID and version of BP, so I ran the following SQL query (I’ve replaced real BP/URL and other values with dummy ones):
SELECT * FROM WFD w, WFD_VERSIONS wv WHERE w.NAME = 'BP_Send_AS2' AND w.WFD_ID = wv.WFD_ID AND w.WFD_VERSION = wv.DEFAULT_VERSION
This query returned WF_ID = 111 and version = 3.
Next, I ran SQL query to get all the AS2 sessions for one day
select wis.workflow_id as WFID, TO_CHAR(wis.start_time, 'HH24:MI:SS') as WFTIME, count(wc.workflow_id) from WF_INST_S wis left outer join WORKFLOW_CONTEXT wc on wis.workflow_id = wc.workflow_id and wc.BASIC_STATUS = 1 WHERE wis.start_time > TO_DATE('2013-08-08 00:00:01', 'yyyy-mm-dd HH24:MI:SS') and wis.start_time < TO_DATE('2013-08-08 23:59:59', 'yyyy-mm-dd HH24:MI:SS') and wis.WFD_ID = 111 and wis.WFD_VERSION = 3 -- AS2 group by wis.workflow_id, wis.start_time order by wis.start_time
And finally I changed it a little to filter particular customer out (its URL was http://customername.com/as2):
select wis.workflow_id as WFID, TO_CHAR(wis.start_time, 'HH24:MI:SS') as WFTIME, count(wc.workflow_id) from WF_INST_S wis left outer join WORKFLOW_CONTEXT wc on wis.workflow_id = wc.workflow_id and wc.BASIC_STATUS = 1 WHERE wis.start_time > TO_DATE('2013-08-08 00:00:01', 'yyyy-mm-dd HH24:MI:SS') and wis.start_time < TO_DATE('2013-08-08 23:59:59', 'yyyy-mm-dd HH24:MI:SS') and wis.WFD_ID = 111 and wis.WFD_VERSION = 3 -- AS2 and wis.workflow_id in (select WF_ID from correlation_set where NAME = 'URL' and VALUE = 'http://customername.com/as2' ) group by wis.workflow_id, wis.start_time order by wis.start_time
I put all of this information into a MS Excel sheet, added a couple of graphs and got the clear picture of AS2 problems for that day:
Thanks for your post. It is very useful for SI/GIS system maintainance
Thanks 🙂 Just trying to share my knowledge…
Thank you. Very useful information. I use a plain query to get MDN details on demand but you inspired me, I’ll enhance my existing query to do cool stuff. Thanks again!
Thanks 🙂
Kim, Do you have a way to get transaction status (like wfid, document and final status) irrespective of received or send protocol? I am constructing a query to fetch the data from SI DB based on Received/Send File Name or Date, or Direction or Date Time Stamp. Any ideas are much appreciated. thanks.
Unfortunately, I don’t have access to SI/GIS right now. But if you see these parameters anywhere, they must be in the DB somehow
I would like to extract the report data from the tables, but I don’t know which tables to look in. All I can find is the InstanceID on the report. I can use the WORKFLOW_LINKAGE table to cross reference the InstanceID to get the ProcessID, but that still doesn’t show me any of the report data. Any ideas?
unfortunately I don’t have access to GIS/SI now and cannot help. When I was working with SI, I used documentation + was making “educated guesses” to find information.