Hello,
X-Application uses the timestamp as meta-information for implementing the optimistic locking mechanism for XML documents. If you sent a query by an xapp:action tag with type=query, your XQuery expression will be wrapped by X-Application. The reason for the wrapping is to get meta-information as timestamp, ino-id, doctype, etc.
For you request to control when a document has to be refreshed. I would propose a plug-in. With the plug-in you could overwrite the standard method that is invoked by the ‘modify’ action. Before invoking the standard behavior (setting the document state to the ‘modify’ mode) you could check the timestamp with the current timestamp of the document.
How to get the timestamp?
(1) Your plug-in requires the ‘workspace’
(2) Your plug-in requires the current document
The code could look like this:
public static void myModify(BusinessDocumentWorksapce ws, BusinessDocument doc) {
TaminoStore store = (TaminoStore)ws.getStore();
String timestamp = store.getLastUpdateTime(document.getDomTree(), document.getNodeLocation());
if (!timestamp.equals(document.getNodeLocation().getTimestamp())) {
// your code
} else if (doc.getState() != BusinessDocument.MODIFIABLE) {
doc.modify();
}
}
Before starting with the plug-in you should read the chapter ‘Plug-ins’ of the X-Application documentation.
Bye,
Christian.
#Tamino#webMethods#API-Management