Class SimpleStateManagerImpl
java.lang.Object
com.broadleafcommerce.enterprise.workflow.admin.service.behavior.simple.SimpleStateManagerImpl
- All Implemented Interfaces:
SimpleStateManager
@Service("blSimpleStateManager")
public class SimpleStateManagerImpl
extends Object
implements SimpleStateManager
- Author:
- Jeff Fischer
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.broadleafcommerce.enterprise.workflow.admin.service.behavior.simple.SimpleStateManager
SimpleStateManager.DetailGroup, SimpleStateManager.EventGroup -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.openadmin.server.service.AdminEntityServiceprotected org.broadleafcommerce.core.catalog.service.CatalogServiceprotected SimpleChangeDetailDaoprotected SimpleChangeOverrideDaoprotected SimpleCloneDaoprotected SimpleCloneDaoprotected SimpleTransitionDaoprotected org.broadleafcommerce.common.util.dao.DynamicDaoHelperprotected jakarta.persistence.EntityManagerprotected com.broadleafcommerce.enterprise.common.extension.enterprise.WorkflowSandBoxItemServiceExtensionManagerprotected SimpleInitializationDaoprotected static final org.apache.commons.logging.Logprotected booleanprotected SimpleTableMetadataDaoprotected SimplePropagationDaoprotected WorkflowSandBoxItemServiceprotected SimpleTableMetadataDaoprotected SimpleSystemEventServiceprotected SimpleWorkflowDao -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyFKUpdates(List<List<SimplePropagationDao.LineMember>> catalogLines, List<List<SimplePropagationDao.LineMember>> profileLines, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable) protected Map<String,SimpleCloneDao.ExistingClones> applyPropagation(SimpleDeployConfiguration deployConfiguration, List<List<SimplePropagationDao.LineMember>> catalogLines, List<List<SimplePropagationDao.LineMember>> catalogLinesWithSiteCustomizable, List<List<SimplePropagationDao.LineMember>> profileLines, List<List<SimplePropagationDao.LineMember>> profileLinesWithSiteCustomizable, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, boolean includeEmptyDetails) protected voidapplySiteSandboxPropagation(SimpleDeployConfiguration deployConfiguration, List<List<SimplePropagationDao.LineMember>> catalogLines, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, Map<String, Map<Long, Map<Long, ChangeDetail>>> detailByCatalogByTargetIdByTable) protected SimpleCloneDao.CreateSandboxRequestbuildInitializeApprovalStateSandboxRequest(Map.Entry<String, List<Object[]>> changeByTable) protected voidcreateAuditWorkflowItem(SimpleDeployConfiguration deployConfiguration) protected voidcreateInvalidationInfoIfNecessary(Map<String, List<SimpleSystemEventService.InvalidationInfo>> invalidationInfoMap, Map<Long, List<SimpleSystemEventService.InvalidationInfo>> infoByOriginalId, Map.Entry<String, List<ChangeDetail>> entry, ChangeDetail detail, SimplePropagationDao.LineMember member, SimplePropagationDao.LineMember rootLine) Perform a sandbox deployment operation for a list of ids in batch.protected Longprotected Map<String,List<ChangeDetail>> protected List<ChangeDetail>getChangeDetailsById(List<Long> oldDetailsIds, List<ChangeDetail> details) protected SimpleCloneDao.CloneStategetCloneStateForDetail(Map<String, Map<Long, SimpleCloneDao.CloneState>> cloneIdsByTable, ChangeDetail changeDetail) protected FieldgetDeclaredField(String[] parts, Class javaType) protected SimpleDeployConfigurationgetDeployConfig(List<Long> workflowIds) protected SimpleInitializeApprovalConfigurationprotected SimplePromoteConfigurationgetPromoteConfig(List<Long> workflowIds, Long targetSandBox) protected SimpleRejectConfigurationgetRejectConfig(List<Long> workflowIds) protected SimpleRevertConfigurationgetRevertConfig(List<Long> workflowIds) protected booleanprotected voididentifyWorkflowItemsToIgnore(AtomicReference<SimplePromoteConfiguration> config, SimplePromoteConfiguration pc, List<ChangeDetail> details, Map<String, Map<Long, SimpleCloneDao.CloneState>> cloneIdsByTable, Set<Long> workflowIdToIgnore) voidEstablish a completely realized approval sandbox state for a batch of changesprotected voidinvalidateCacheForDeploy(SimpleDeployConfiguration deployConfiguration, Map<String, List<ChangeDetail>> detailsByTable) protected voidinvalidateCacheForPropagation(SimpleDeployConfiguration deployConfiguration, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, List<List<SimplePropagationDao.LineMember>> catalogLinesWithSiteCustomizable, List<List<SimplePropagationDao.LineMember>> profileLinesWithSiteCustomizable) protected voidinvalidateCacheForTransition(Map<String, List<ChangeDetail>> detailsByTable, Map<Long, Long> targetSandBoxByDetail) protected voidpopulateOverriddenProperties(Map<String, List<ChangeDetail>> detailsByTable) promote(List<Long> workflowIds, Long targetSandBox, Long eventId, String message, boolean isCritical) Perform a sandbox promote operation for a list of ids in a batch.voidpropagate(SimpleDeployConfiguration deployConfiguration) Follwing a deploy, perform a propagation of the same ChangeDetails across profile and catalog inheritance lines.Perform a sandbox reject operation for a list of ids in a batch.Perform a sandbox revert operation for a list of ids in a batch.
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
dao
-
initializationDao
-
changeDetailDao
-
workflowDao
-
cloneManager
-
service
-
systemEventService
-
propagationDao
-
changeOverrideDao
-
cloneDao
-
simpleTableMetadataDao
-
adminEntityService
protected org.broadleafcommerce.openadmin.server.service.AdminEntityService adminEntityService -
em
protected jakarta.persistence.EntityManager em -
metadataDao
-
catalogService
protected org.broadleafcommerce.core.catalog.service.CatalogService catalogService -
extensionManager
protected com.broadleafcommerce.enterprise.common.extension.enterprise.WorkflowSandBoxItemServiceExtensionManager extensionManager -
mergeChangeSetsOnPromote
@Value("${strategy.simple.merge.on.promote:true}") protected boolean mergeChangeSetsOnPromote -
dynamicDaoHelper
protected org.broadleafcommerce.common.util.dao.DynamicDaoHelper dynamicDaoHelper
-
-
Constructor Details
-
SimpleStateManagerImpl
public SimpleStateManagerImpl()
-
-
Method Details
-
initializeApprovalState
Description copied from interface:SimpleStateManagerEstablish a completely realized approval sandbox state for a batch of changes- Specified by:
initializeApprovalStatein interfaceSimpleStateManager- Parameters:
events- The list of changes grouped by approval state (seeSimpleStateManager.EventGroup).
-
getChangeDetailDtoByTable
protected Map<String,List<ChangeDetail>> getChangeDetailDtoByTable(SimpleInitializeApprovalConfiguration iac) -
deploy
Description copied from interface:SimpleStateManagerPerform a sandbox deployment operation for a list of ids in batch.- Specified by:
deployin interfaceSimpleStateManager- Parameters:
workflowIds- TheWorkflowSandBoxItemImplinstance ids to deploy- Throws:
SimpleDeployReplayException
-
propagate
public void propagate(SimpleDeployConfiguration deployConfiguration) throws SimpleDeployReplayException Description copied from interface:SimpleStateManagerFollwing a deploy, perform a propagation of the same ChangeDetails across profile and catalog inheritance lines.- Specified by:
propagatein interfaceSimpleStateManager- Parameters:
deployConfiguration- The config containing ChangeDetail and workflow information for the deploy- Throws:
SimpleDeployReplayException
-
createAuditWorkflowItem
-
populateOverriddenProperties
protected void populateOverriddenProperties(Map<String, List<ChangeDetail>> detailsByTable) throws ClassNotFoundException, NoSuchFieldException -
getDeclaredField
-
promote
public SimplePromoteConfiguration promote(List<Long> workflowIds, Long targetSandBox, Long eventId, String message, boolean isCritical) throws SimplePromoteReplayException Description copied from interface:SimpleStateManagerPerform a sandbox promote operation for a list of ids in a batch.- Specified by:
promotein interfaceSimpleStateManager- Parameters:
workflowIds- TheWorkflowSandBoxItemImplinstance ids to promotetargetSandBox- The approval sandbox to promote intoeventId- The id of theWorkflowEventImplrepresenting the grouping of the promoted itemsmessage- An optional message to include to identify the purpose of the promotionisCritical- Whether or not the changes are considered critical.- Throws:
SimplePromoteReplayException
-
identifyWorkflowItemsToIgnore
protected void identifyWorkflowItemsToIgnore(AtomicReference<SimplePromoteConfiguration> config, SimplePromoteConfiguration pc, List<ChangeDetail> details, Map<String, Map<Long, SimpleCloneDao.CloneState>> cloneIdsByTable, Set<Long> workflowIdToIgnore) - Parameters:
config- atomic reference to SimplePromoteConfigurationpc- SimplePromoteConfiguration instance containing changesByItemdetails- all change details to identify corresponding workflow itemscloneIdsByTable- - cloneIds by table mapworkflowIdToIgnore- - collection that will be filled if found workflow items that don't need to be created
-
getChangeDetailsById
protected List<ChangeDetail> getChangeDetailsById(List<Long> oldDetailsIds, List<ChangeDetail> details) -
findWorkflowItemIdForChangeDetail
-
getCloneStateForDetail
protected SimpleCloneDao.CloneState getCloneStateForDetail(Map<String, Map<Long, SimpleCloneDao.CloneState>> cloneIdsByTable, ChangeDetail changeDetail) -
revert
Description copied from interface:SimpleStateManagerPerform a sandbox revert operation for a list of ids in a batch.- Specified by:
revertin interfaceSimpleStateManager- Parameters:
workflowIds- TheWorkflowSandBoxItemImplinstance ids to revert- Throws:
SimpleRevertReplayException
-
reject
public SimpleRejectConfiguration reject(List<Long> workflowIds, String msg) throws SimpleRejectReplayException Description copied from interface:SimpleStateManagerPerform a sandbox reject operation for a list of ids in a batch.- Specified by:
rejectin interfaceSimpleStateManager- Parameters:
workflowIds- TheWorkflowSandBoxItemImplinstance ids to rejectmsg- The message that communicates the reason for the rejection- Throws:
SimpleRejectReplayException
-
invalidateCacheForDeploy
protected void invalidateCacheForDeploy(SimpleDeployConfiguration deployConfiguration, Map<String, List<ChangeDetail>> detailsByTable) -
invalidateCacheForTransition
-
invalidateCacheForPropagation
protected void invalidateCacheForPropagation(SimpleDeployConfiguration deployConfiguration, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, List<List<SimplePropagationDao.LineMember>> catalogLinesWithSiteCustomizable, List<List<SimplePropagationDao.LineMember>> profileLinesWithSiteCustomizable) -
createInvalidationInfoIfNecessary
protected void createInvalidationInfoIfNecessary(Map<String, List<SimpleSystemEventService.InvalidationInfo>> invalidationInfoMap, Map<Long, List<SimpleSystemEventService.InvalidationInfo>> infoByOriginalId, Map.Entry<String, List<ChangeDetail>> entry, ChangeDetail detail, SimplePropagationDao.LineMember member, SimplePropagationDao.LineMember rootLine) -
hasChangesInChangeDetail
-
applySiteSandboxPropagation
protected void applySiteSandboxPropagation(SimpleDeployConfiguration deployConfiguration, List<List<SimplePropagationDao.LineMember>> catalogLines, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, Map<String, Map<Long, Map<Long, ChangeDetail>>> detailByCatalogByTargetIdByTable) -
applyFKUpdates
protected Map<String,Map<Long, applyFKUpdatesMap<Long, ChangeDetail>>> (List<List<SimplePropagationDao.LineMember>> catalogLines, List<List<SimplePropagationDao.LineMember>> profileLines, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable) -
applyPropagation
protected Map<String,SimpleCloneDao.ExistingClones> applyPropagation(SimpleDeployConfiguration deployConfiguration, List<List<SimplePropagationDao.LineMember>> catalogLines, List<List<SimplePropagationDao.LineMember>> catalogLinesWithSiteCustomizable, List<List<SimplePropagationDao.LineMember>> profileLines, List<List<SimplePropagationDao.LineMember>> profileLinesWithSiteCustomizable, Map<String, List<ChangeDetail>> detailsByTable, Map<String, SimplePropagationDao.ApplyResults> applyResultsByTable, boolean includeEmptyDetails) -
buildInitializeApprovalStateSandboxRequest
protected SimpleCloneDao.CreateSandboxRequest buildInitializeApprovalStateSandboxRequest(Map.Entry<String, List<Object[]>> changeByTable) -
getPromoteConfig
@Lookup("blSimplePromoteConfiguration") protected SimplePromoteConfiguration getPromoteConfig(List<Long> workflowIds, Long targetSandBox) -
getDeployConfig
@Lookup("blSimpleDeployConfiguration") protected SimpleDeployConfiguration getDeployConfig(List<Long> workflowIds) -
getRejectConfig
@Lookup("blSimpleRejectConfiguration") protected SimpleRejectConfiguration getRejectConfig(List<Long> workflowIds) -
getRevertConfig
@Lookup("blSimpleRevertConfiguration") protected SimpleRevertConfiguration getRevertConfig(List<Long> workflowIds) -
getInitApprovalConfig
@Lookup("blSimpleInitializeApprovalConfiguration") protected SimpleInitializeApprovalConfiguration getInitApprovalConfig(List<SimpleStateManager.EventGroup> events)
-