Hello,
Here come some code snippings that I hope will help you.
1) For configuration purposes you might use (static) class variables, which can be configured by query functions like this:
code:
public class MySXS extends ASXJBase {
// TODO: Enter class variables here. static int count;
public mySXS () {
// TODO: enter SXS initialization here.
count = 1;
}
…
public String resetCount (int value)
{
// reset counter
count = value;
return (“count reset to " + value);
}
}
Depending on your needs (settings valid for one/all users/sessions/…) your solution might be more sophisticated.
2) What I meant was that you might use a doctype serving as list of object_id/element_id, e.g. in collection MyList, doctype entry you have entries like
<object_id>2456</object_id>
<element_id>14</element_id>
You then might use code like
code:
public void mapin (int object_id, int element_id, String document, StringBuffer nodeinfo)
{
// TODO: Add your SXF implementation here:
…
// check if update (entry exists) or insert (entry doesn’t exist)
StringBuffer Response = new StringBuffer();
SxsXMLXql (“MyList”,“entry[object_id=” + object_id.toString() + " and " + element_id=” + element_id.toString() + “]”, Response);
… // check return value
// process information to collection MyList:
StringBuffer Response = new StringBuffer();
SxsXMLProcess (“MyList”,“<object_id>” + object_id + “</object_id><element_id>” + element_id +
“</element_id>”, Response);
…
}
public void onDelete (int object_id, int element_id, String nodeinfo)
{
// TODO: Add your SXF implementation here:
…
// delete also information from element list
SxsXMLDelete (“MyList”,“entry[object_id=” + object_id.toString() + " and " + element_id=" + element_id.toString() + “]”, Response);
If you find the object_id/element_id in the list, you know it is an update.
Regards,
Julius Geppert
#Tamino#webMethods#API-Management