Logging messages into monitor database

Hi,

Can anyone know which service to use to log custom messages into monitor database. I tried using logActivityMessages in wMPRT package but it is giving an error “Could not invoke getParentServiceName”

I want to use it for the purpose of transaction tracking. For example:

Transaction PO Started
Data extracted
Published
Subcribed
FF Generated and sent
Completed

Thanks in advance,
Srivats

Is there a reason that you don’t want to log to TN?

The TN log is also visible from wmMonitor.

Mark,

Currently we are not persisting any data in TN as it is more of a EAI project. So we are not using TN Log.

Thanks & Regards,
Srivats

<opinion>
There are a lot of benefits to using TN in an EAI projects.

Consider:

When a document enters the EAI environment, it can be useful to have persisted it before performing transformations. If an integration logic problem happens, you have a copy of the original document as received by the sending application that you can resubmit.

The logging facilities of TN are very nice. It’s easy to examine the content that was sent to you, and view changes as status along your processing path.

Rather than “invent” a new method for logging, persisting, and re-submission, why not take advantage of what comes out-of-the-box?

</opinion>

Your client apps do not need to call tn:receive. They can call a gateway service exposed as Web Service, FTP handler, or whatever. The gateway service would do whatever authentication is appropriate, and the n call routeXML ( or routeFlatFile if you are receiving flat file data ).

The service invoked by your TN processing rule can publish to the Broker as its last step.

I’ll defer to others if you still really want to use PRT for logging.

Regards

Hi Mark,

Thank you. But right now we are calling a BOI method on Baan that provides us the data in the form of IData Values object. We map that data to canonical after necessary transformations and send that data into SQL Server using JDBC adapter. So how can I use TN here. Please help me with the PRT for Logging.

Thanks & Regards,
Srivats

Srivats,

You can use TN by persisting the data as soon as it is received from Baan.

I’m not familiar with using PRT as a logging facility. Maybe someone else can help.

Regards

Mark,

If for the same scenario, how can I use TN Logging? Can you be specific with respect to flow steps and setups.

Thanks in advance,
Srivats

Srivats,

It sounded like you had a service that was calling out to a Baan BOI to get the initial data. Is that correct? Does that service run on a schedule? This is the “start of processing”, correct?

You said the data comes back from the BOI in the form of an IData object. In other words, an IS document type: When you trace this service you can see the returned IData object as an IS document in the results pane, right?

If you can make sure that I understand this correctly, I think I can provide the steps for you.

Mark,

Yes you are right. I am using the same way. I schedule a service that calls the BOI of Baan which returns me the data in the form of IS Document type.

Can you provide me the steps?

Thanks in advance,
Srivats

Srivats,

The steps could be as follows:

If the document you are getting from Baan does NOT have a field that can be reliably used to identify the document type:

  1. Create a document type that is the same as what you are getting from Baan, except add a field at the top level to contain the document type.

Immediately after retrieving the document from Baan:
If you needed to do step 1, map the document to the new “identifiable” document type. Be sure to sete the identifier field to the unique id of this Baan document.
2. invoke pub.xml:documentToXMLString
Map your document to the document service input.

  1. invoke pub.xml:xmlStringToXMLNode
    Map the previous xmldata output to the xmldata service input.

  2. invoke wm.tn.doc.xml:routeXml
    Map the previous node output to the node service input.

Can I assume you are familiar with setting up TN to recognize the document and invoke another service with a processing rule?
Make sure that the TN document type you create has an identifying query on the Identity tab to extract the field containing the document identifier value.
For an EAI situation, you can configure your processing rule to select on the document type and leave sender and receiver as any. You can make this more selective by populating values in the sender-id if needed.

The service that the processing rule invokes will continue with the processing steps you described previously.
Except now:

  1. invoke wn.tn.doc:changeStatus
    Map the bizdoc given to your service to the bizdoc service input
    Set newUserStatus to something like “Transaction PO Started”.

  2. invoke wm.tn.log
    Map the previous bizdoc to the relatedDocId service input
    Set entryType to Message
    Set briefMessage and fullMessage to something like “Transaction PO Started”.

Repeate steps 5 and 6 as you want to make log entries.

If an error occurs, make sure to set the entryType to ERROR on your changeStatus invoke.

  1. View the log by using the Trading Networks link under the Documents menu of the webMethods Monitor home page.
    Enter the host and port
    You can set selection criteria on the next page or just hit search.
    Click on the link to the left of the document you are interested in.

On the next page, click on View Document Activity log.
You can also click on the content part name link to view the contents of the document you submitted.

  1. As an alternative, you can also view this TN log information through the Transacion Analysis area of the Trading Networks console.

Hi Mark,

Thank you very much. I have started working on these steps. I did a small test and it was working fantastic.

Thanks a lot!!

Thanks & Regards,
Srivats

Glad to hear it.
It’s always nice to take advantage of something that comes included
with webMethods instead of building it yourself.

Regards

I may be jumping in after the fact here, but we have had no issues at all using the prt “logActivityMessages” service. In fact we use it quite frequently since we use process models to control nearly all of our integrations. In the flows that are called from a process model, logActivityMessages works great, as does logging the initiating document and logging any other custom field data you desire from the model. Like all logging, you need to be judicious with how much you log.

If you have not implemented a process model, I can understand why this service was giving you errors.

Glad you have a solution that is working for you.

Hi Tim,

Can you provide us the steps about the use of models and their logging . I just want to know and I feel even someone else in need can take a look.

Thanks & Regards,
Srivats