@Repository(value="blWorkflowEventDao") public class WorkflowEventDaoImpl extends Object implements WorkflowEventDao
UpdateExecutor,
WorkflowEventDao| Modifier and Type | Field and Description |
|---|---|
static String |
BC_UPDATE_APPROVAL_STATUS |
static String |
BC_UPDATE_COMPLETE_EVENTS |
static String |
BC_UPDATE_EVENT_DEPLOYMENT |
static String |
BC_UPDATE_EVENT_SETUP_STATUS |
static String |
BC_UPDATE_EVENT_SETUP_STATUS_AND_ACTION |
static String |
BC_UPDATE_RESET_EVENTS_APPROVAL |
protected javax.persistence.EntityManager |
em |
protected boolean |
enableStatusTiming |
| Constructor and Description |
|---|
WorkflowEventDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addActionRestriction(List<javax.persistence.criteria.Predicate> restrictions,
javax.persistence.criteria.Root<WorkflowEventImpl> root,
javax.persistence.criteria.CriteriaBuilder builder,
boolean isApproved)
|
protected void |
addArchivedRestrictions(List<javax.persistence.criteria.Predicate> restrictions,
javax.persistence.criteria.Root<WorkflowEventImpl> root,
javax.persistence.criteria.CriteriaBuilder builder)
|
protected void |
addSandboxRestriction(List<javax.persistence.criteria.Predicate> restrictions,
javax.persistence.criteria.Root<WorkflowEventImpl> root,
javax.persistence.criteria.CriteriaBuilder builder,
Long sandboxId)
|
protected void |
addUnscheduledDeploymentRestrictions(List<javax.persistence.criteria.Predicate> restrictions,
javax.persistence.criteria.Root<WorkflowEventImpl> root,
javax.persistence.criteria.CriteriaBuilder builder)
|
int |
completeEvents(List<Long> sandBoxItemIds)
Based on the list of
WorkflowSandBoxItem ids, find all
associated WorkflowEvent instances that have no un-completed
WorkflowSandBoxItem instances and set those events to completed status. |
void |
delete(WorkflowEvent event)
Deletes the specified WorkflowEvent from the database
|
void |
detach(WorkflowDeployment deployment)
Detaches the given WorkflowDeployment instance from the entity manager.
|
void |
finishDeployment(Long deploymentId)
Set the
StatusTiming#getDateFinished() on WorkflowDeployment. |
protected javax.persistence.criteria.Selection<Long> |
getIdSelection(javax.persistence.criteria.Root<?> root)
Return a
Selection for the id property of the entity. |
WorkflowEvent |
merge(WorkflowEvent event)
Saves the given WorkflowEvent
|
WorkflowDeployment |
persist(WorkflowDeployment deployment)
Saves the given WorkflowDeployment
|
WorkflowEvent |
persist(WorkflowEvent event)
Saves the given WorkflowEvent
|
List<Long> |
readAllDeployInProgressIdsForSandBox(Long sandBoxId)
Reads the ids corresponding to WorkflowEvents that are in the specified sanbox
and are in the process of deploying
|
List<WorkflowEvent> |
readAllForSandBox(Long sandBoxId)
Reads all WorkflowEvents that are currently associated with the given sandbox
|
List<WorkflowDeployment> |
readAllFutureDeployments()
Reads a list of WorkflowDeployments that are set to deploy at a future time.
|
List<Long> |
readAllIdsForSandBox(Long sandBoxId)
Reads the ids corresponding to WorkflowEvents that are in the specified sandbox.
|
List<Long> |
readAllNotDeployedIdsForSandBox(Long sandBoxId)
Reads the ids corresponding to WorkflowEvents that are in the specified sandbox
and are not yet deployed.
|
WorkflowEvent |
readById(Long id)
Reads a given WorkflowEvent by its internal id
|
List<WorkflowEvent> |
readByIds(List<Long> ids)
Reads several WorkflowEvents by the given internal ids
|
List<Long> |
readBySandBoxItems(List<Long> sandBoxItemIds)
Reads the WorkflowEvents ids that are associated with the given
WorkflowSandBoxItem ids |
WorkflowDeployment |
readDeploymentById(Long id)
Reads a WorkflowDeployment instance that corresponds to the given id
|
WorkflowDeployment |
readDeploymentByJob(Long jobId)
Reads a WorkflowDeployment instance that corresponds to the given job id
|
List<WorkflowDeployment> |
readDeploymentsByEvents(List<Long> events)
Reads a list of WorkflowDeployments that are associated to the given list of WorkflowEvent ids.
|
List<WorkflowEvent> |
readEntitiesBySandBoxItems(List<Long> sandBoxItemIds)
Reads the WorkflowEvents that are associated with the given
WorkflowSandBoxItem ids |
List<Long> |
readEventIdsByDeployment(Long deploymentId)
Based on the id value from a
WorkflowDeployment, find all
associated WorkflowEvent.getId() values. |
List<WorkflowEvent> |
readScheduledEventsByAdminUser(org.broadleafcommerce.openadmin.server.security.domain.AdminUser user)
Reads a list of
WorkflowEvents that are scheduled for deployment & are authored by the provided AdminUser. |
List<Long> |
readUnscheduledEventIdsByApprovalStatus(Long sandboxId,
boolean isApproved)
Finds all
WorkflowEvents associated by WorkflowEventImpl.sandBox
and that are not deployed or scheduled for deployment |
List<Long> |
readUnscheduledEventIdsByCriticalAndApprovalStatus(Long sandboxId,
boolean isCritical,
boolean isApproved)
Finds all
WorkflowEvents associated by WorkflowEventImpl.sandBox and
WorkflowEventImpl.isCritical and that are not deployed or scheduled for deployment |
WorkflowEvent |
refresh(WorkflowEvent event)
Reloads the given WorkflowEvent with the latest version from the database.
|
void |
removeDeployment(WorkflowDeployment deployment)
Deletes the specified WorkflowDeployment from the database
|
int |
resetEventsForApproval(List<Long> sandBoxItemIds)
Based on the list of
WorkflowSandBoxItem ids, find all
associated WorkflowEvent instances and reset the status
information for an WorkflowEvent that
has already been promoted and is about to be approved. |
void |
startDeployment(Long deploymentId)
Set the
StatusTiming#getDateStarted() on WorkflowDeployment. |
void |
updateApprovalStatus(Long eventId)
Marks the given WorkflowEvent id as Approved but not scheduled.
|
void |
updateEventDeployment(Long eventId,
WorkflowDeployment deployment)
Associates the given WorkflowEvent id to the given WorkflowDeployment.
|
void |
updateEventSetupStatus(List<Long> eventIds,
int status)
Change the setup status for one or more
WorkflowEvent instances. |
void |
updateEventSetupStatus(List<Long> eventIds,
int status,
SandBoxActionType actionType,
String message) |
public static final String BC_UPDATE_COMPLETE_EVENTS
public static final String BC_UPDATE_RESET_EVENTS_APPROVAL
public static final String BC_UPDATE_EVENT_SETUP_STATUS
public static final String BC_UPDATE_EVENT_SETUP_STATUS_AND_ACTION
public static final String BC_UPDATE_EVENT_DEPLOYMENT
public static final String BC_UPDATE_APPROVAL_STATUS
protected javax.persistence.EntityManager em
@Value(value="${enable.enterprise.status.timing:false}")
protected boolean enableStatusTiming
public WorkflowEvent persist(WorkflowEvent event)
WorkflowEventDaopersist in interface WorkflowEventDaoWorkflowEvent@Transactional public WorkflowEvent readById(Long id)
WorkflowEventDaoreadById in interface WorkflowEventDaopublic List<WorkflowEvent> readByIds(List<Long> ids)
WorkflowEventDaoreadByIds in interface WorkflowEventDaopublic List<WorkflowEvent> readAllForSandBox(Long sandBoxId)
WorkflowEventDaoreadAllForSandBox in interface WorkflowEventDaopublic List<Long> readAllNotDeployedIdsForSandBox(Long sandBoxId)
WorkflowEventDaoreadAllNotDeployedIdsForSandBox in interface WorkflowEventDaopublic List<Long> readAllDeployInProgressIdsForSandBox(Long sandBoxId)
WorkflowEventDaoreadAllDeployInProgressIdsForSandBox in interface WorkflowEventDaopublic List<Long> readAllIdsForSandBox(Long sandBoxId)
WorkflowEventDaoreadAllIdsForSandBox in interface WorkflowEventDaopublic List<Long> readBySandBoxItems(List<Long> sandBoxItemIds)
WorkflowEventDaoWorkflowSandBoxItem idsreadBySandBoxItems in interface WorkflowEventDaopublic List<WorkflowEvent> readEntitiesBySandBoxItems(List<Long> sandBoxItemIds)
WorkflowEventDaoWorkflowSandBoxItem idsreadEntitiesBySandBoxItems in interface WorkflowEventDaopublic int completeEvents(List<Long> sandBoxItemIds)
WorkflowEventDaoWorkflowSandBoxItem ids, find all
associated WorkflowEvent instances that have no un-completed
WorkflowSandBoxItem instances and set those events to completed status.completeEvents in interface WorkflowEventDaopublic int resetEventsForApproval(List<Long> sandBoxItemIds)
WorkflowEventDaoWorkflowSandBoxItem ids, find all
associated WorkflowEvent instances and reset the status
information for an WorkflowEvent that
has already been promoted and is about to be approved.resetEventsForApproval in interface WorkflowEventDaopublic void delete(WorkflowEvent event)
WorkflowEventDaodelete in interface WorkflowEventDaopublic WorkflowEvent refresh(WorkflowEvent event)
WorkflowEventDaorefresh in interface WorkflowEventDaopublic WorkflowDeployment persist(WorkflowDeployment deployment)
WorkflowEventDaopersist in interface WorkflowEventDaopublic void detach(WorkflowDeployment deployment)
WorkflowEventDaodetach in interface WorkflowEventDaopublic WorkflowEvent merge(WorkflowEvent event)
WorkflowEventDaomerge in interface WorkflowEventDaopublic void updateApprovalStatus(Long eventId)
WorkflowEventDaoupdateApprovalStatus in interface WorkflowEventDaopublic void updateEventDeployment(Long eventId, WorkflowDeployment deployment)
WorkflowEventDaoupdateEventDeployment in interface WorkflowEventDaopublic void updateEventSetupStatus(List<Long> eventIds, int status)
WorkflowEventDaoWorkflowEvent instances.updateEventSetupStatus in interface WorkflowEventDaoeventIds - the primary key values for the WorkflowEvent instances to updatestatus - arbitrary status - known values defined in WorkflowEventSetupStatuspublic void updateEventSetupStatus(List<Long> eventIds, int status, SandBoxActionType actionType, String message)
updateEventSetupStatus in interface WorkflowEventDaopublic WorkflowDeployment readDeploymentByJob(Long jobId)
WorkflowEventDaoreadDeploymentByJob in interface WorkflowEventDaopublic List<WorkflowDeployment> readDeploymentsByEvents(List<Long> events)
WorkflowEventDaoreadDeploymentsByEvents in interface WorkflowEventDaopublic List<Long> readEventIdsByDeployment(Long deploymentId)
WorkflowEventDaoWorkflowDeployment, find all
associated WorkflowEvent.getId() values.readEventIdsByDeployment in interface WorkflowEventDaopublic List<WorkflowEvent> readScheduledEventsByAdminUser(org.broadleafcommerce.openadmin.server.security.domain.AdminUser user)
WorkflowEventDaoWorkflowEvents that are scheduled for deployment & are authored by the provided AdminUser.readScheduledEventsByAdminUser in interface WorkflowEventDaopublic WorkflowDeployment readDeploymentById(Long id)
WorkflowEventDaoreadDeploymentById in interface WorkflowEventDaopublic void startDeployment(Long deploymentId)
WorkflowEventDaoStatusTiming#getDateStarted() on WorkflowDeployment. Currently, this requires the
'enable.status.timing' property be set to 'true', as the StatusTiming fields are conditionally
weaved into the domain. Additionally, the 'DATE_STARTED' column must be setup on the BLC_SNDBX_WRKFLW_DEPLOY table.
See StatusTimingImpl for more info on the field.startDeployment in interface WorkflowEventDaopublic void finishDeployment(Long deploymentId)
WorkflowEventDaoStatusTiming#getDateFinished() on WorkflowDeployment. Currently, this requires the
'enable.status.timing' property be set to 'true', as the StatusTiming fields are conditionally
weaved into the domain. Additionally, the 'DATE_FINISHED' column must be setup on the BLC_SNDBX_WRKFLW_DEPLOY table.
See StatusTimingImpl for more info on the field.finishDeployment in interface WorkflowEventDaopublic List<WorkflowDeployment> readAllFutureDeployments()
WorkflowEventDaoreadAllFutureDeployments in interface WorkflowEventDaopublic void removeDeployment(WorkflowDeployment deployment)
WorkflowEventDaoremoveDeployment in interface WorkflowEventDaopublic List<Long> readUnscheduledEventIdsByCriticalAndApprovalStatus(Long sandboxId, boolean isCritical, boolean isApproved)
WorkflowEventDaoWorkflowEvents associated by WorkflowEventImpl.sandBox and
WorkflowEventImpl.isCritical and that are not deployed or scheduled for deploymentreadUnscheduledEventIdsByCriticalAndApprovalStatus in interface WorkflowEventDaopublic List<Long> readUnscheduledEventIdsByApprovalStatus(Long sandboxId, boolean isApproved)
WorkflowEventDaoWorkflowEvents associated by WorkflowEventImpl.sandBox
and that are not deployed or scheduled for deploymentreadUnscheduledEventIdsByApprovalStatus in interface WorkflowEventDaoprotected javax.persistence.criteria.Selection<Long> getIdSelection(javax.persistence.criteria.Root<?> root)
Selection for the id property of the entity.root - protected void addSandboxRestriction(List<javax.persistence.criteria.Predicate> restrictions, javax.persistence.criteria.Root<WorkflowEventImpl> root, javax.persistence.criteria.CriteriaBuilder builder, Long sandboxId)
restrictions - root - builder - sandboxId - protected void addArchivedRestrictions(List<javax.persistence.criteria.Predicate> restrictions, javax.persistence.criteria.Root<WorkflowEventImpl> root, javax.persistence.criteria.CriteriaBuilder builder)
restrictions - root - builder - protected void addUnscheduledDeploymentRestrictions(List<javax.persistence.criteria.Predicate> restrictions, javax.persistence.criteria.Root<WorkflowEventImpl> root, javax.persistence.criteria.CriteriaBuilder builder)
restrictions - root - builder - protected void addActionRestriction(List<javax.persistence.criteria.Predicate> restrictions, javax.persistence.criteria.Root<WorkflowEventImpl> root, javax.persistence.criteria.CriteriaBuilder builder, boolean isApproved)
restrictions - root - builder - isApproved - Copyright © 2019. All rights reserved.