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 » [Solved]How to Create New Handler

Post new topic  Reply to topic
 [Solved]How to Create New Handler « View previous topic :: View next topic » 
Author Message
atse
PostPosted: Tue Feb 01, 2005 6:57 am    Post subject: [Solved]How to Create New Handler Reply with quote

Novice

Joined: 01 Feb 2005
Posts: 14

Hi, I'm a new user for both Workflow and WebClient. I want to create a custom handler that uses a session bean that updates the db when I check in a work item. I tried to follow the wa84 extentions and the samples given in WebClient when creating my new handler class but there still things I don't understand and I'm sure I'm missing some implementation.

My new handler class extends GenericCommandHandler, and contains the methods init and updateDb, where updateDb is the method that handles what the command should do. The method returns ResponsePage and takes in HttpServletRequest and HttpServletResponse as parameters. Since in this method, after handling the session bean update, I want the command to checkin the work item, I added in these lines which I got from the examples and assume that will handle the checkin:

SessionContext sc;
RequestContext retval = null;
BuiltinHandler bh;
try {
sc = getSessionContext(request);
bh = sc.getBuiltinHandler();
retval = bh.checkInWorkItem(request, response);
return bh.render("checkInWorkItem", retval);
}

I then changed the WebClient.propertities file so that it uses the CommandHandlerAdapter (since I'm using wa84 as well), and set my new Handler to the next consective number:

com.ibm.workflow.servlet.clientx.wext.ReuseProcessDataHandler = 0
com.ibm.workflow.servlet.clientx.wext.RestartAsDraftHandler = 1
com.ibm.workflow.servlet.clientx.wext.ChangePageHandler = 2
com.ibm.workflow.servlet.clientx.wext.PageEventHandler = 3
com.ibm.workflow.servlet.sample.MyNewUpdateHandler = 4

This is the part I don't know if I'm doing correctly: in my Jsp, for my submit button, instead of the name "checkinWorkitem" I changed it to my command name: updateDb. When I run it and click the button, I receiver the error: Invalid command sent: updateDb.

Since the examples of the handlers given have such poor documentations, I'm really having trouble understanding how to implement a custom handler properly. I used lot of the codes where I just put in hoping it does what I think it should do. So please let me know what I'm doing wrong or if I should even be building a custom handler for what I'm trying to do. If there are better references where I could figure it out myself, please also let me know. Thank you in advance for anyone's help!


Last edited by atse on Thu Feb 03, 2005 7:55 am; edited 1 time in total
Back to top
View user's profile Send private message
jmac
PostPosted: Tue Feb 01, 2005 7:03 am    Post subject: Reply with quote

Jedi Knight

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

Make sure you have servlett logging on, then restart WAS and look to see if your command handler is being loaded. There is a message that comes out shortly after startup that indicates the command handlers being loaded as I recall.

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
atse
PostPosted: Thu Feb 03, 2005 7:53 am    Post subject: It worked now Reply with quote

Novice

Joined: 01 Feb 2005
Posts: 14

I don't see it being initialized anywhere, but I guess my setup must be correct as my handler are actually being called now. Thanks for your help!
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 » [Solved]How to Create New Handler
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.