@Service(value="blWorkflowEventService") public class WorkflowEventServiceImpl extends Object implements WorkflowEventService
WorkflowEventService| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.openadmin.server.security.remote.SecurityVerifier |
adminRemoteSecurityService |
protected WorkflowEventDao |
dao |
protected ExecutionLockUtil |
lockUtil |
protected com.broadleafcommerce.jobsevents.dao.ProcessManagementDao |
processDao |
protected org.springframework.context.ApplicationEventPublisher |
publisher |
protected com.broadleafcommerce.jobsevents.dao.DatabaseSystemEventDao |
systemEventDao |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
transUtil |
protected EnterpriseWorkflowLogger |
workflowLogger |
| Constructor and Description |
|---|
WorkflowEventServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
archiveWorkflowEventsBySandBoxId(Long sandBoxId)
Archive all WorkflowEvents associated to the given SandBox
|
void |
cancelDeployment(WorkflowDeployment deployment)
Unschedules the deployment's associated events, deletes the deployment's job and then deletes the deployment itself.
|
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.
|
List<Long> |
findAllDeployingIdsForSandBox(Long sandBoxId)
Finds the ids corresponding to WorkflowEvents that are in the specified sandbox
and are currently deploying.
|
List<WorkflowEvent> |
findAllForSandBox(Long sandBoxId)
Finds all WorkflowEvents that are currently associated with the given sandbox
|
List<WorkflowDeployment> |
findAllFutureDeployments()
Finds a list of WorkflowDeployments that are set to deploy at a future time.
|
List<Long> |
findAllIdsForSandBox(Long sandBoxId)
Finds the ids corresponding to WorkflowEvents that are in the specified sandbox.
|
List<Long> |
findAllNotDeployedIdsForSandBox(Long sandBoxId)
Finds the ids corresponding to WorkflowEvents that are in the specified sandbox
and are not yet deployed.
|
WorkflowEvent |
findById(Long id)
Finds a given WorkflowEvent by its internal id
|
List<WorkflowEvent> |
findByIds(List<Long> ids)
Finds several WorkflowEvents by the given internal ids
|
List<Long> |
findBySandBoxItem(List<Long> sandBoxItemIds)
Finds the WorkflowEvents ids that are associated with the given
WorkflowSandBoxItem ids |
WorkflowDeployment |
findDeploymentById(Long id)
Finds a WorkflowDeployment instance that corresponds to the given id
|
WorkflowDeployment |
findDeploymentByJob(Long jobId)
Finds a WorkflowDeployment instance that corresponds to the given job id
|
List<String> |
findDeploymentIdsForCurrentUser() |
List<WorkflowDeployment> |
findDeploymentsByEvents(List<Long> events)
Finds a list of WorkflowDeployments that are associated to the given list of WorkflowEvent ids.
|
List<WorkflowEvent> |
findEntitiesBySandBoxItem(List<Long> sandBoxItemIds)
Finds the WorkflowEvents that are associated with the given
WorkflowSandBoxItem ids |
com.broadleafcommerce.jobsevents.domain.ScheduledJob |
findJobByJobId(Long jobId)
Finds the scheduled job associated with the deployment
|
void |
finishDeployment(Long deploymentId)
Set the
StatusTiming#getDateFinished() on WorkflowDeployment. |
WorkflowEvent |
logEvent(SandBoxActionType actionType,
String eventName,
String originalMessage,
String eventMessage,
org.broadleafcommerce.openadmin.server.security.domain.AdminUser author,
org.broadleafcommerce.common.sandbox.domain.SandBox sandBox)
Creates a WorkflowEvent that represents the given parameters.
|
List<Long> |
readEventIdsByDeployment(Long deploymentId)
Based on the id value from a
WorkflowDeployment, find all
associated WorkflowEvent.getId() values. |
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> |
readUnscheduledEventIdsByCriticalAndApprovalStatuses(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.
|
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. |
List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> |
retrieveDeploymentStatus(long workflowDeploymentId)
Find any and all ProcessStatus records (active or archived) associated with the
WorkflowDeployment id. |
List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> |
retrieveEventStatus(long workflowEventId)
Find any and all ProcessStatus records (active or archived) associated with the
WorkflowEvent id. |
String |
retryDeployment(Long workflowDeploymentId)
Notify the system to retry deployment on a
WorkflowDeployment id. |
String |
retryPromotion(Long workflowEventId)
Notify the system to retry promotion on a
WorkflowEvent id. |
WorkflowDeployment |
save(WorkflowDeployment deployment)
Saves the given WorkflowDeployment
|
WorkflowEvent |
save(WorkflowEvent event)
Saves the given WorkflowEvent
|
com.broadleafcommerce.jobsevents.domain.ScheduledJob |
saveScheduledJob(com.broadleafcommerce.jobsevents.domain.ScheduledJob job)
Saves the scheduled job
|
void |
startDeployment(Long deploymentId)
Set the
StatusTiming#getDateStarted() on WorkflowDeployment. |
void |
updateApprovalStatus(Long eventId)
Marks the given WorkflowEvent id as approved.
|
void |
updateEventDeployment(List<Long> eventIds,
WorkflowDeployment deployment) |
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. |
protected WorkflowEventDao dao
protected com.broadleafcommerce.jobsevents.dao.DatabaseSystemEventDao systemEventDao
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
protected com.broadleafcommerce.jobsevents.dao.ProcessManagementDao processDao
protected org.broadleafcommerce.openadmin.server.security.remote.SecurityVerifier adminRemoteSecurityService
@Autowired protected org.springframework.context.ApplicationEventPublisher publisher
protected ExecutionLockUtil lockUtil
protected EnterpriseWorkflowLogger workflowLogger
@Transactional(value="blTransactionManager") public WorkflowEvent save(WorkflowEvent event)
WorkflowEventServicesave in interface WorkflowEventServiceWorkflowEvent@Transactional(value="blTransactionManager") public void delete(WorkflowEvent event)
WorkflowEventServicedelete in interface WorkflowEventService@Transactional(value="blTransactionManager") public WorkflowEvent refresh(WorkflowEvent event)
WorkflowEventServicerefresh in interface WorkflowEventServicepublic WorkflowEvent findById(Long id)
WorkflowEventServicefindById in interface WorkflowEventServicepublic List<WorkflowEvent> findByIds(List<Long> ids)
WorkflowEventServicefindByIds in interface WorkflowEventServicepublic List<WorkflowEvent> findAllForSandBox(Long sandBoxId)
WorkflowEventServicefindAllForSandBox in interface WorkflowEventServicepublic List<Long> findAllNotDeployedIdsForSandBox(Long sandBoxId)
WorkflowEventServicefindAllNotDeployedIdsForSandBox in interface WorkflowEventServicepublic List<Long> findAllDeployingIdsForSandBox(Long sandBoxId)
WorkflowEventServicefindAllDeployingIdsForSandBox in interface WorkflowEventServicepublic List<Long> findAllIdsForSandBox(Long sandBoxId)
WorkflowEventServicefindAllIdsForSandBox in interface WorkflowEventService@Transactional(value="blTransactionManager") public WorkflowEvent logEvent(SandBoxActionType actionType, String eventName, String originalMessage, String eventMessage, org.broadleafcommerce.openadmin.server.security.domain.AdminUser author, org.broadleafcommerce.common.sandbox.domain.SandBox sandBox)
WorkflowEventServicelogEvent in interface WorkflowEventServicepublic List<Long> findBySandBoxItem(List<Long> sandBoxItemIds)
WorkflowEventServiceWorkflowSandBoxItem idsfindBySandBoxItem in interface WorkflowEventServicepublic List<WorkflowEvent> findEntitiesBySandBoxItem(List<Long> sandBoxItemIds)
WorkflowEventServiceWorkflowSandBoxItem idsfindEntitiesBySandBoxItem in interface WorkflowEventServicepublic int completeEvents(List<Long> sandBoxItemIds)
WorkflowEventServiceWorkflowSandBoxItem ids, find all
associated WorkflowEvent instances that have no un-completed
WorkflowSandBoxItem instances and set those events to completed status.completeEvents in interface WorkflowEventServicepublic int resetEventsForApproval(List<Long> sandBoxItemIds)
WorkflowEventServiceWorkflowSandBoxItem 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 WorkflowEventService@Transactional(value="blTransactionManager") public WorkflowDeployment save(WorkflowDeployment deployment)
WorkflowEventServicesave in interface WorkflowEventServicepublic void detach(WorkflowDeployment deployment)
WorkflowEventServicedetach in interface WorkflowEventService@Transactional(value="blTransactionManager") public void archiveWorkflowEventsBySandBoxId(Long sandBoxId)
WorkflowEventServicearchiveWorkflowEventsBySandBoxId in interface WorkflowEventService@Transactional(value="blTransactionManager") public void updateApprovalStatus(Long eventId)
WorkflowEventServiceupdateApprovalStatus in interface WorkflowEventService@Transactional(value="blTransactionManager") public void updateEventDeployment(Long eventId, WorkflowDeployment deployment)
WorkflowEventServiceupdateEventDeployment in interface WorkflowEventService@Transactional(value="blTransactionManager") public void updateEventDeployment(List<Long> eventIds, WorkflowDeployment deployment)
updateEventDeployment in interface WorkflowEventService@Transactional(value="blTransactionManager") public void updateEventSetupStatus(List<Long> eventIds, int status)
WorkflowEventServiceWorkflowEvent instances.updateEventSetupStatus in interface WorkflowEventServiceeventIds - the primary key values for the WorkflowEvent instances to updatestatus - arbitrary status - known values defined in WorkflowEventSetupStatuspublic WorkflowDeployment findDeploymentByJob(Long jobId)
WorkflowEventServicefindDeploymentByJob in interface WorkflowEventServicepublic WorkflowDeployment findDeploymentById(Long id)
WorkflowEventServicefindDeploymentById in interface WorkflowEventService@Transactional(value="blTransactionManager") public void startDeployment(Long deploymentId)
WorkflowEventServiceStatusTiming#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 WorkflowEventService@Transactional(value="blTransactionManager") public void finishDeployment(Long deploymentId)
WorkflowEventServiceStatusTiming#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 WorkflowEventServicepublic List<WorkflowDeployment> findDeploymentsByEvents(List<Long> events)
WorkflowEventServicefindDeploymentsByEvents in interface WorkflowEventServicepublic List<Long> readEventIdsByDeployment(Long deploymentId)
WorkflowEventServiceWorkflowDeployment, find all
associated WorkflowEvent.getId() values.readEventIdsByDeployment in interface WorkflowEventServicepublic List<WorkflowDeployment> findAllFutureDeployments()
WorkflowEventServicefindAllFutureDeployments in interface WorkflowEventService@Transactional(value="blTransactionManager") public void cancelDeployment(WorkflowDeployment deployment)
WorkflowEventServicecancelDeployment in interface WorkflowEventServicepublic List<String> findDeploymentIdsForCurrentUser()
findDeploymentIdsForCurrentUser in interface WorkflowEventServicepublic com.broadleafcommerce.jobsevents.domain.ScheduledJob findJobByJobId(Long jobId)
WorkflowEventServicefindJobByJobId in interface WorkflowEventService@Transactional(value="blTransactionManager") public com.broadleafcommerce.jobsevents.domain.ScheduledJob saveScheduledJob(com.broadleafcommerce.jobsevents.domain.ScheduledJob job)
WorkflowEventServicesaveScheduledJob in interface WorkflowEventServicepublic List<Long> readUnscheduledEventIdsByCriticalAndApprovalStatuses(Long sandboxId, boolean isCritical, boolean isApproved)
WorkflowEventServiceWorkflowEvents associated by WorkflowEventImpl.sandBox and
WorkflowEventImpl.isCritical and that are not deployed or scheduled for deploymentreadUnscheduledEventIdsByCriticalAndApprovalStatuses in interface WorkflowEventServicepublic List<Long> readUnscheduledEventIdsByApprovalStatus(Long sandboxId, boolean isApproved)
WorkflowEventServiceWorkflowEvents associated by WorkflowEventImpl.sandBox
and that are not deployed or scheduled for deploymentreadUnscheduledEventIdsByApprovalStatus in interface WorkflowEventService@Transactional(value="blTransactionManager") public String retryPromotion(Long workflowEventId) throws com.broadleafcommerce.enterprise.common.exception.ReplayException
WorkflowEventServiceWorkflowEvent id. Presumably, the requested event
is in a stuck SandBoxActionType.PROGRESS state without and active ProcessStatus. In such a state,
the system is unaware of the in-progress event and the event is not actively being worked on by any node.retryPromotion in interface WorkflowEventServicecom.broadleafcommerce.enterprise.common.exception.ReplayException@Transactional(value="blTransactionManager") public String retryDeployment(Long workflowDeploymentId) throws com.broadleafcommerce.enterprise.common.exception.ReplayException
WorkflowEventServiceWorkflowDeployment id. Presumably, the requested deployment
is in a stuck DeploymentStatusType.IN_PROCESS state without and active ProcessStatus. In such a state,
the system is unaware of the in-progress deployment and the deployment is not actively being worked on by any node.retryDeployment in interface WorkflowEventServicecom.broadleafcommerce.enterprise.common.exception.ReplayExceptionpublic List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> retrieveEventStatus(long workflowEventId)
WorkflowEventServiceWorkflowEvent id.
Internally result quantity is limited to the last 10.retrieveEventStatus in interface WorkflowEventServicepublic List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> retrieveDeploymentStatus(long workflowDeploymentId)
WorkflowEventServiceWorkflowDeployment id.
Internally result quantity is limited to the last 10.retrieveDeploymentStatus in interface WorkflowEventServiceCopyright © 2021. All rights reserved.