Author |
Message
|
workflowdude |
Posted: Tue Jan 27, 2004 7:51 am Post subject: Reg Workflow API Client |
|
|
Novice
Joined: 17 Nov 2003 Posts: 24 Location: US
|
Hi all,
We have developed our own JavaBean for communicating with workflow. i.e javabean that uses WorkFlow API's to communicate with workflow. The Application that callls this bean is a web based application. Wondering how do you manage workflow sessions in such a scenario. Do you log the user in workflow when he logs in into the web application and store the ExecutionService Object in a haspmap with the userid as the key(in the javabean). If yes, how do we identify the user with each subsequent requests. So on the next request to a workflow API for e.g queryWorkItems(..) there is no way of identifying which user has requested this hence no way of retrieving the ExecutionService Objetc.
The Idea is to not have the Web application store this Object in Session. The web application should be loosely coupled with any workflow implementation.
Is SessionBean a solution to this?
Please reply ASAP
WFDude |
|
Back to top |
|
 |
jmac |
Posted: Tue Jan 27, 2004 9:02 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I really do not have much experience with web applications (other than the MQWF thin client) so I don't know anything about Session Beans.
But isn't what you are talking about covered by the "Stateless" api calls in MQWF? _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
workflowdude |
Posted: Wed Jan 28, 2004 7:46 am Post subject: |
|
|
Novice
Joined: 17 Nov 2003 Posts: 24 Location: US
|
Frankly speaking, I read that chapter in the Programming guide and I wasnt pretty clear about the concept.
My first problem
1. If I do a query on a ExecutionService Object, then do I create this ExecutionService object everytime when the user requests something from the workflow server? If yes, Does the user have to pass the userid, password OR the sessionID everytime with each call? This will look like a bad design to pass the Session ID or credintials as a parameter in each method call to my Workflow JavaBean.
2. After the query is executed on the workflow server and I get an array of lets say WorkItems, do I persist this on the client side? I would not prefer to do this as i dont want to load everything in the HttpSession.
If i do not store and query everytime, what does the Execution.persistentObject do? Since I dont have the list, I will not be getting the OID...
can you please explain this?
Thanks for your help
WFDude |
|
Back to top |
|
 |
vennela |
Posted: Wed Jan 28, 2004 8:13 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
If I do a query on a ExecutionService Object, then do I create this ExecutionService object everytime when the user requests something from the workflow server? |
No
1. Create the ExecutionService object once.
2. Logon (using the workflow user credentials)
3. (a) query work items
3. (b) check out work item
3. (c) check in WI
3. (d) query process instances
3. (e) .... make whatever workflow calls you want
4. Logoff from execution service.
Quote: |
2. After the query is executed on the workflow server and I get an array of lets say WorkItems, do I persist this on the client side? |
I am not sure what you are doing here. But if you query work items, you will get an array of work items. What you do with each of the work item in your client is upto you (like check in/ check out/ finish/force finish etc).
Quote: |
Execution.persistentObject |
Can you be clear on this |
|
Back to top |
|
 |
workflowdude |
Posted: Wed Jan 28, 2004 8:28 am Post subject: |
|
|
Novice
Joined: 17 Nov 2003 Posts: 24 Location: US
|
Hi,
Thanks for your reply.
you said.
1. Create the ExecutionService object once.
2. Logon (using the workflow user credentials)
3.... execute Queries
...
..
4. Log Off
My Workflow component is a JavaBean and not a java application which has a start and a end. This JavaBean exposes various methods to the client like LogOn, LogOff, queryWorkItems, etc... The calling client is not aware of any Workflow objects that are created by this JavaBean. So my question was.. since these requests from the client are stateless, how do i relate the client to the ExecutionService Object previously crerated. Do I have the client pass a token with each method, so that the javabean can look up the ExecutionService Object previously created.? But passing a token everytime within each method call looks like a BAd Design....
Hope I am clear..
My Second Problem is probably resolved once i get the ExecutionService Object associated with the client.
One probable solution was to make the WorkFlow component a Session Bean, so that I can store the ExecutionService Object.. but I am not sure whether its the right direction. |
|
Back to top |
|
 |
jmac |
Posted: Wed Jan 28, 2004 8:39 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Like I said before, I really don't know a lot about WebApplications, but it certainly sounds to me like you could be using the sessionID() and setSessionContext() methods of the ExecutionService to accomplish what you want. I think you would need to persist only the ExecutionService::sessionID to accomplish this. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
workflowdude |
Posted: Wed Jan 28, 2004 8:46 am Post subject: |
|
|
Novice
Joined: 17 Nov 2003 Posts: 24 Location: US
|
I can use the setSessionContext() method.. but the client has to still pass some token which helps the Workflow Component can lookup the sessionID associated with the user.
Since its a web application, all the requests are stateless....
Hope I am clear |
|
Back to top |
|
 |
dsim |
Posted: Thu Jan 29, 2004 8:07 pm Post subject: |
|
|
Acolyte
Joined: 11 Aug 2003 Posts: 67 Location: Toronto
|
Yes, the userID and sessionID (needed to restore the ExecutionService object for the logged on user) can be saved in a session bean.
In the initial http request these two strings can be obtained after logon from the ExecutionService object.
In the following requests an empty (not logged on) ExecutionService object still needs to be instantiated using the Agent. Then calling setSessionContext(userID,sessionID) will restore the execution service.
Dan |
|
Back to top |
|
 |
|