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 » Urgent help required.......

Post new topic  Reply to topic
 Urgent help required....... « View previous topic :: View next topic » 
Author Message
elvis_gn
PostPosted: Tue Mar 08, 2005 5:13 am    Post subject: Urgent help required....... Reply with quote

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
View user's profile Send private message Send e-mail
jmac
PostPosted: Tue Mar 08, 2005 5:50 am    Post subject: Re: Urgent help required....... Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
elvis_gn
PostPosted: Tue Mar 08, 2005 10:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Mar 08, 2005 10:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
hos
PostPosted: Wed Mar 09, 2005 12:27 am    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Wed Mar 09, 2005 1:47 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jmac
PostPosted: Wed Mar 09, 2005 8:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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 » Urgent help required.......
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.