com.netscape.pm.model
Class ProcessInstancePKFactory

java.lang.Object
  |
  +--com.netscape.pm.model.ProcessInstancePKFactory

public class ProcessInstancePKFactory
extends java.lang.Object

Creates a process instance key object, used for obtaining a handle to an IProcessInstance object. The method findProcessInstance off the IPMApplication interface is the only means of obtaining an IProcessInstance object using an IProcessInstancePK object.

public void doGet( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { res.setContentType( "text/html; charset=ISO-8859-4" ); javax.naming.Context cxt = new javax.naming.InitialContext(); String jndiName = "java:comp/env/" + IPMApplication.DEFAULT_JNDI_ROOT + "/" + localName; IPMApplicationHome home = (IPMApplicationHome) cxt.lookup( jndiName ); IPMApplication app = home.create(); long instanceId = Long.parseLong( req.getParameter( IUIParameters.INSTANCE_ID ) ); IProcessInstancePK pk = ProcessInstancePKFactory.create( instanceId ); pk.setEditable( true ); IProcessInstance pi = app.findProcessInstance( pk ); pi.setData( "name", req.getParameter( "name" ) ); pi.save(); pi.release( true ); res.getWriter().flush(); res.getWriter().close(); }

See Also:
IProcessInstancePK, IPMApplication

Constructor Summary
ProcessInstancePKFactory()
           
 
Method Summary
static IProcessInstancePK create(long instanceId)
          Creates an instance of a process instance key from an instance id.
static IProcessInstancePK create(long instanceId, java.lang.String appName)
          Creates an instance of a process instance key from an instance id and an application name.
static IProcessInstancePK create(long instanceId, java.lang.String clusterName, java.lang.String appName)
          Creates an instance of a process instance key from an instance id, cluster name and an application name.
protected static IProcessInstancePK create(java.lang.String swapURL)
          Creates an instance of a process instance key from a swap URL string.
protected static IProcessInstancePK create(java.lang.String swapURL, java.lang.String clusterName)
          Creates an instance of a process instance key from a swap URL string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessInstancePKFactory

public ProcessInstancePKFactory()
Method Detail

create

public static IProcessInstancePK create(long instanceId)
Creates an instance of a process instance key from an instance id.

Keys created via this method only differ from those created via the create( long, String ) method by the value of the application name member (this method will not set the application name). When accessing subprocess instances, the engine requires the name of the child application. Users will not require the use of the create( long, String ) factory method and should concentrate on this method instead.

Parameters:
instanceId - the instance id of the process instance
Returns:
an instance of a process instance key containing the given instance id.
Since:
PM 6.0
See Also:
create( long, String ), IProcessInstancePK

create

public static IProcessInstancePK create(long instanceId,
                                        java.lang.String appName)
Creates an instance of a process instance key from an instance id and an application name.

Keys created via this method only differ from those created via the create( long ) method by the value of the application name member. When accessing subprocess instances, the engine requires the name of the child application. Users will not require the use of this factory method and should use the create( long ) version of this method instead.

Parameters:
instanceId - the instance id of the process instance to create a key for
appName - the name of the application the instance belongs to
Returns:
an instance of a process instance key containing the given instance id.
Since:
PM 6.0
See Also:
create( long ), IProcessInstancePK

create

public static IProcessInstancePK create(long instanceId,
                                        java.lang.String clusterName,
                                        java.lang.String appName)
Creates an instance of a process instance key from an instance id, cluster name and an application name.

Keys created via this method only differ from those created via the create( long ) method by the value of the application name member. When accessing subprocess instances, the engine requires the name of the child application. Users will not require the use of this factory method and should use the create( long ) version of this method instead.

Parameters:
instanceId - the instance id of the process instance to create a key for
clusterName - Name of the cluster to which this application belongs to
appName - the name of the application the instance belongs to
Returns:
an instance of a process instance key containing the given instance id.
Since:
PM 6.0
See Also:
create( long ), IProcessInstancePK

create

protected static IProcessInstancePK create(java.lang.String swapURL)
                                    throws PMException
Creates an instance of a process instance key from a swap URL string. This method is used internally by the engine to create a child process instance key from a serialized string version. Users will not require the use of this factory method and should use the create( long ) version of this method instead.
Parameters:
swapURL - the value of the process instance key in an internal format
Returns:
an instance of a process instance key.
Throws:
PMException - if the value of swapURL does not match the expected format.
Since:
PM 6.0
See Also:
IProcessInstancePK

create

protected static IProcessInstancePK create(java.lang.String swapURL,
                                           java.lang.String clusterName)
                                    throws PMException
Creates an instance of a process instance key from a swap URL string. This method is used internally by the engine to create a child process instance key from a serialized string version. Users will not require the use of this factory method and should use the create( long ) version of this method instead.
Parameters:
swapURL - the value of the process instance key in an internal format
clusterName - name of the cluster
Returns:
an instance of a process instance key.
Throws:
PMException - if the value of swapURL does not match the expected format.
Since:
PM 6.0
See Also:
IProcessInstancePK