On Tue, 12 May 2009 15:08:03 +0200, Andreas Hartmann <[email protected]>
wrote:
> [[...]]
>
> My guess is that:
>
> * the second usecase invoker (let's call it B) initializes the session
> SB before the first usecase invoker is called
>
> * the changes which usecase invoker A makes to session SA are not
> visible in session SB
>
> * therefore the document in SB is still in authoring and the workflow
> transition can't fire
>
> Is this possible? Would you mind sending the complete code snippet? TIA!
This seems to me a very good possible explanation.
But with invoker I don't use a session explicitly (maybe the problem cause
?). I set-up a session for the creation of the document and commit this
session at the end of doc creation.
Here I send just send you the function that contain invoker. I can send the
full code of my lenyadoctransformer if needed (I hope to publish it one day
:)
This piece of code is the actual result of many different test (the all
copy-past with 2 is the last)... so be gracefull please :) but i'm really
open to all remark
Here we go :
private void applyWorkflowState()
throws ProcessingException, SAXException{
UsecaseInvoker invoker = null;
try {
invoker = (UsecaseInvoker)
this.manager.lookup(UsecaseInvoker.ROLE);
Map params = new HashMap();
//params.put(..., ...);
//invoker.invoke(getSourceUrl(), "publish", params);
//reportResult("","PROBLEM","USECASE
PROBLEM",lenyaDoc.getCanonicalDocumentURL(),lenyaDoc.getCanonicalWebappU\
RL(),"");
invoker.invoke(lenyaDoc.getCanonicalWebappURL(),
"workflow.submit", params);
//invoker.invoke(lenyaDoc.getCanonicalWebappURL(),
"workflow.publish", params);
if (invoker.getResult() != UsecaseInvoker.SUCCESS) {
/*A REMETTRE*/
List messages = invoker.getErrorMessages();
for (Iterator i = messages.iterator(); i.hasNext();) {
UsecaseMessage message = (UsecaseMessage) i.next();
//addErrorMessage(message.getMessage(),
message.getParameters());
reportResult("","PROBLEM","USECASE
PROBLEM",message.getMessage(),Arrays.toString(message.getParameters()),"");
}
}
}
catch( ServiceException se){
reportResult("","PROBLEM","ServiceException",se.getMessage(),"","");
}
catch (UsecaseException ue){
reportResult("","PROBLEM","UsecaseException",ue.getMessage(),"","");
}
finally {
if (invoker != null) {
this.manager.release(invoker);
}
}
UsecaseInvoker invoker2 = null;
try {
UsecaseInvoker invoker2 = null;
try {
invoker2 = (UsecaseInvoker)
this.manager.lookup(UsecaseInvoker.ROLE);
Map params2 = new HashMap();
//params.put(..., ...);
//invoker.invoke(getSourceUrl(), "publish", params);
//reportResult("","PROBLEM","USECASE
PROBLEM",lenyaDoc.getCanonicalDocumentURL(),lenyaDoc.getCanonicalWebappURL(),"");
//invoker.invoke(lenyaDoc.getCanonicalWebappURL(),
"workflow.submit", params);
invoker2.invoke(lenyaDoc.getCanonicalWebappURL(),
"workflow.publish", params2);
if (invoker2.getResult() != UsecaseInvoker.SUCCESS) {
//A REMETTRE
List messages2 = invoker2.getErrorMessages();
for (Iterator i2 = messages2.iterator(); i2.hasNext();)
{
UsecaseMessage message2 = (UsecaseMessage)
i2.next();
//addErrorMessage(message2.getMessage(),
message2.getParameters());
reportResult("","PROBLEM","USECASE
PROBLEM22",message2.getMessage(),Arrays.toString(message2.getParameters()),"");
}
}
}
catch( ServiceException se){
reportResult("","PROBLEM2","ServiceException",se.getMessage(),"","");
}
catch (UsecaseException ue){
reportResult("","PROBLEM2","UsecaseException",ue.getMessage(),"","");
}
finally {
if (invoker2 != null) {
this.manager.release(invoker2);
}
}
}
Thanks for your help
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]