Author |
Message
|
elvis_gn |
Posted: Tue Mar 08, 2005 5:13 am Post subject: Urgent help required....... |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi
i'm trying to use one user profile for an activity in a process.
I am trying to login hundreds of users with the same userid and password.
the problem is that when one person logsoff,all the other users are being logged out too.......
Is there any way i can differentiate one session object from the other so that one guys logon and logoff is independent of the others.......
Plz help.....this is urgent.....thx. |
|
Back to top |
|
 |
jmac |
Posted: Tue Mar 08, 2005 5:50 am Post subject: Re: Urgent help required....... |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
elvis_gn wrote: |
Plz help.....this is urgent.....thx. |
Please reas some doc... this is a pretty basic question.
When you logon you should use a logon2 with SessionMode.DEFAULT. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Mar 08, 2005 10:34 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Agent agent = new Agent();
int locator = Agent.LOC_LOCATOR;
String agentName = "MQWFAGENT";
agent.setLocator(locator);
agent.setName(agentName);
service = agent.locate("", "");
service.logon2(
userid,
passwd,
SessionMode.DEFAULT,
AbsenceIndicator.LEAVE);
System.out.println("Logon successful");
This is my code.........this is still not working.....atleast can i know where to read on this from ????? |
|
Back to top |
|
 |
vennela |
Posted: Tue Mar 08, 2005 10:57 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Worked fine for me:
You should look at the workflow programming guide.
There is lot of information in that manual.
Click on the documentation on top of this page and goto workflow
This is the direct link
http://www-306.ibm.com/software/integration/mqfamily/library/manualsa/
I ran this program in 3 different command windows: I have induced a for loop so that the program sleeps for a while.
Code: |
/*
* MQWFLogin2.java
*
* Created on April 7, 2003, 11:52 AM
*/
/**
*
* @author vennela
* @version
*/
import com.ibm.workflow.api.Service;
import com.ibm.workflow.api.ExecutionService.*;
import com.ibm.workflow.api.*;
import com.ibm.workflow.api.ServicePackage.*;
import com.ibm.workflow.api.WorkItemPackage.*;
import com.ibm.workflow.api.ProgramTemplatePackage.*;
import com.ibm.workflow.api.ProcessInstancePackage.*;
import com.ibm.workflow.api.ItemPackage.*;
import com.ibm.workflow.api.ItemPackage.ExecutionState.*;
public class MQWFLogin2 extends Object {
/**
* @param args the command line arguments
*/
public static void main (String args[]) {
try{
System.out.println("Logging into workflow ......");
Agent agent = new Agent();
agent.setLocator(Agent.LOC_LOCATOR);
agent.setName("MQWFAGENT");
/*----------------------------------------------------------*/
/* Initialize the execution service */
/*----------------------------------------------------------*/
ExecutionService service = agent.locate("","");
String user = "ADMIN";
String password = "password";
SessionMode sessionMode = SessionMode.DEFAULT;
AbsenceIndicator absenceIndicator = AbsenceIndicator.LEAVE;
service.setTimeout(300000);
service.logon2(user, password, sessionMode, absenceIndicator);
System.out.println("Logon Successful");
for(int i=0; i < 1000000; i++){
System.out.println("");
}
service.logoff();
System.out.println("Logoff Successful");
System.exit(0);
}
catch (java.beans.PropertyVetoException e)
{
System.out.println("PropertyVetoException Error " );
System.out.println(" StackTrace:");
e.printStackTrace();
System.exit(1);
}
catch (FmcException e)
{
System.out.println("MQWF Error " + e.rc + " - " + e.messageText);
System.out.println(" StackTrace:");
e.printStackTrace();
System.exit(2);
}
catch (Exception e)
{
System.out.println(" StackTrace:");
e.printStackTrace();
System.exit(3);
}
}
}
|
|
|
Back to top |
|
 |
hos |
Posted: Wed Mar 09, 2005 12:27 am Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Hi,
are you calling all the logon2() calls on the same service object? The API just returns OK if you try to logon twice with the same UserID on the same service object. This is however a NOOP call, i.e. no additional session is established. The ExecutionService object externally represents a session. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 09, 2005 1:47 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
the code will work for me too....can u plz try to do a display of the entire work Item list after logon....do this by clicking logon for both the users at the same time.
the logon of the second user will cause logon of first user to fail...... |
|
Back to top |
|
 |
jmac |
Posted: Wed Mar 09, 2005 8:56 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
elvis_gn wrote: |
do this by clicking logon for both the users at the same time. |
What are you talking about here? What logon are you clicking? _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
|