Class ProcessAction
java.lang.Object
org.apache.struts.action.Action
org.apache.struts.actions.BaseAction
org.apache.struts.actions.DispatchAction
org.bgerp.action.base.BaseAction
org.bgerp.action.ProcessAction
- Direct Known Subclasses:
ProcessAction, ProcessLinkAction, ProcessQueueAction
Process actions: viewing, creation, status, type, groups, executors and merging
-
Field Summary
Fields inherited from class BaseAction
l, MAPPER, PATH_JSP_ADMIN, PATH_JSP_OPEN, PATH_JSP_USER, PATH_JSP_USERMOB, setupFields inherited from class org.apache.struts.actions.DispatchAction
clazz, methods, typesFields inherited from class org.apache.struts.actions.BaseAction
messagesFields inherited from class org.apache.struts.action.Action
servlet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voiddoCreateWizard(DynActionForm form, Connection con, Process process, ProcessType type) Inverts the process ID to a temporary (negative) one when the type has a creation wizardprotected ProcessgetProcess(ProcessDAO processDao, int id) Gets process entity by ID.static ProcessTypegetProcessType(int typeId) Returns the process type from cache by its ID, or throws if it does not existorg.apache.struts.action.ActionForwardmessagePossibleProcessList(DynActionForm form, ConnectionSet conSet) Returns the processes a message could possibly belong to, by sender and linked objectsorg.apache.struts.action.ActionForwardprocess(DynActionForm form, ConnectionSet conSet) Opens a process, or a placeholder when it does not exist, optionally with its creation wizardorg.apache.struts.action.ActionForwardprocessClone(DynActionForm form, Connection con) Clones a process with its parametersorg.apache.struts.action.ActionForwardprocessCreate(DynActionForm form, Connection con) Creates a process and returns its ID for navigating to the editorstatic voidprocessCreate(DynActionForm form, Connection con, Process process) Creates the given process with no preselected groupstatic voidprocessCreate(DynActionForm form, Connection con, Process process, int groupId) Creates the given process: stores it, sets the initial status, groups and runs the creation wizardstatic ProcessprocessCreateAndGet(DynActionForm form, Connection con) Creates a process from the form parameters and returns itorg.apache.struts.action.ActionForwardprocessCreateGroups(DynActionForm form, Connection con) Returns the groups offered for selection when creating a process of the given typestatic List<ProcessCreateType> processCreateTypes(DynActionForm form, String area, Set<Integer> ids) List of process types, allowed for creation, filtered by 'create.in' configuration and process isolationorg.apache.struts.action.ActionForwardprocessDelete(DynActionForm form, Connection con) Deletes a processstatic voidprocessDelete(DynActionForm form, Connection con, Process process) Deletes the given process and fires the removed eventorg.apache.struts.action.ActionForwardprocessDeleteTmp(DynActionForm form, Connection con) Deletes a temporary (not yet finally created) processorg.apache.struts.action.ActionForwardprocessDescriptionAdd(DynActionForm form, Connection con) Appends text to the description of a process using the configured patternorg.apache.struts.action.ActionForwardprocessDescriptionUpdate(DynActionForm form, Connection con) Replaces the description of a processorg.apache.struts.action.ActionForwardprocessExecutorsEdit(DynActionForm form, ConnectionSet conSet) Opens the executors editor of a process, grouped by group and roleorg.apache.struts.action.ActionForwardprocessExecutorsSwap(DynActionForm form, Connection con) Swaps executors between the two groups of a processorg.apache.struts.action.ActionForwardprocessExecutorsUpdate(DynActionForm form, Connection con) Updates the executors of a process in the given group-rolesstatic voidprocessExecutorsUpdate(DynActionForm form, Connection con, Process process, Set<ProcessGroup> processGroups, Set<ProcessExecutor> processExecutors) Updates the executors of the given process in the given group-roles, applying permission checksorg.apache.struts.action.ActionForwardprocessFinishCreateTmp(DynActionForm form, Connection con) Finalizes creation of a temporary process, turning it into a permanent oneorg.apache.struts.action.ActionForwardprocessGroupsEdit(DynActionForm form, Connection con) Opens the groups-with-roles editor of a processorg.apache.struts.action.ActionForwardprocessGroupsUpdate(DynActionForm form, Connection con) Updates the groups with roles of a process, validating them against the allowed groupsstatic voidprocessGroupsUpdate(DynActionForm form, Connection con, Process process, Set<ProcessGroup> processGroups) Sets the groups with roles of the given process and removes executors of dropped group-rolesorg.apache.struts.action.ActionForwardprocessMerge(DynActionForm form, Connection con) Merges a process into another one, moving its messages and deleting the source processorg.apache.struts.action.ActionForwardprocessMergeEdit(DynActionForm form, ConnectionSet conSet) Opens the merge editor of a processorg.apache.struts.action.ActionForwardprocessPriorityEdit(DynActionForm form, ConnectionSet conSet) Opens the priority editor of a processorg.apache.struts.action.ActionForwardprocessPriorityUpdate(DynActionForm form, Connection con) Updates the priority of a processstatic voidprocessPriorityUpdate(DynActionForm form, Process process, Connection con, Integer priority) Sets the priority of the given process and fires change eventsorg.apache.struts.action.ActionForwardprocessStatusEdit(DynActionForm form, Connection con) Opens the status editor of a processorg.apache.struts.action.ActionForwardprocessStatusHistory(DynActionForm form, Connection con) Returns the status change history of a processorg.apache.struts.action.ActionForwardprocessStatusUpdate(DynActionForm form, Connection con) Changes the status of a process, supporting the special 'prev' previous-status valuestatic voidprocessStatusUpdate(DynActionForm form, Connection con, Process process, StatusChange change) Applies a status change to a process, validating required comment, parameters and the transitionorg.apache.struts.action.ActionForwardprocessTypeEdit(DynActionForm form, Connection con) Opens the type editor of a processprocessTypes(Collection<Process> processes) List with process types, reverse ordered by usage countsorg.apache.struts.action.ActionForwardprocessTypeUpdate(DynActionForm form, Connection con) Updates the type of a processorg.apache.struts.action.ActionForwardunionLog(DynActionForm form, Connection con) Returns the combined log of a processorg.apache.struts.action.ActionForwardunspecified(DynActionForm form, ConnectionSet conSet) Default action method if no parameter 'action' passed.org.apache.struts.action.ActionForwarduserProcessList(DynActionForm form, ConnectionSet conSet) Returns the processes the current user is an executor ofMethods inherited from class BaseAction
checkModified, dispatchMethod, getParameter, html, html, json, json, permissionCheck, restoreRequestParams, unspecified, updatePersonalizationMethods inherited from class org.apache.struts.actions.DispatchAction
cancelled, execute, getMethod, getMethodName, unspecifiedMethods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
-
Constructor Details
-
ProcessAction
public ProcessAction()Default constructor
-
-
Method Details
-
unspecified
public org.apache.struts.action.ActionForward unspecified(DynActionForm form, ConnectionSet conSet) throws Exception Description copied from class:BaseActionDefault action method if no parameter 'action' passed. Overwrite and implement.- Overrides:
unspecifiedin classBaseAction- Parameters:
form-conSet-- Returns:
- Throws:
Exception
-
process
public org.apache.struts.action.ActionForward process(DynActionForm form, ConnectionSet conSet) throws Exception Opens a process, or a placeholder when it does not exist, optionally with its creation wizard- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processCreateTypes
public static List<ProcessCreateType> processCreateTypes(DynActionForm form, String area, Set<Integer> ids) List of process types, allowed for creation, filtered by 'create.in' configuration and process isolation- Parameters:
form- current request form user and permissionarea- creation areaids- optional additional restricting process IDs- Returns:
- list of process types
-
processCreateGroups
public org.apache.struts.action.ActionForward processCreateGroups(DynActionForm form, Connection con) Returns the groups offered for selection when creating a process of the given type- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
-
processCreateAndGet
Creates a process from the form parameters and returns it- Parameters:
form- request formcon- database connection- Returns:
- the created process
- Throws:
Exception- on any error
-
processCreate
public static void processCreate(DynActionForm form, Connection con, Process process) throws Exception Creates the given process with no preselected group- Parameters:
form- request formcon- database connectionprocess- process to create- Throws:
Exception- on any error
-
processCreate
public static void processCreate(DynActionForm form, Connection con, Process process, int groupId) throws Exception Creates the given process: stores it, sets the initial status, groups and runs the creation wizard- Parameters:
form- request formcon- database connectionprocess- process to creategroupId- group to assign, or non-positive to use the type configuration- Throws:
Exception- on any error
-
doCreateWizard
protected static void doCreateWizard(DynActionForm form, Connection con, Process process, ProcessType type) throws SQLException Inverts the process ID to a temporary (negative) one when the type has a creation wizard- Parameters:
form- request formcon- database connectionprocess- process being createdtype- process type- Throws:
SQLException- on a database error
-
processCreate
public org.apache.struts.action.ActionForward processCreate(DynActionForm form, Connection con) throws Exception Creates a process and returns its ID for navigating to the editor- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processClone
public org.apache.struts.action.ActionForward processClone(DynActionForm form, Connection con) throws Exception Clones a process with its parameters- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processDeleteTmp
public org.apache.struts.action.ActionForward processDeleteTmp(DynActionForm form, Connection con) throws Exception Deletes a temporary (not yet finally created) process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processDelete
public org.apache.struts.action.ActionForward processDelete(DynActionForm form, Connection con) throws Exception Deletes a process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processDelete
public static void processDelete(DynActionForm form, Connection con, Process process) throws Exception Deletes the given process and fires the removed event- Parameters:
form- request formcon- database connectionprocess- process to delete- Throws:
Exception- on any error
-
processFinishCreateTmp
public org.apache.struts.action.ActionForward processFinishCreateTmp(DynActionForm form, Connection con) throws Exception Finalizes creation of a temporary process, turning it into a permanent one- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processStatusEdit
public org.apache.struts.action.ActionForward processStatusEdit(DynActionForm form, Connection con) throws Exception Opens the status editor of a process- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processStatusUpdate
public org.apache.struts.action.ActionForward processStatusUpdate(DynActionForm form, Connection con) throws Exception Changes the status of a process, supporting the special 'prev' previous-status value- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processStatusUpdate
public static void processStatusUpdate(DynActionForm form, Connection con, Process process, StatusChange change) throws Exception Applies a status change to a process, validating required comment, parameters and the transition- Parameters:
form- request formcon- database connectionprocess- process to changechange- status change to apply- Throws:
Exception- on any error
-
processStatusHistory
public org.apache.struts.action.ActionForward processStatusHistory(DynActionForm form, Connection con) throws Exception Returns the status change history of a process- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processPriorityEdit
public org.apache.struts.action.ActionForward processPriorityEdit(DynActionForm form, ConnectionSet conSet) Opens the priority editor of a process- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
-
processPriorityUpdate
public org.apache.struts.action.ActionForward processPriorityUpdate(DynActionForm form, Connection con) throws Exception Updates the priority of a process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processPriorityUpdate
public static void processPriorityUpdate(DynActionForm form, Process process, Connection con, Integer priority) throws Exception Sets the priority of the given process and fires change events- Parameters:
form- request formprocess- process to changecon- database connectionpriority- new priority- Throws:
Exception- on any error
-
processTypeEdit
Opens the type editor of a process- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
-
processTypeUpdate
public org.apache.struts.action.ActionForward processTypeUpdate(DynActionForm form, Connection con) throws Exception Updates the type of a process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processDescriptionUpdate
public org.apache.struts.action.ActionForward processDescriptionUpdate(DynActionForm form, Connection con) throws Exception Replaces the description of a process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processDescriptionAdd
public org.apache.struts.action.ActionForward processDescriptionAdd(DynActionForm form, Connection con) throws Exception Appends text to the description of a process using the configured pattern- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processGroupsEdit
public org.apache.struts.action.ActionForward processGroupsEdit(DynActionForm form, Connection con) throws Exception Opens the groups-with-roles editor of a process- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processGroupsUpdate
public org.apache.struts.action.ActionForward processGroupsUpdate(DynActionForm form, Connection con) throws Exception Updates the groups with roles of a process, validating them against the allowed groups- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processGroupsUpdate
public static void processGroupsUpdate(DynActionForm form, Connection con, Process process, Set<ProcessGroup> processGroups) throws Exception Sets the groups with roles of the given process and removes executors of dropped group-roles- Parameters:
form- request formcon- database connectionprocess- process to changeprocessGroups- new groups with roles- Throws:
Exception- on any error
-
processExecutorsEdit
public org.apache.struts.action.ActionForward processExecutorsEdit(DynActionForm form, ConnectionSet conSet) throws Exception Opens the executors editor of a process, grouped by group and role- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processExecutorsUpdate
public org.apache.struts.action.ActionForward processExecutorsUpdate(DynActionForm form, Connection con) throws Exception Updates the executors of a process in the given group-roles- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processExecutorsSwap
public org.apache.struts.action.ActionForward processExecutorsSwap(DynActionForm form, Connection con) throws Exception Swaps executors between the two groups of a process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-
processExecutorsUpdate
public static void processExecutorsUpdate(DynActionForm form, Connection con, Process process, Set<ProcessGroup> processGroups, Set<ProcessExecutor> processExecutors) throws Exception Updates the executors of the given process in the given group-roles, applying permission checks- Parameters:
form- request formcon- database connectionprocess- process to changeprocessGroups- group-roles being updatedprocessExecutors- new executors for those group-roles- Throws:
Exception- on any error
-
getProcess
Gets process entity by ID.- Parameters:
processDao- DAO.id- process ID.- Returns:
- the process
- Throws:
SQLException- - DB exception.BGMessageException- - entity not found.
-
getProcessType
Returns the process type from cache by its ID, or throws if it does not exist- Parameters:
typeId- process type ID- Returns:
- the process type
- Throws:
BGMessageException- if the type is not found
-
messagePossibleProcessList
public org.apache.struts.action.ActionForward messagePossibleProcessList(DynActionForm form, ConnectionSet conSet) throws Exception Returns the processes a message could possibly belong to, by sender and linked objects- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
unionLog
public org.apache.struts.action.ActionForward unionLog(DynActionForm form, Connection con) throws Exception Returns the combined log of a process- Parameters:
form- request formcon- database connection- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
userProcessList
public org.apache.struts.action.ActionForward userProcessList(DynActionForm form, ConnectionSet conSet) throws Exception Returns the processes the current user is an executor of- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processTypes
List with process types, reverse ordered by usage counts- Parameters:
processes- processes to count types over- Returns:
- list of process type ID/title pairs ordered by descending usage count
-
processMergeEdit
public org.apache.struts.action.ActionForward processMergeEdit(DynActionForm form, ConnectionSet conSet) throws Exception Opens the merge editor of a process- Parameters:
form- request formconSet- connection set- Returns:
- HTML view forward
- Throws:
Exception- on any error
-
processMerge
public org.apache.struts.action.ActionForward processMerge(DynActionForm form, Connection con) throws Exception Merges a process into another one, moving its messages and deleting the source process- Parameters:
form- request formcon- database connection- Returns:
- JSON response
- Throws:
Exception- on any error
-