@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
WorkflowEvent s associated by WorkflowEventImpl.sandBox
and that are not deployed or scheduled for deployment |
List<Long> |
readUnscheduledEventIdsByCriticalAndApprovalStatuses(Long sandboxId,
boolean isCritical,
boolean isApproved)
Finds all
WorkflowEvent s 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)
WorkflowEventService
save
in interface WorkflowEventService
WorkflowEvent
@Transactional(value="blTransactionManager") public void delete(WorkflowEvent event)
WorkflowEventService
delete
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public WorkflowEvent refresh(WorkflowEvent event)
WorkflowEventService
refresh
in interface WorkflowEventService
public WorkflowEvent findById(Long id)
WorkflowEventService
findById
in interface WorkflowEventService
public List<WorkflowEvent> findByIds(List<Long> ids)
WorkflowEventService
findByIds
in interface WorkflowEventService
public List<WorkflowEvent> findAllForSandBox(Long sandBoxId)
WorkflowEventService
findAllForSandBox
in interface WorkflowEventService
public List<Long> findAllNotDeployedIdsForSandBox(Long sandBoxId)
WorkflowEventService
findAllNotDeployedIdsForSandBox
in interface WorkflowEventService
public List<Long> findAllDeployingIdsForSandBox(Long sandBoxId)
WorkflowEventService
findAllDeployingIdsForSandBox
in interface WorkflowEventService
public List<Long> findAllIdsForSandBox(Long sandBoxId)
WorkflowEventService
findAllIdsForSandBox
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)
WorkflowEventService
logEvent
in interface WorkflowEventService
public List<Long> findBySandBoxItem(List<Long> sandBoxItemIds)
WorkflowEventService
WorkflowSandBoxItem
idsfindBySandBoxItem
in interface WorkflowEventService
public List<WorkflowEvent> findEntitiesBySandBoxItem(List<Long> sandBoxItemIds)
WorkflowEventService
WorkflowSandBoxItem
idsfindEntitiesBySandBoxItem
in interface WorkflowEventService
public int completeEvents(List<Long> sandBoxItemIds)
WorkflowEventService
WorkflowSandBoxItem
ids, find all
associated WorkflowEvent
instances that have no un-completed
WorkflowSandBoxItem instances and set those events to completed status.completeEvents
in interface WorkflowEventService
public int resetEventsForApproval(List<Long> sandBoxItemIds)
WorkflowEventService
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.resetEventsForApproval
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public WorkflowDeployment save(WorkflowDeployment deployment)
WorkflowEventService
save
in interface WorkflowEventService
public void detach(WorkflowDeployment deployment)
WorkflowEventService
detach
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public void archiveWorkflowEventsBySandBoxId(Long sandBoxId)
WorkflowEventService
archiveWorkflowEventsBySandBoxId
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public void updateApprovalStatus(Long eventId)
WorkflowEventService
updateApprovalStatus
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public void updateEventDeployment(Long eventId, WorkflowDeployment deployment)
WorkflowEventService
updateEventDeployment
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)
WorkflowEventService
WorkflowEvent
instances.updateEventSetupStatus
in interface WorkflowEventService
eventIds
- the primary key values for the WorkflowEvent instances to updatestatus
- arbitrary status - known values defined in WorkflowEventSetupStatus
public WorkflowDeployment findDeploymentByJob(Long jobId)
WorkflowEventService
findDeploymentByJob
in interface WorkflowEventService
public WorkflowDeployment findDeploymentById(Long id)
WorkflowEventService
findDeploymentById
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public void startDeployment(Long deploymentId)
WorkflowEventService
StatusTiming#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)
WorkflowEventService
StatusTiming#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 WorkflowEventService
public List<WorkflowDeployment> findDeploymentsByEvents(List<Long> events)
WorkflowEventService
findDeploymentsByEvents
in interface WorkflowEventService
public List<Long> readEventIdsByDeployment(Long deploymentId)
WorkflowEventService
WorkflowDeployment
, find all
associated WorkflowEvent.getId()
values.readEventIdsByDeployment
in interface WorkflowEventService
public List<WorkflowDeployment> findAllFutureDeployments()
WorkflowEventService
findAllFutureDeployments
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public void cancelDeployment(WorkflowDeployment deployment)
WorkflowEventService
cancelDeployment
in interface WorkflowEventService
public List<String> findDeploymentIdsForCurrentUser()
findDeploymentIdsForCurrentUser
in interface WorkflowEventService
public com.broadleafcommerce.jobsevents.domain.ScheduledJob findJobByJobId(Long jobId)
WorkflowEventService
findJobByJobId
in interface WorkflowEventService
@Transactional(value="blTransactionManager") public com.broadleafcommerce.jobsevents.domain.ScheduledJob saveScheduledJob(com.broadleafcommerce.jobsevents.domain.ScheduledJob job)
WorkflowEventService
saveScheduledJob
in interface WorkflowEventService
public List<Long> readUnscheduledEventIdsByCriticalAndApprovalStatuses(Long sandboxId, boolean isCritical, boolean isApproved)
WorkflowEventService
WorkflowEvent
s associated by WorkflowEventImpl.sandBox
and
WorkflowEventImpl.isCritical
and that are not deployed or scheduled for deploymentreadUnscheduledEventIdsByCriticalAndApprovalStatuses
in interface WorkflowEventService
public List<Long> readUnscheduledEventIdsByApprovalStatus(Long sandboxId, boolean isApproved)
WorkflowEventService
WorkflowEvent
s 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
WorkflowEventService
WorkflowEvent
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 WorkflowEventService
com.broadleafcommerce.enterprise.common.exception.ReplayException
@Transactional(value="blTransactionManager") public String retryDeployment(Long workflowDeploymentId) throws com.broadleafcommerce.enterprise.common.exception.ReplayException
WorkflowEventService
WorkflowDeployment
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 WorkflowEventService
com.broadleafcommerce.enterprise.common.exception.ReplayException
public List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> retrieveEventStatus(long workflowEventId)
WorkflowEventService
WorkflowEvent
id.
Internally result quantity is limited to the last 10.retrieveEventStatus
in interface WorkflowEventService
public List<com.broadleafcommerce.jobsevents.domain.ProcessStatus> retrieveDeploymentStatus(long workflowDeploymentId)
WorkflowEventService
WorkflowDeployment
id.
Internally result quantity is limited to the last 10.retrieveDeploymentStatus
in interface WorkflowEventService
Copyright © 2021. All rights reserved.