ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » com.ibm.workflow.servlet.client.ClientException

Post new topic  Reply to topic
 com.ibm.workflow.servlet.client.ClientException « View previous topic :: View next topic » 
Author Message
sapagesa
PostPosted: Wed Jun 25, 2003 2:32 pm    Post subject: com.ibm.workflow.servlet.client.ClientException Reply with quote

Newbie

Joined: 25 Jun 2003
Posts: 3

Hi All,
I am a naive Workflow software developer. I hope someone can help me with my question. I wrote a command handler class extending GenericCommandHandler class.

In my code I call BuiltInhandler's render method and this method is throwing exception.

Sample Code :
try
{
1)RequestContext context = (RequestContext) request.getSession().getAttribute("context");
2)BuiltinHandler builtin = context.getBuiltinHandler();
3)builtin.checkInWorkItem(request,response);
4)ResponsePage responsePage = builtin.render("checkInWorkItem", context);
}catch(Exception e)
{
System.out.println("Exception "+e);
System.out.println("Exception Message "+e.getMessage());

}


Fourth line builtin.render is throwing com.ibm.workflow.servlet.client.ClientException exception.

And
e.getMessage() method is returning null. Since the getMessage method is returning null I am not able to understand what the problem is.

Can one of you please help me out with this problem.

Thank you very much for your time and help in advance.
Back to top
View user's profile Send private message
jmac
PostPosted: Wed Jun 25, 2003 3:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I am somewhat confused with your coding I assume that you must want to checkin a workitem and you have a user command called x-checkInWorkItem as shown. Why would you render a checkin? It seems to me that you want to checkin the workitem, then maybe use the builtinhandler to display the worklist something like this.


Code:
  public ResponsePage checkInWorkItem( HttpServletRequest request,
                                      HttpServletResponse response)
                   throws ClientException
  {

    RequestContext req = new RequestContext(request);
    /*  access your parameters then checkin your workitem
         if you use the checkInWorkItem method of the builtin handler
         what is the purpose of your command?  */


      BuiltinHandler builtin = req.getBuiltinHandler();
      builtin.queryWorkItems(req, req.getWorkListOid(), false);

      return builtin.render("queryWorkItems",req);
  }

_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sapagesa
PostPosted: Thu Jun 26, 2003 7:14 am    Post subject: Reply with quote

Newbie

Joined: 25 Jun 2003
Posts: 3

Hi John,
Thank you for your response. I am sorry for not explaing my question clearly. I use JSPs for the front end manual program activities. I am not using the user command x-checkInWorkItem, because I have to update some database fields before submiting/CheckingIn a JSP workItem. And you are right I want to update the database fields and checkIn workItem and then display the worklist.

On JSP side my code is somewhat like this:[code]
<jsp:useBean id="context" scope="request" type="com.ibm.workflow.servlet.client.RequestContext" />
<%
ReadOnlyContainer inData=context.getContainer();
WorkItem workItem=context.getWorkItem();
request.setAttribute("context", context);
request.getSession(true).setAttribute("context", context);
%>

<INPUT type="button" name="checkinWorkitem" value="Approve" onclick="approve()">

<script language="javascript">
<!--
function approve()
{
// Called by: Approve - button
document.forms[0].action = "<%=context.getCommand("x-approveRequest", workItem.persistentOid())%>";
document.forms[0].submit();
}

-->
</SCRIPT>


On the server side in the customized RMCommandHandler class

[
public class RMCommandHandler extends GenericCommandHandler{
public ResponsePage approveRequest(HttpServletRequest request, HttpServletResponse response)
{
try
{
1)RequestContext context = (RequestContext) request.getSession().getAttribute("context");
2)BuiltinHandler builtin = context.getBuiltinHandler();

//Update the database and other application specific code

3)builtin.checkInWorkItem(request,response);
4)ResponsePage responsePage = builtin.render("checkInWorkItem", context);
}catch(Exception e)
{
System.out.println("Exception "+e);
System.out.println("Exception Message "+e.getMessage());

}
return responsePage;
}


}
]

Now my question is builtIn.render is throwing com.ibm.workflow.servlet.client.ClientException exception and exception.getMessage() is returning null. So I am not able to understand what could be the problem. Can one of you tell what are the different situations which causes this exception. with null value in the e.getMessage().

Thank you
Back to top
View user's profile Send private message
jmac
PostPosted: Thu Jun 26, 2003 7:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I would do the checkin using my own code, so I am not certain what you are trying will work. It is my opinion that you do not want to do the render for the checkin command, as you have already run the checkin command once. I would use:

Code:
return builtin.render("queryWorkItems",req);


good luck
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sapagesa
PostPosted: Thu Jun 26, 2003 9:09 am    Post subject: Reply with quote

Newbie

Joined: 25 Jun 2003
Posts: 3

SOLVED


Hi John,
Thank you for the prompt responses. After doing certain amount of testing and trying to reproduce the problem users are getting. I found that users are clicking the submit button twice on JSPs. And this is causing the exception.

So the resolution is I should prevent the users from double clicking the submit button..

Thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » com.ibm.workflow.servlet.client.ClientException
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.