Package ru.bgcrm.dao.process
Class ProcessLinkDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.CommonLinkDAO
ru.bgcrm.dao.process.ProcessLinkDAO
Process links DAO.
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DynActionForm
User request context for isolations.Fields inherited from class ru.bgcrm.dao.CommonDAO
con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_WHERE
-
Constructor Summary
ConstructorDescriptionProcessLinkDAO
(Connection con) Constructor without isolations.ProcessLinkDAO
(Connection con, DynActionForm form) Constructor, respecting isolations for methods:getLinkedProcessList(int, String, boolean, Set)
,searchLinkedProcessList(Pageable, String, int, String, Set, Set, String, Boolean)
,searchLinkProcessList(Pageable, int)
,searchLinkProcessList(Pageable, int, Boolean)
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkCycles
(int processId) Checks cyclic dependencies.protected String
getLinkCustomers
(int processId, String linkObjectType) Selects customers links for process.getLinkedProcessesCounts
(int processId) Selects counts of linked and link processes to a given process.getLinkedProcessList
(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) Возвращает процессы, к которым привязан процесс.getLinkedProcessTypeIdList
(String objectType, int objectId) Process type IDs, linked to object.getLinkProcessList
(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) Возвращает процессы, привязанные к процессу.getLinksOver
(Set<Integer> processIds) Возвращает связи внутри набора процессов.protected String
getProcessLinkedForSame
(int processId, int linkedTypeId, int linkTypeId) Deprecated.protected String
getTable()
void
linkToAnotherObject
(int objectFromId, String typeObjectFrom, int objectToId, String typeObjectTo, String typePrefix, String excludeType) void
searchLinkedProcessList
(Pageable<Pair<String, Process>> searchResult, String objectType, int objectId, String objectTitle, Set<Integer> typeIds, Set<Integer> statusIds, String paramFilter, Boolean open) Deprecated.void
searchLinkedProcessList
(Pageable<Pair<String, Process>> searchResult, String objectType, int objectId, Set<Integer> typeIds, Set<Integer> statusIds, String paramFilter, Boolean closed) Deprecated.void
searchLinkProcessList
(Pageable<Pair<String, Process>> searchResult, int processId) Deprecated.void
Deprecated.Methods inherited from class ru.bgcrm.dao.CommonLinkDAO
addLink, addLinkIfNotExist, copyLinks, copyLinks, deleteLink, deleteLinksTo, deleteLinksWithType, deleteObjectLinks, getLinkDAO, getObjectLinksWithType, isLinkExists, prepareLink, updateLinkTitles
Methods inherited from class ru.bgcrm.dao.CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Field Details
-
form
User request context for isolations.
-
-
Constructor Details
-
ProcessLinkDAO
Constructor without isolations.- Parameters:
con
- DB connection.
-
ProcessLinkDAO
Constructor, respecting isolations for methods:getLinkedProcessList(int, String, boolean, Set)
,searchLinkedProcessList(Pageable, String, int, String, Set, Set, String, Boolean)
,searchLinkProcessList(Pageable, int)
,searchLinkProcessList(Pageable, int, Boolean)
.- Parameters:
con
- DB connection.form
- form object with a user.
-
-
Method Details
-
getTable
- Specified by:
getTable
in classCommonLinkDAO
-
getColumnName
- Specified by:
getColumnName
in classCommonLinkDAO
-
getObjectType
- Specified by:
getObjectType
in classCommonLinkDAO
-
linkToAnotherObject
-
getLinkProcessList
public List<Process> getLinkProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) throws SQLException Возвращает процессы, привязанные к процессу.- Parameters:
processId
- код процесса.linkType
- если не null, то SQL LIKE выражение фильтр по типу связиProcess.LINK_TYPE_DEPEND
,Process.LINK_TYPE_LINK
,Process.LINK_TYPE_MADE
.onlyOpen
- только открытые.typeIds
- если не null, то фильтр по типам процессов.- Returns:
- Throws:
SQLException
-
getLinkedProcessList
public List<Process> getLinkedProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) throws SQLException Возвращает процессы, к которым привязан процесс.- Parameters:
processId
- код процесса.linkType
- если не null, то SQL LIKE выражение фильтр по типу связиProcess.LINK_TYPE_DEPEND
,Process.LINK_TYPE_LINK
,Process.LINK_TYPE_MADE
.onlyOpen
- выбирать только открытые процессы.typeIds
- если не null, то фильтр по типам процессов.- Returns:
- Throws:
SQLException
-
getLinksOver
Возвращает связи внутри набора процессов.- Parameters:
processIds
- коды процессов из набора.- Returns:
- Throws:
SQLException
-
searchLinkedProcessList
@Deprecated public void searchLinkedProcessList(Pageable<Pair<String, Process>> searchResult, String objectType, int objectId, String objectTitle, Set<Integer> typeIds, Set<Integer> statusIds, String paramFilter, Boolean open) throws ExceptionDeprecated.Возвращает процессы, привязанные к какой-либо сущности.- Parameters:
searchResult
- результат с object_type и привязанным процессом.objectType
- фильтр по типу привязанного объекта LIKE.objectId
- фильтр по коду привязанного объекта.objectTitle
- опциональный фильтр по object_title привязки.typeIds
- опциональный фильтр по типам процессов.statusIds
- опциональный фильтр по статусам процессов.paramFilter
- опциональный фильтр по параметру, передаётся вinvalid reference
ParamValueDAO#getParamJoinFilters(String, String)
open
- опциональный фильтр по открытости процесса.- Throws:
Exception
-
searchLinkedProcessList
@Deprecated public void searchLinkedProcessList(Pageable<Pair<String, Process>> searchResult, String objectType, int objectId, Set<Integer> typeIds, Set<Integer> statusIds, String paramFilter, Boolean closed) throws ExceptionDeprecated.- Throws:
Exception
-
getLinkedProcessTypeIdList
Process type IDs, linked to object.- Parameters:
objectType
- SQL LIKE filter by object type.objectId
- object ID.- Returns:
- Throws:
SQLException
-
searchLinkProcessList
@Deprecated public void searchLinkProcessList(Pageable<Pair<String, Process>> searchResult, int processId) throws ExceptionDeprecated.CallssearchLinkProcessList(Pageable, int, Boolean)
with open = null.- Parameters:
searchResult
-processId
-- Throws:
Exception
-
searchLinkProcessList
@Deprecated public void searchLinkProcessList(Pageable<Pair<String, Process>> searchResult, int processId, Boolean open) throws ExceptionDeprecated.Searches processes linked to the process, sorted by creation time desc.- Parameters:
searchResult
-processId
- the process.open
- null or open / close filter.- Throws:
Exception
-
checkCycles
Checks cyclic dependencies.- Parameters:
processId
-- Returns:
- Throws:
Exception
-
getLinkCustomers
Selects customers links for process.- Parameters:
processId
- process ID.linkObjectType
- optional SQL LIKE filter by link object type.- Returns:
- Throws:
SQLException
-
getLinkedProcessesCounts
Selects counts of linked and link processes to a given process. Note that process isolation is not taken here on account.- Parameters:
processId
- the process ID.- Returns:
- a pair with linked count on the first place, links count on the second.
- Throws:
SQLException
-
getProcessLinkedForSame
@Deprecated public Process getProcessLinkedForSame(int processId, int linkedTypeId, int linkTypeId) throws Exception Deprecated.Use: Utils.getFirst(getLinkProcessList(Utils.getFirst(linkedProcessList).getId(), Process.LINK_TYPE_DEPEND, false, Collections.singleton(linkTypeId)))- Throws:
Exception
-