Thursday, 13 November 2014

Get PE Session (Process Engine JAVA API)

Process Engine API

//Get Session

  public static VWSession getPESession()
    {
      String strAppURI1="http://localhost:9080/wsi/FNCEWS40MTOM/";
      System.out.println("[ENTER  PEManager getPESession()]");
      VWSession peSession = null;

      System.setProperty("java.security.auth.login.config","C:\\opt\\jaas.conf.WSI");
    

      try
      {
        peSession = new VWSession();
        peSession.setBootstrapCEURI(strAppURI1);
    
        peSession.logon(username, password, connectionPoint);
        String sn = peSession.getPEServerName();
        System.out.println("++++++++++++++++"+ sn);

        System.out.println("PE session established:"+peSession);
      }
      catch (VWException e) {
          System.out.println("Exception occured while establishing PE session." );
          e.printStackTrace();

      }
      System.out.println("[Exit PEManager getPESession()]");
    return peSession;
  }

//Close VWSession

public static void closePESession(VWSession peSession)
  {
    log.debug("[Enter closePESession]");
    try {
      if (peSession != null)
        peSession.logoff();
    }
    catch (VWException e) {
      log.error(e.getMessage(), e);
    }

    log.debug("[Exit : closePESession]");
  } 


1 comment:

  1. Hi , how to login to peSession here without user id password , seeing option to logon with token but not sure how to generate the token.
    How to use these menthods

    vwSession.logonWithToken(theToken, connPoint);
    vwSession.logon(url);
    please here. thanks

    ReplyDelete