Class: MockWorkflowManager
Implements
Constructors
Constructor
new MockWorkflowManager():
MockWorkflowManager
Returns
MockWorkflowManager
Properties
addRecipientCallback
addRecipientCallback: (
callback) =>void
Parameters
callback
RecipientCallback
Returns
void
Implementation of
WorkflowManager.addRecipientCallback
getAllLayoutData
getAllLayoutData: () =>
LayoutState[]
Returns
Implementation of
WorkflowManager.getAllLayoutData
getCommandContext
getCommandContext: () =>
CommandContext
Returns
Implementation of
WorkflowManager.getCommandContext
getMandatoryUnfulfilledSteps
getMandatoryUnfulfilledSteps: () =>
Promise<string[]>
Returns
Promise<string[]>
Implementation of
WorkflowManager.getMandatoryUnfulfilledSteps
getMetadata
getMetadata: (
stepName) =>StepMetadata|undefined
Parameters
stepName
string
Returns
StepMetadata | undefined
Implementation of
getProduct
getProduct: () =>
Product
Returns
getStateHash
getStateHash: () =>
Promise<string>
Returns
Promise<string>
Implementation of
getStepStorage
getStepStorage: (
stepName) =>StepStorage|undefined
Parameters
stepName
string
Returns
StepStorage | undefined
Implementation of
WorkflowManager.getStepStorage
getTemplatingContext
getTemplatingContext: () =>
Promise<{[key:string]:any; }>
Returns the context object used for text templating.
Returns
Promise<{[key: string]: any; }>
Implementation of
WorkflowManager.getTemplatingContext
getUpdatesPending
getUpdatesPending: () =>
boolean
Returns
boolean
Implementation of
WorkflowManager.getUpdatesPending
getWorkflowMetadata
getWorkflowMetadata: () =>
WorkflowMetadata
Returns
Implementation of
WorkflowManager.getWorkflowMetadata
removeRecipientCallback
removeRecipientCallback: (
callback) =>void
Parameters
callback
RecipientCallback
Returns
void
Implementation of
WorkflowManager.removeRecipientCallback
setModelContainer
setModelContainer: (
container) =>void
Parameters
container
any
Returns
void
Implementation of
WorkflowManager.setModelContainer
setWorkflow
setWorkflow: (
workflow) =>Promise<void>
Sets the current workflow for this experience.
Parameters
workflow
The new workflow to set.
Returns
Promise<void>
A promise that resolves when the workflow has been set.
Implementation of
Methods
addConfirmCallback()
addConfirmCallback(
_callback):void
Parameters
_callback
ConfirmCallback
Returns
void
Implementation of
WorkflowManager.addConfirmCallback
addEditedCallback()
addEditedCallback(
_callback):void
Parameters
_callback
EditedCallback
Returns
void
Implementation of
WorkflowManager.addEditedCallback
addElementsCallback()
addElementsCallback(
_callback):void
Parameters
_callback
ElementsCallback
Returns
void
Implementation of
WorkflowManager.addElementsCallback
addInformationResultCallback()
addInformationResultCallback(
_callback):void
Parameters
_callback
InformationResultCallback
Returns
void
Implementation of
WorkflowManager.addInformationResultCallback
addInitCallback()
addInitCallback(
_callback):void
Parameters
_callback
InitCallback
Returns
void
Implementation of
WorkflowManager.addInitCallback
addMakingAdjustmentsCallback()
addMakingAdjustmentsCallback(
_callback):void
Parameters
_callback
MakingAdjustmentsCallback
Returns
void
Implementation of
WorkflowManager.addMakingAdjustmentsCallback
addMandatoryCallback()
addMandatoryCallback(
_callback):void
Parameters
_callback
MandatoryCallback
Returns
void
Implementation of
WorkflowManager.addMandatoryCallback
addMetadataCallback()
addMetadataCallback(
_callback):void
Parameters
_callback
MetadataCallback
Returns
void
Implementation of
WorkflowManager.addMetadataCallback
addPoller()
addPoller(
_poller):void
Parameters
_poller
Poller
Returns
void
Implementation of
addSelectionCallback()
addSelectionCallback(
_callback):void
Parameters
_callback
SelectionCallback
Returns
void
Implementation of
WorkflowManager.addSelectionCallback
addStepSpecificStorageCallback()
addStepSpecificStorageCallback(
_callback,_stepName):void
Parameters
_callback
StepSpecificStorageCallback
_stepName
string
Returns
void
Implementation of
WorkflowManager.addStepSpecificStorageCallback
addStorageCallback()
addStorageCallback(
_callback):void
Parameters
_callback
StorageCallback
Returns
void
Implementation of
WorkflowManager.addStorageCallback
addValidationCallback()
addValidationCallback(
_callback):void
Parameters
_callback
ValidationCallback
Returns
void
Implementation of
WorkflowManager.addValidationCallback
approveTransaction()
approveTransaction(
_note?):Promise<void>
Parameters
_note?
string
Returns
Promise<void>
Implementation of
WorkflowManager.approveTransaction
drawSilentSteps()
drawSilentSteps():
Promise<SilentStepFailure[] |undefined>
Draws every active silent step which has not been drawn yet, each one independently, so one failing step cannot stop the others. A failed step is left undrawn and tried again by the next call.
Returns
Promise<SilentStepFailure[] | undefined>
The steps which could not be drawn, or undefined if updateWorkflowConfiguration was called while
this was running. In that case nothing was changed on the canvas, because the result was for an older
configuration, and the newer call is responsible for drawing the steps.
Implementation of
WorkflowManager.drawSilentSteps
ejectFromPreviewService()
ejectFromPreviewService():
void
Ejects the model of this product from the preview service. This also sets the internal preview service to undefined.
Returns
void
Implementation of
WorkflowManager.ejectFromPreviewService
getClient()
getClient():
SpiffCommerceClient
Returns the client that was responsible for spawning this manager.
Returns
Implementation of
getCommandDispatcher()
getCommandDispatcher(): (
_command) =>void
Returns
(_command) => void
Implementation of
WorkflowManager.getCommandDispatcher
getInformationResults()
getInformationResults():
InformationResult[]
Returns
Implementation of
WorkflowManager.getInformationResults
getInitializationPromise()
getInitializationPromise():
Promise<void>
A promise resolving when the initial state of the workflow has completed loading.
Returns
Promise<void>
Implementation of
WorkflowManager.getInitializationPromise
getInitialOptionIds()
getInitialOptionIds():
Promise<Set<string>>
Returns a set of strings representing the identifiers of the minimal set of options required to satisfy the default initial loaded state of the workflow.
Returns
Promise<Set<string>>
Implementation of
WorkflowManager.getInitialOptionIds
getLayoutPreviewService()
getLayoutPreviewService():
any
Returns
any
Implementation of
WorkflowManager.getLayoutPreviewService
getLayouts()
getLayouts():
never[]
Returns
never[]
Implementation of
getModelContainer()
getModelContainer():
undefined
Returns
undefined
Implementation of
WorkflowManager.getModelContainer
getModelSlotsForAttachments()
getModelSlotsForAttachments():
Promise<undefined>
The attachment points of a model, when another model step is attached to a slot on it. Resolves to undefined when nothing is, so models nothing is attached to never cost a request.
Returns
Promise<undefined>
Implementation of
WorkflowManager.getModelSlotsForAttachments
getPreviewService()
getPreviewService():
undefined
Returns
undefined
Implementation of
WorkflowManager.getPreviewService
getRegionElements()
getRegionElements(
_stepName):never[]
Parameters
_stepName
string
Returns
never[]
Implementation of
WorkflowManager.getRegionElements
getSerializedStep()
getSerializedStep(
_stepName,_serializedSteps):undefined
Parameters
_stepName
string
_serializedSteps
SerializableStep[]
Returns
undefined
Implementation of
WorkflowManager.getSerializedStep
getStepErrors()
getStepErrors(
_stepName):undefined
Gets any validation errors for a specific step, or undefined if there are none.
Parameters
_stepName
string
Returns
undefined
Implementation of
getStepSelections()
getStepSelections():
object
Returns
object
Implementation of
WorkflowManager.getStepSelections
getStepSpecificServices()
getStepSpecificServices(
_stepName):undefined
Parameters
_stepName
string
Returns
undefined
Implementation of
WorkflowManager.getStepSpecificServices
getStepTags()
getStepTags(
_stepId):string[]
Returns the tags for a step.
Parameters
_stepId
string
Returns
string[]
Implementation of
getTransaction()
getTransaction():
object
Returns
object
id
id:
string=""
getTransactionCustomer()
getTransactionCustomer():
undefined
Returns
undefined
Implementation of
WorkflowManager.getTransactionCustomer
getValidationErrors()
getValidationErrors():
object
Gets validation errors for all steps. Only steps with errors will be present.
Returns
object
steps
steps:
Map<any,any>
Implementation of
WorkflowManager.getValidationErrors
getWorkflow()
getWorkflow():
object
Returns
object
allowProofDownload
allowProofDownload:
boolean=false
id
id:
string=""
introduction
introduction:
string=""
name
name:
string=""
panels
panels:
never[] =[]
showModelOnFinishStep
showModelOnFinishStep:
boolean=false
stepGroups
stepGroups:
never[] =[]
steps
steps:
never[] =[]
getWorkflowExperience()
getWorkflowExperience():
WorkflowExperience
Returns the workflow experience that was responsible for creating this manager.
Returns
Implementation of
WorkflowManager.getWorkflowExperience
getWorkflowSelections()
getWorkflowSelections():
object
Returns
object
Implementation of
WorkflowManager.getWorkflowSelections
injectIntoPreviewService()
injectIntoPreviewService(
_previewService):Promise<void>
Injects the model of this product into the preview service. This also overwrites the internal preview service.
Parameters
_previewService
any
Returns
Promise<void>
Implementation of
WorkflowManager.injectIntoPreviewService
isInitialized()
isInitialized():
boolean
Returns true when the initial state of the workflow has been loaded and settled.
Returns
boolean
Implementation of
markStepsAsInitialised()
markStepsAsInitialised(
_stepNames):void
Parameters
_stepNames
string[]
Returns
void
Implementation of
WorkflowManager.markStepsAsInitialised
markUpdateCompleted()
markUpdateCompleted(
_update):void
Parameters
_update
string
Returns
void
Implementation of
WorkflowManager.markUpdateCompleted
markUpdatePending()
markUpdatePending():
string
Returns
string
Implementation of
WorkflowManager.markUpdatePending
outstandingRequestsPromise()
outstandingRequestsPromise():
Promise<void>
Returns
Promise<void>
Implementation of
WorkflowManager.outstandingRequestsPromise
rejectTransaction()
rejectTransaction(
_note?):Promise<void>
Parameters
_note?
string
Returns
Promise<void>
Implementation of
WorkflowManager.rejectTransaction
reset()
reset():
Promise<void>
Returns
Promise<void>
Implementation of
setClient()
setClient(
client):void
Parameters
client
Returns
void
setCurrentAdjustingStepId()
setCurrentAdjustingStepId(
_stepId):void
Parameters
_stepId
string
Returns
void
Implementation of
WorkflowManager.setCurrentAdjustingStepId
setEditedStatus()
setEditedStatus(
_stepName,_status):void
Parameters
_stepName
string
_status
boolean
Returns
void
Implementation of
WorkflowManager.setEditedStatus
setInformationResults()
setInformationResults(
_results):void
Parameters
_results
Returns
void
Implementation of
WorkflowManager.setInformationResults
setMandatoryFulfilled()
setMandatoryFulfilled(
_stepName,_status):void
Parameters
_stepName
string
_status
boolean
Returns
void
Implementation of
WorkflowManager.setMandatoryFulfilled
setSelectionsAndElements()
setSelectionsAndElements(
_stepName,_variants,_elements):Promise<void>
Parameters
_stepName
string
_variants
_elements
Returns
Promise<void>
Implementation of
WorkflowManager.setSelectionsAndElements
setStepError()
setStepError(
_stepName,_field,_error):void
Parameters
_stepName
string
_field
string
_error
string | undefined
Returns
void
Implementation of
setTransactionCustomer()
setTransactionCustomer():
void
Returns
void
Implementation of
WorkflowManager.setTransactionCustomer
setTransactionCustomerDetails()
setTransactionCustomerDetails():
void
Returns
void
Deprecated
Use setTransactionCustomer instead.
Implementation of
WorkflowManager.setTransactionCustomerDetails
setWorkflowStateSyncEnabled()
setWorkflowStateSyncEnabled(
_enabled):void
Enables or disables uploading of workflow state to the server.
Parameters
_enabled
boolean
Returns
void
Implementation of
WorkflowManager.setWorkflowStateSyncEnabled
toggleDesignConfirmed()
toggleDesignConfirmed():
void
Returns
void
Implementation of
WorkflowManager.toggleDesignConfirmed
traversableScenes()
traversableScenes():
Promise<WorkflowScene[]>
Returns
Promise<WorkflowScene[]>
Implementation of
WorkflowManager.traversableScenes
updateMetadata()
updateMetadata(
_stepName,_update):void
Parameters
_stepName
string
_update
any
Returns
void
Implementation of
WorkflowManager.updateMetadata
updateRecipient()
updateRecipient(
_firstName?,_lastName?,_address?,_suburb?,_state?,_email?,_postalCode?,_country?,_mobile?,_company?,_apartment?,_customField1?,_customField2?,_customField3?,_customField4?,_customField5?,_conversionConfigurationId?):Promise<void>
Create or amend the recipient fo the transaction.
Parameters
_firstName?
string
_lastName?
string
_address?
string
_suburb?
string
_state?
string
_email?
string
_postalCode?
string
_country?
string
_mobile?
string
_company?
string
_apartment?
string
_customField1?
string
_customField2?
string
_customField3?
string
_customField4?
string
_customField5?
string
_conversionConfigurationId?
string
Returns
Promise<void>
Implementation of
WorkflowManager.updateRecipient
updateStateWithServer()
updateStateWithServer(
_getReducerState):void
Parameters
_getReducerState
() => CommandState
Returns
void
updateStateWithServerImmediate()
updateStateWithServerImmediate(
_getReducerState):Promise<void>
Parameters
_getReducerState
() => CommandState
Returns
Promise<void>
Deprecated
State updates are being pulled internally. This function will be removed in the future.
Implementation of
WorkflowManager.updateStateWithServerImmediate
updateStorage()
updateStorage(
_stepName,_update):Promise<void>
Parameters
_stepName
string
_update
Returns
Promise<void>
Implementation of
updateTransactionShareActions()
updateTransactionShareActions():
Promise<void>
Re-fetches the transactionShareActions for this WorkflowManager's Transaction object.
The updated transactionShareActions overwrite the existing values on the Transaction object returned by getTransaction().
Returns
Promise<void>
Implementation of
WorkflowManager.updateTransactionShareActions
updateTransactionStakeholders()
updateTransactionStakeholders():
Promise<void>
Re-fetches the stakeholders and currentStakeholder for this WorkflowManager's Transaction object.
The updated stakeholders and currentStakeholder overwrite the existing values on the Transaction object returned by getTransaction().
Returns
Promise<void>
Implementation of
WorkflowManager.updateTransactionStakeholders
updateWorkflowConfiguration()
updateWorkflowConfiguration(
_changes):Promise<void>
Updates the workflow configuration and regenerates affected internal structures. Handles panel changes, step changes, and scene reorganization while preserving user state where possible.
Silent steps (Product Overlay, Silent Illustration) which were changed or added are NOT drawn here, so a slow
image can never hold up the update. Call drawSilentSteps afterwards. Calling this also cancels any silent step
draw that is still running, because it was started for an older configuration.
Parameters
_changes
any
Returns
Promise<void>