I have a java-agent from which I can call another agent with the parameter passed through it which contains NoteId, and using that NoteId, I am successfully able to get the work done the that document.Till here every thing is clear.
The main question regarding this is , Is it possible to run the agent of another database on same server from the current database agent?
To be more clear for an example I have two databases, "ABC.nsf" and "XYZ.nsf", JavaAgent "A" is in "ABC.nsf" and JavaAgent "B" is in "XYZ.nsf". In my xpage I have a button running Agent "A", and even Agent "A" can run any other javaAgent from the same database.
Code:
Document mainDoc = db.getDocumentByUNID(tempDoc.getItemValueString("mainDocId"));
String noteID = mainDoc.getNoteID();
String agentName = "NotificationManager";
Agent agent = db.getAgent(agentName);
if (agent != null)
agent.runOnServer(noteID);
else
System.err.println("Something is wrong");
But Actually I want run the JavaAgent "B" Located in "XYZ.nsf" from JavaAgent "A" which is in "ABC.nsf".
After some research I have referd this code. Code
Database db=session.getDatabase(current_server, "path/to/XYZ.nsf");
Agent myAgent=db.getAgent("B");
myAgent.run();
And yes I am unsuccessfull there, Need some idea to acheive this.Any suggession will be really appretiated.
db=session.getDatabase(current_server, path/to/XYZ.nsf);or did you use quotes like this :db=session.getDatabase(current_server, "path/to/XYZ.nsf");? And: does the variablecurrent_servercontain the right servername? And: Is this a linux- server or a windows server (slash or backslah)? is the path relative to data directory? - Torsten Link