gps.appmodule
Class ApplicationsBusinessLogic

java.lang.Object
  extended by gps.appmodule.ApplicationsBusinessLogic

public class ApplicationsBusinessLogic
extends java.lang.Object

This class provides API for creating complete project application It includes the following: 1. Creation of Project Application 2. Creation of Project Workflows, States 3. Copy Query Template, Node from the Source Application 4. Assignment of Node to States 5. Role Assignments 6. Menu Assignment

Author:
kchinta

Field Summary
 java.lang.String SourceApplicationName
           
 
Constructor Summary
ApplicationsBusinessLogic()
           
 
Method Summary
 java.lang.String assignApplicationToRoles(java.lang.Double applicationID, java.util.ArrayList roleNames)
          Assign application to roles.
 java.lang.Double createProjectPlanApplication(java.util.Hashtable objectHashtable)
          createProjectPlanApplication for the given application.
 java.lang.Double createProjectPlanApplication(java.lang.String applicationName, java.lang.String userName, java.lang.String sourceApplicationName)
          createProjectPlanApplication for the given application.
 java.util.ArrayList createWorkflow(java.lang.Double ApplicationId, java.lang.Double WorkflowId, java.util.ArrayList statesInfo, java.lang.String NodeTypeFlag)
          creates flow of the work - includes states and operations, for the given workflow
 java.lang.Double createWorkflowHeader(java.lang.Double ApplicationId, java.lang.String workflowName)
          createWorkflowHeader for the given application.
 java.lang.Object executeApplicationBusinessLogic(java.util.Hashtable objectHashtable)
          Execute application business logic.
 java.util.HashMap getApplicationCategoriesForRoleUser(java.util.Hashtable objectHashtable)
          Method added by Geetha Malika to get application categories assigned for the role.
 java.lang.String getSourceApplicationName()
           
 java.lang.Double insertANDState(java.lang.Double workflowID, java.lang.String getControllerName, int x, int y)
          Insert and state.
 void insertOperation(java.lang.Double workflowID, java.lang.String sourceApplicationName, java.util.ArrayList fromStateIDs, java.lang.Double toStateID, int x, int y)
          Insert operation.
 void insertOperation(java.lang.Double workflowID, java.lang.String sourceApplicationName, java.lang.Double fromStateID, java.lang.Double toStateID)
          Insert operation.
 void insertToStateOperation(java.lang.Double toStateID, java.lang.Double operationID)
          Insert to state operation.
 java.lang.Double insertWorkflowStates(java.lang.String stateName, java.lang.String stateType, java.lang.String predecessor, java.lang.Double workflowID, java.lang.String sourceApplicationName, java.lang.Double predecessorStateID, int x, int y, boolean orStateFlag)
          Insert workflow states.
 void setConnection(java.sql.Connection connection)
          Sets the connection.
 void setSourceApplicationName(java.lang.String sourceApplicationName)
           
 void updateCategory(java.util.ArrayList categoriesList, gps.helper.Category category)
          Update category.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SourceApplicationName

public java.lang.String SourceApplicationName
Constructor Detail

ApplicationsBusinessLogic

public ApplicationsBusinessLogic()
Method Detail

getSourceApplicationName

public java.lang.String getSourceApplicationName()

setSourceApplicationName

public void setSourceApplicationName(java.lang.String sourceApplicationName)

setConnection

public void setConnection(java.sql.Connection connection)
Sets the connection.

Parameters:
connection - the new connection

executeApplicationBusinessLogic

public java.lang.Object executeApplicationBusinessLogic(java.util.Hashtable objectHashtable)
Execute application business logic.

Parameters:
objectHashtable - the object hashtable
Returns:
the object

createWorkflow

public java.util.ArrayList createWorkflow(java.lang.Double ApplicationId,
                                          java.lang.Double WorkflowId,
                                          java.util.ArrayList statesInfo,
                                          java.lang.String NodeTypeFlag)
                                   throws java.lang.Exception
creates flow of the work - includes states and operations, for the given workflow

Parameters:
ApplicationId - Double
WorkflowId - Double
statesInfo - ArrayList - The ArrayList should contain the following template: [[state1, type (STATE/WORKFLOW), predecessor],[state2, type (STATE/WORKFLOW),predecessor (State1)],[],....]
sourceApplicationName - String - used for copy from for Query Template and Node
Returns:
stateIDList - ArrayList
Throws:
java.lang.Exception - the exception

createWorkflowHeader

public java.lang.Double createWorkflowHeader(java.lang.Double ApplicationId,
                                             java.lang.String workflowName)
                                      throws java.lang.Exception
createWorkflowHeader for the given application.

Parameters:
Double - applicationId
String - workflowName
Returns:
Double workflow ID kchinta on June 3, 2011 10:13:09 AM
Throws:
java.lang.Exception

insertWorkflowStates

public java.lang.Double insertWorkflowStates(java.lang.String stateName,
                                             java.lang.String stateType,
                                             java.lang.String predecessor,
                                             java.lang.Double workflowID,
                                             java.lang.String sourceApplicationName,
                                             java.lang.Double predecessorStateID,
                                             int x,
                                             int y,
                                             boolean orStateFlag)
Insert workflow states.

Parameters:
stateName - the state name
stateType - the state type
predecessor - the predecessor
workflowID - the workflow id
sourceApplicationName - the source application name
predecessorStateID - the predecessor state id
x - the x
y - the y
orStateFlag - the or state flag
Returns:
the double

assignApplicationToRoles

public java.lang.String assignApplicationToRoles(java.lang.Double applicationID,
                                                 java.util.ArrayList roleNames)
                                          throws java.lang.Exception
Assign application to roles.

Parameters:
Double - applicationID
ArrayList - roleNames
Returns:
the String
Throws:
java.lang.Exception

createProjectPlanApplication

public java.lang.Double createProjectPlanApplication(java.lang.String applicationName,
                                                     java.lang.String userName,
                                                     java.lang.String sourceApplicationName)
                                              throws java.lang.Exception
createProjectPlanApplication for the given application.

Parameters:
String - applicationName
String - userName
String - sourceApplicationName
Returns:
Double application ID kchinta on June 3, 2011 10:13:09 AM
Throws:
java.lang.Exception

createProjectPlanApplication

public java.lang.Double createProjectPlanApplication(java.util.Hashtable objectHashtable)
createProjectPlanApplication for the given application.

Parameters:
String - applicationName
String - userName
String - sourceApplicationName
Returns:
Double application ID kchinta on June 3, 2011 10:13:09 AM

getApplicationCategoriesForRoleUser

public java.util.HashMap getApplicationCategoriesForRoleUser(java.util.Hashtable objectHashtable)
Method added by Geetha Malika to get application categories assigned for the role.

Parameters:
objectHashtable - (roleappid and roleflag parameters)
Returns:
list of categories in sorted order

updateCategory

public void updateCategory(java.util.ArrayList categoriesList,
                           gps.helper.Category category)
Update category.

Parameters:
categoriesList - the categories list
category - the category

insertOperation

public void insertOperation(java.lang.Double workflowID,
                            java.lang.String sourceApplicationName,
                            java.util.ArrayList fromStateIDs,
                            java.lang.Double toStateID,
                            int x,
                            int y)
Insert operation.

Parameters:
workflowID - the workflow id
sourceApplicationName - the source application name
fromStateIDs - the from state i ds
toStateID - the to state id
x - the x
y - the y

insertOperation

public void insertOperation(java.lang.Double workflowID,
                            java.lang.String sourceApplicationName,
                            java.lang.Double fromStateID,
                            java.lang.Double toStateID)
Insert operation.

Parameters:
workflowID - the workflow id
sourceApplicationName - the source application name
fromStateID - the from state id
toStateID - the to state id

insertANDState

public java.lang.Double insertANDState(java.lang.Double workflowID,
                                       java.lang.String getControllerName,
                                       int x,
                                       int y)
Insert and state.

Parameters:
workflowID - the workflow id
getControllerName - the get controller name
x - the x
y - the y
Returns:
the double

insertToStateOperation

public void insertToStateOperation(java.lang.Double toStateID,
                                   java.lang.Double operationID)
Insert to state operation.

Parameters:
toStateID - the to state id
operationID - the operation id