com.ibm.b2bi.bfm.ejb
Class WWFServicesBean

java.lang.Object
  |
  +--com.ibm.b2bi.bfm.ejb.WWFServicesBean

public class WWFServicesBean
extends java.lang.Object
implements javax.ejb.SessionBean

WWFServices is a stateless session bean that provides wrapper on websphere workflow ejbs. This bean supports transactions. This class contains implementation code.

See Also:
Serialized Form

Constructor Summary
WWFServicesBean()
           
 
Method Summary
 void claim(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method claims an activity.
 void claim(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method claims the given activity.
 java.util.Hashtable claimPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method claims an activity.
 java.util.Hashtable claimPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method claims the given activity.
 void complete(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method completes an activity.
 void complete(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method completes the given activity.
 java.util.Hashtable completePBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method completes an activity.
 java.util.Hashtable completePBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method completes the given activity.
 java.lang.String create(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable procVars)
          This method creates an instance of a given process template.
 java.util.Hashtable createCollabProcessPBS(java.lang.String procDef, java.lang.String instanceName)
          This method is called by collab process.
 java.util.Hashtable createPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable procVars)
          This method creates an instance of a given process template.
 void ejbActivate()
          ejbActivate method comment
 void ejbCreate()
          ejbCreate method comment
 void ejbPassivate()
          ejbPassivate method comment
 void ejbRemove()
          ejbRemove method comment
 java.util.Hashtable forceFinishPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method is called by collab process.
 java.util.Vector getActivities(java.lang.String user, java.lang.String templateName, java.lang.String activityName, java.lang.String state)
          This method retrieves activity information for a given user Additional filters can be provided in retriving available activity information, apart from the mandatory activity owner parameter.
 java.util.Vector getActivitiesByRole(java.lang.String user, java.lang.String role, java.lang.String state)
          This method retrieves activity information for a given user, role and state.
 java.util.Vector getActivitiesByUser(java.lang.String user)
          This method retrieves activity information for a given user.
 java.util.Vector getActivitiesByUserActivityName(java.lang.String user, java.lang.String activityName)
          This method retrieves activity information for a given user and acitivityName
 java.util.Vector getActivitiesByUserActivityState(java.lang.String user, java.lang.String activityState)
          This method retrieves activity information for a given user and activityState
 java.util.Vector getActivityDetails(java.lang.String instanceName, java.lang.String activityName)
          This method retrieves activity information for a given process name.
 java.util.Vector getProcessByBizId(java.lang.String adocId)
          This method retrieves information for a given adocId
 java.util.Vector getProcessDetails(java.lang.String instanceName)
          This method retrieves information for a given process name.
 java.util.Vector getProcesses(java.lang.String procDefName)
          This method gets all the available processes for a given Process Template name.
 java.util.Vector getProcessTemplates()
          This method gets all the available process template names.
 javax.ejb.SessionContext getSessionContext()
          getSessionContext method comment
 boolean logOff(java.lang.String argUserId)
          This method logs off an user from MQ Workflow
 void setSessionContext(javax.ejb.SessionContext ctx)
          setSessionContext method comment
 void terminate(java.lang.String procDef, java.lang.String instanceName, java.lang.String user)
          This method terminates a given process instance.
 java.util.Hashtable terminatePBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String user)
          This method terminates a given process instance.
 void unclaim(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method unclaims an activity.
 void unclaim(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method unclaims the given activity.
 java.util.Hashtable unclaimPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String user, java.util.Hashtable activityVars)
          This method unclaims an activity.
 java.util.Hashtable unclaimPBS(java.lang.String procDef, java.lang.String instanceName, java.lang.String activityName, java.lang.String user, java.util.Hashtable activityVars)
          This method unclaims the given activity.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WWFServicesBean

public WWFServicesBean()
Method Detail

complete

public void complete(java.lang.String procDef,
                     java.lang.String instanceName,
                     java.lang.String activityName,
                     java.lang.String user,
                     java.util.Hashtable activityVars)
              throws java.rmi.RemoteException
This method completes the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can complete that activity
activityVars - Hashtable The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
ejbActivate method comment
Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
java.rmi.RemoteException - The exception description.

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      java.rmi.RemoteException
ejbCreate method comment
Throws:
javax.ejb.CreateException - The exception description.
java.rmi.RemoteException - The exception description.

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
ejbPassivate method comment
Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
java.rmi.RemoteException - The exception description.

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
ejbRemove method comment
Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
java.rmi.RemoteException - The exception description.

getSessionContext

public javax.ejb.SessionContext getSessionContext()
getSessionContext method comment
Returns:
javax.ejb.SessionContext

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws java.rmi.RemoteException
setSessionContext method comment
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - javax.ejb.SessionContext
Throws:
java.rmi.RemoteException - The exception description.

unclaim

public void unclaim(java.lang.String procDef,
                    java.lang.String instanceName,
                    java.lang.String activityName,
                    java.lang.String user,
                    java.util.Hashtable activityVars)
             throws java.rmi.RemoteException
This method unclaims the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can unclaim the activity
activityVars - The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

claim

public void claim(java.lang.String procDef,
                  java.lang.String instanceName,
                  java.lang.String activityName,
                  java.lang.String user,
                  java.util.Hashtable activityVars)
           throws java.rmi.RemoteException
This method claims the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can claim that activity
activityVars - Hashtable The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

claim

public void claim(java.lang.String procDef,
                  java.lang.String instanceName,
                  java.lang.String user,
                  java.util.Hashtable activityVars)
           throws java.rmi.RemoteException
This method claims an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Id generated by the MQ WorkFlow.
User - The User Id who can claim that activity
activityVars - Hashtable The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

claimPBS

public java.util.Hashtable claimPBS(java.lang.String procDef,
                                    java.lang.String instanceName,
                                    java.lang.String activityName,
                                    java.lang.String user,
                                    java.util.Hashtable activityVars)
                             throws java.rmi.RemoteException
This method claims the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can claim that activity
activityVars - Hashtable The activity variables
Returns:
Hashtable with the key "Claim" and a Hashtable object. The hashtable object contains the activity details for all the users other the user who claimed.
Throws:
java.lang.Exception - The exception description.

claimPBS

public java.util.Hashtable claimPBS(java.lang.String procDef,
                                    java.lang.String instanceName,
                                    java.lang.String user,
                                    java.util.Hashtable activityVars)
                             throws java.rmi.RemoteException
This method claims an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Id generated by the MQ WorkFlow.
User - The User Id who can claim that activity
activityVars - Hashtable The activity variables
Returns:
Hashtable with the key "Claim" and a Hashtable object. The hashtable object contains the activity details for all the users other the user who claimed.
Throws:
java.lang.Exception - The exception description.

complete

public void complete(java.lang.String procDef,
                     java.lang.String instanceName,
                     java.lang.String user,
                     java.util.Hashtable activityVars)
              throws java.rmi.RemoteException
This method completes an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can complete that activity
activityVars - Hashtable The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

completePBS

public java.util.Hashtable completePBS(java.lang.String procDef,
                                       java.lang.String instanceName,
                                       java.lang.String activityName,
                                       java.lang.String user,
                                       java.util.Hashtable activityVars)
                                throws java.rmi.RemoteException
This method completes the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can complete that activity
activityVars - Hashtable The activity variables
Returns:
Hashtable with the key "Complete" and a Hashtable object. The hashtable object contains the activity details for all the users for the next available activity/activities.
Throws:
java.lang.Exception - The exception description.

completePBS

public java.util.Hashtable completePBS(java.lang.String procDef,
                                       java.lang.String instanceName,
                                       java.lang.String user,
                                       java.util.Hashtable activityVars)
                                throws java.rmi.RemoteException
This method completes an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can complete that activity
activityVars - Hashtable The activity variables
Returns:
Hashtable with the key "Complete" and a Hashtable object. The hashtable object contains the activity details for all the users for the next available activity/activities.
Throws:
java.lang.Exception - The exception description.

create

public java.lang.String create(java.lang.String procDef,
                               java.lang.String instanceName,
                               java.lang.String user,
                               java.util.Hashtable procVars)
                        throws java.rmi.RemoteException
This method creates an instance of a given process template.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can create the process
procVars - Hashtable The Process variables, if any
Returns:
String ProcessId
Throws:
java.lang.Exception - The exception description.

createCollabProcessPBS

public java.util.Hashtable createCollabProcessPBS(java.lang.String procDef,
                                                  java.lang.String instanceName)
                                           throws java.rmi.RemoteException
This method is called by collab process. This method returns the available activities details.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
Returns:
Hashtable with the key "Create" and a Hashtable object. The hashtable object contains the activity details for all the users for the next available activity/activities.
Throws:
java.lang.Exception - The exception description.

createPBS

public java.util.Hashtable createPBS(java.lang.String procDef,
                                     java.lang.String instanceName,
                                     java.lang.String user,
                                     java.util.Hashtable procVars)
                              throws java.rmi.RemoteException
This method creates an instance of a given process template.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can create the process
procVars - Hashtable The Process variables, if any
Returns:
Hashtable with the key "Create" and a Hashtable object. The hashtable object contains the activity details for all the users for the next available activity/activities.
Throws:
java.lang.Exception - The exception description.

forceFinishPBS

public java.util.Hashtable forceFinishPBS(java.lang.String procDef,
                                          java.lang.String instanceName,
                                          java.lang.String activityName,
                                          java.lang.String user,
                                          java.util.Hashtable activityVars)
                                   throws java.rmi.RemoteException
This method is called by collab process. This method returns the available activities details.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity name
User - The User Id who can create the process
activityVars - Hashtable The Process variables, if any
Returns:
Hashtable with the key "Complete" and a Hashtable object. The hashtable object contains the activity details for all the users for the next available activity/activities.
Throws:
java.lang.Exception - The exception description.

getActivities

public java.util.Vector getActivities(java.lang.String user,
                                      java.lang.String templateName,
                                      java.lang.String activityName,
                                      java.lang.String state)
                               throws java.rmi.RemoteException
This method retrieves activity information for a given user Additional filters can be provided in retriving available activity information, apart from the mandatory activity owner parameter. The additional filters are optional and the optional filters are ProcessTemplateName, ActivityName, ActivityState.
Parameters:
user - The Owner of the activity.
templateName - The Process Template name
activityOwner - The Activity Name
state - The Activity state
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, PROCESSNAME, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getActivitiesByRole

public java.util.Vector getActivitiesByRole(java.lang.String user,
                                            java.lang.String role,
                                            java.lang.String state)
                                     throws java.rmi.RemoteException
This method retrieves activity information for a given user, role and state. The role and state could be null.
Parameters:
user - The owner of the activity.
role - The role of the user
state - The state of the activity
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, PROCESSNAME, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getActivitiesByUser

public java.util.Vector getActivitiesByUser(java.lang.String user)
                                     throws java.rmi.RemoteException
This method retrieves activity information for a given user.
Parameters:
user - The Owner of the activity.
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, PROCESSNAME, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getActivitiesByUserActivityName

public java.util.Vector getActivitiesByUserActivityName(java.lang.String user,
                                                        java.lang.String activityName)
                                                 throws java.rmi.RemoteException
This method retrieves activity information for a given user and acitivityName
Parameters:
user - The Owner of the activity.
activityName - The Activity Name
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, PROCESSNAME, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getActivitiesByUserActivityState

public java.util.Vector getActivitiesByUserActivityState(java.lang.String user,
                                                         java.lang.String activityState)
                                                  throws java.rmi.RemoteException
This method retrieves activity information for a given user and activityState
Parameters:
user - The Owner of the activity.
activityName - The Activity State
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, PROCESSNAME, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getActivityDetails

public java.util.Vector getActivityDetails(java.lang.String instanceName,
                                           java.lang.String activityName)
                                    throws java.rmi.RemoteException
This method retrieves activity information for a given process name.
Parameters:
instanceName - The Process instance name.
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYOWNER, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getProcessByBizId

public java.util.Vector getProcessByBizId(java.lang.String adocId)
                                   throws java.rmi.RemoteException
This method retrieves information for a given adocId
Parameters:
instanceName - The Process instance name.
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, ACTIVITYOWNER, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getProcessDetails

public java.util.Vector getProcessDetails(java.lang.String instanceName)
                                   throws java.rmi.RemoteException
This method retrieves information for a given process name.
Parameters:
instanceName - The Process instance name.
Returns:
Vector A Vector of Hashtables with the follwing keys: ACTIVITYNAME, ACTIVITYOWNER, ACTIVITYSTATE, TEMPLATENAME
Throws:
java.lang.Exception - The exception description.

getProcesses

public java.util.Vector getProcesses(java.lang.String procDefName)
                              throws java.rmi.RemoteException
This method gets all the available processes for a given Process Template name.
Parameters:
procDefName - The Process Template Name
pwd - User The owner of the process
Returns:
Vector A Vector Process Names
Throws:
java.lang.Exception - The exception description.

getProcessTemplates

public java.util.Vector getProcessTemplates()
                                     throws java.rmi.RemoteException
This method gets all the available process template names.
Returns:
Vector A Vector of Process Template names
Throws:
java.lang.Exception - The exception description.

logOff

public boolean logOff(java.lang.String argUserId)
               throws java.rmi.RemoteException
This method logs off an user from MQ Workflow
Parameters:
argUserId - The userId to be logged off.
Returns:
boolean Returns true, if success else returns false
Throws:
java.lang.Exception - The exception description.

terminate

public void terminate(java.lang.String procDef,
                      java.lang.String instanceName,
                      java.lang.String user)
               throws java.rmi.RemoteException
This method terminates a given process instance.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can claim that activity
Returns:
void
Throws:
java.lang.Exception - The exception description.

terminatePBS

public java.util.Hashtable terminatePBS(java.lang.String procDef,
                                        java.lang.String instanceName,
                                        java.lang.String user)
                                 throws java.rmi.RemoteException
This method terminates a given process instance.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can claim that activity
Returns:
Hashtable with the key "Terminate" and a Hashtable object. The hashtable object contains the activity details for all the activities to be removed
Throws:
java.lang.Exception - The exception description.

unclaim

public void unclaim(java.lang.String procDef,
                    java.lang.String instanceName,
                    java.lang.String user,
                    java.util.Hashtable activityVars)
             throws java.rmi.RemoteException
This method unclaims an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can unclaim the activity
activityVars - The activity variables
Returns:
void
Throws:
java.lang.Exception - The exception description.

unclaimPBS

public java.util.Hashtable unclaimPBS(java.lang.String procDef,
                                      java.lang.String instanceName,
                                      java.lang.String activityName,
                                      java.lang.String user,
                                      java.util.Hashtable activityVars)
                               throws java.rmi.RemoteException
This method unclaims the given activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
activityName - Activity Name
User - The User Id who can unclaim the activity
activityVars - The activity variables
Returns:
Hashtable with the key "UnClaim" and a Hashtable object. The hashtable object contains the activity details for all the activities which are available
Throws:
java.lang.Exception - The exception description.

unclaimPBS

public java.util.Hashtable unclaimPBS(java.lang.String procDef,
                                      java.lang.String instanceName,
                                      java.lang.String user,
                                      java.util.Hashtable activityVars)
                               throws java.rmi.RemoteException
This method unclaims an activity.
Parameters:
procDef - Process Template Name. e.g "RFQ Process", "PO Process", etc.,
instanceName - Process Instance Name. e.g. "RFQ-123345343"
User - The User Id who can unclaim the activity
activityVars - The activity variables
Returns:
Hashtable with the key "UnClaim" and a Hashtable object. The hashtable object contains the activity details for all the activities which are available
Throws:
java.lang.Exception - The exception description.