Class WorkflowServiceImpl
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.workflow.impl.WorkflowServiceImpl
- All Implemented Interfaces:
IndexProducer,JobProducer,WorkflowService
public class WorkflowServiceImpl
extends AbstractIndexProducer
implements WorkflowService, JobProducer
Implements WorkflowService with in-memory data structures to hold WorkflowOperations and WorkflowInstances.
WorkflowOperationHandlers are looked up in the OSGi service registry based on the "workflow.operation" property. If
the WorkflowOperationHandler's "workflow.operation" service registration property matches
WorkflowOperation.getName(), then the factory returns a WorkflowOperationRunner to handle that operation. This allows
for custom runners to be added or modified without affecting the workflow service itself.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA tuple of a workflow operation handler and the name of the operation it handles -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetManagerThe asset managerprotected AuthorizationServiceThe authorization serviceprotected org.osgi.service.component.ComponentContextRemove references to the component context once felix scr 1.2 becomes availablestatic final StringError resolution handler id constantprotected ThreadPoolExecutorThe thread pool to use for firing listeners and handling dispatched jobsprotected OrganizationDirectoryServiceThe organization directory serviceprotected WorkflowServiceDatabasePersistent storageprotected SecurityServiceThe security serviceprotected SeriesServiceThe series serviceprotected ServiceRegistryThe service registryprotected UserDirectoryServiceThe user directory serviceprotected WorkspaceThe workspaceFields inherited from interface org.opencastproject.workflow.api.WorkflowService
JOB_TYPE, WORKFLOW_OPERATION_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new workflow service impl, with a priority-sorted map of metadata services -
Method Summary
Modifier and TypeMethodDescriptionvoidAsks the job producer to handle the given job using the provided operation and list of arguments.voidactivate(org.osgi.service.component.ComponentContext componentContext) Activate this service implementation via the OSGI service component runtime.protected voidCallback to set the metadata serviceprotected voidCallback to set the workflow definition scannervoidaddWorkflowListener(WorkflowListener listener) Adds a workflow listener to be notified when workflows are updated.protected booleanassertMediaPackagePermission(String mediaPackageId, String action) protected voidassertPermission(WorkflowInstance workflow, String action, String workflowOrgId) Asserts that the current user has permission to take the provided action on a workflow instance.voidcleanupWorkflowInstances(int buffer, WorkflowInstance.WorkflowState state) Starts a cleanup of workflow instances with a given lifetime and a specific statelongcountJobs(Job.Status status) Get the number of jobs in a current status on all nodes.longGets the total number of workflows that have been created to date.longGets the total number of workflows that have been created to date and that match the workflow state which might benull.protected voidfireListeners(WorkflowInstance oldWorkflowInstance, WorkflowInstance newWorkflowInstance) Fires the workflow listeners on workflow updates.The type of jobs that this producer creates.Gets the currently registered workflow operation handlers.getRunningWorkflowInstanceByMediaPackage(String mediaPackageId, String action) Returns theWorkflowInstancecurrently running on the given mediaPackageGet the service that implements IndexProducer.getWorkflowById(long id) Gets aWorkflowInstanceby its ID.Returns theWorkflowDefinitionidentified byname.getWorkflowInstancesByMediaPackage(String mediaPackageId) Returns all workflows associated with the given mediapackage Current user needs permission to the mediapackageprotected WorkflowOperationHandlergetWorkflowOperationHandler(String operationId) protected WorkflowInstancehandleOperationException(WorkflowInstance workflow, WorkflowOperationInstance currentOperation) Callback for workflow operations that were throwing an exception.protected WorkflowInstancehandleOperationResult(WorkflowInstance workflow, WorkflowOperationResult result) Callback for workflow operation handlers that executed and finished without exception.booleanisReadyToAccept(Job job) Whether the job can be accepted.booleanisReadyToAcceptJobs(String operation) Whether new jobs can be accepted in general.booleanisRunnable(WorkflowDefinition workflowDefinition) Lists the names of each workflow operation.Gets the list of available workflow definitions.booleanmediaPackageHasActiveWorkflows(String mediaPackageId) Checks if there is at least one workflow currently running on the given mediapackageprotected voidReads the available metadata from the dublin core catalog (if there is one) and updates the mediapackage.protected StringProcesses the workflow job.voidremove(long workflowInstanceId) Permanently removes a workflow instance.voidremove(long workflowInstanceId, boolean force) Permanently removes a workflow instance.protected voidCallback to remove a mediapackage metadata service.voidremoveWorkflowListener(WorkflowListener listener) Removes a workflow listener.voidRe-add the data of this service to the index.resume(long id) Resumes a suspended workflow instance.Resumes a suspended workflow instance, applying new properties to the workflow.protected JobrunWorkflow(WorkflowInstance workflow) Executes the workflow.protected WorkflowOperationInstancerunWorkflowOperation(WorkflowInstance workflow, Map<String, String> properties) Executes the workflow's current operation.protected WorkflowOperationHandlerselectOperationHandler(WorkflowOperationInstance operation) Does a lookup of available operation handlers for the given workflow operation.voidsetAssetManager(AssetManager assetManager) Sets the asset managervoidsetAuthorizationService(AuthorizationService authorizationService) Callback for setting the authorization service.voidsetIndex(ElasticsearchIndex index) Callback to set the Admin UI index.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetPersistence(WorkflowServiceDatabase persistence) Callback to set the workflow databaseprotected voidDummy callback for osgivoidsetSecurityService(SecurityService securityService) Callback for setting the security service.voidsetSeriesService(SeriesService seriesService) Sets the series serviceprotected voidsetServiceRegistry(ServiceRegistry registry) Callback for the OSGi environment to register with theServiceRegistry.voidsetUserDirectoryService(UserDirectoryService userDirectoryService) Callback for setting the user directory serviceprotected voidsetWorkspace(Workspace workspace) Callback for the OSGi environment to register with theWorkspace.start(WorkflowDefinition workflowDefinition, MediaPackage mediaPackage) Creates a new workflow instance and starts the workflow.start(WorkflowDefinition workflowDefinition, MediaPackage sourceMediaPackage, Long parentWorkflowId, Map<String, String> originalProperties) Creates a new workflow instance and starts the workflow.start(WorkflowDefinition workflowDefinition, MediaPackage mediaPackage, Map<String, String> properties) Creates a new workflow instance and starts the workflow.stop(long workflowInstanceId) Stops a running workflow instance.suspend(long workflowInstanceId) Temporarily suspends a started workflow instance.voidupdate(WorkflowInstance workflowInstance) Updates the given workflow instance with regard to the media package, the properties and the operations involved.protected WorkflowInstanceupdateConfiguration(WorkflowInstance instance, Map<String, String> properties) booleanuserHasActiveWorkflows(String userId) Checks if there is at least one workflow currently running started by the given userMethods inherited from class org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
logIndexRebuildBegin, logIndexRebuildBegin, logIndexRebuildError, logIndexRebuildError, logIndexRebuildError, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logSkippingElement, logSkippingElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
dataTypeSupported, getSupportedDataTypes
-
Field Details
-
ERROR_RESOLUTION_HANDLER_ID
Error resolution handler id constant- See Also:
-
componentContext
protected org.osgi.service.component.ComponentContext componentContextRemove references to the component context once felix scr 1.2 becomes available -
persistence
Persistent storage -
executorService
The thread pool to use for firing listeners and handling dispatched jobs -
workspace
The workspace -
serviceRegistry
The service registry -
securityService
The security service -
authorizationService
The authorization service -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service -
seriesService
The series service -
assetManager
The asset manager
-
-
Constructor Details
-
WorkflowServiceImpl
public WorkflowServiceImpl()Constructs a new workflow service impl, with a priority-sorted map of metadata services
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext componentContext) Activate this service implementation via the OSGI service component runtime.- Parameters:
componentContext- the component context
-
addWorkflowListener
Adds a workflow listener to be notified when workflows are updated.- Specified by:
addWorkflowListenerin interfaceWorkflowService- Parameters:
listener- the workflow listener to add- See Also:
-
removeWorkflowListener
Removes a workflow listener.- Specified by:
removeWorkflowListenerin interfaceWorkflowService- Parameters:
listener- the workflow listener to remove- See Also:
-
fireListeners
protected void fireListeners(WorkflowInstance oldWorkflowInstance, WorkflowInstance newWorkflowInstance) Fires the workflow listeners on workflow updates. -
listAvailableWorkflowDefinitions
Gets the list of available workflow definitions. In order to be "available", a workflow definition must be registered and must have registered workflow operation handlers for each of the workflow definition's operations.- Specified by:
listAvailableWorkflowDefinitionsin interfaceWorkflowService- Returns:
- The list of currently available workflow definitions, sorted by title
- See Also:
-
isRunnable
-
getRegisteredHandlers
Gets the currently registered workflow operation handlers.- Returns:
- All currently registered handlers
-
getWorkflowOperationHandler
-
listAvailableOperationNames
Lists the names of each workflow operation. Operation names are availalbe for use if there is a registeredWorkflowOperationHandlerwith an equalWorkflowService.WORKFLOW_OPERATION_PROPERTYproperty.- Returns:
- The
Listof available workflow operation names
-
getWorkflowById
Gets aWorkflowInstanceby its ID.- Specified by:
getWorkflowByIdin interfaceWorkflowService- Returns:
- the workflow instance
- Throws:
NotFoundException- if there is no workflow instance with this identifierUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
start
public WorkflowInstance start(WorkflowDefinition workflowDefinition, MediaPackage mediaPackage) throws WorkflowDatabaseException, UnauthorizedException, WorkflowParsingException Creates a new workflow instance and starts the workflow.- Specified by:
startin interfaceWorkflowService- Parameters:
workflowDefinition- the workflow definitionmediaPackage- the mediapackage to process- Returns:
- The new workflow instance
- Throws:
WorkflowDatabaseException- if there is a problem storing the workflow instance in persistenceWorkflowParsingException- if there is a problem parsing or serializing workflow entitiesUnauthorizedException- See Also:
-
start
public WorkflowInstance start(WorkflowDefinition workflowDefinition, MediaPackage mediaPackage, Map<String, String> properties) throws WorkflowDatabaseException, UnauthorizedException, WorkflowParsingExceptionCreates a new workflow instance and starts the workflow.- Specified by:
startin interfaceWorkflowService- Parameters:
workflowDefinition- the workflow definitionmediaPackage- the mediapackage to processproperties- any properties to apply to the workflow definition- Returns:
- The new workflow instance
- Throws:
WorkflowDatabaseException- if there is a problem storing the workflow instance in persistenceWorkflowParsingException- if there is a problem parsing or serializing workflow entitiesUnauthorizedException- See Also:
-
start
public WorkflowInstance start(WorkflowDefinition workflowDefinition, MediaPackage sourceMediaPackage, Long parentWorkflowId, Map<String, String> originalProperties) throws WorkflowDatabaseException, NotFoundException, UnauthorizedException, WorkflowParsingException, IllegalStateExceptionCreates a new workflow instance and starts the workflow.- Specified by:
startin interfaceWorkflowService- Parameters:
workflowDefinition- the workflow definitionsourceMediaPackage- the mediapackage to processparentWorkflowId- An existing workflow to associate with the new workflow instanceoriginalProperties- any properties to apply to the workflow definition- Returns:
- The new workflow instance
- Throws:
WorkflowDatabaseException- if there is a problem storing the workflow instance in persistenceNotFoundException- if the parent workflow does not existUnauthorizedException- if the current user does not havePermissions.Action.WRITEon the media package.WorkflowParsingException- if there is a problem parsing or serializing workflow entitiesIllegalStateException- if there is currently a workflow active on the media package- See Also:
-
updateConfiguration
protected WorkflowInstance updateConfiguration(WorkflowInstance instance, Map<String, String> properties) -
selectOperationHandler
Does a lookup of available operation handlers for the given workflow operation.- Parameters:
operation- the operation definition- Returns:
- the handler or
null
-
runWorkflow
protected Job runWorkflow(WorkflowInstance workflow) throws WorkflowException, UnauthorizedException Executes the workflow.- Parameters:
workflow- the workflow instance- Throws:
WorkflowException- if there is a problem processing the workflowUnauthorizedException
-
runWorkflowOperation
protected WorkflowOperationInstance runWorkflowOperation(WorkflowInstance workflow, Map<String, String> properties) throws WorkflowException, UnauthorizedExceptionExecutes the workflow's current operation.- Parameters:
workflow- the workflowproperties- the properties that are passed in on resume- Returns:
- the processed workflow operation
- Throws:
WorkflowException- if there is a problem processing the workflowUnauthorizedException
-
getWorkflowDefinitionById
Returns theWorkflowDefinitionidentified byname.- Specified by:
getWorkflowDefinitionByIdin interfaceWorkflowService- Parameters:
id- the workflow definition id- Returns:
- the workflow
- Throws:
NotFoundException- if there is no registered workflow definition with this identifier- See Also:
-
stop
public WorkflowInstance stop(long workflowInstanceId) throws WorkflowException, NotFoundException, UnauthorizedException Stops a running workflow instance.- Specified by:
stopin interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance identifier- Returns:
- the workflow instance
- Throws:
WorkflowException- if there is a problem processing the workflowNotFoundException- if no running workflow with this identifier existsUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
remove
public void remove(long workflowInstanceId) throws WorkflowDatabaseException, NotFoundException, UnauthorizedException, WorkflowParsingException, WorkflowStateException Permanently removes a workflow instance. Only workflow instances with stateWorkflowInstance.WorkflowState.SUCCEEDED,WorkflowInstance.WorkflowState.STOPPEDorWorkflowInstance.WorkflowState.FAILEDmay be removed.- Specified by:
removein interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance identifier- Throws:
WorkflowDatabaseException- if there is a problem writing to the databaseNotFoundException- if no workflow instance with the given identifier could be foundUnauthorizedException- if the current user does not have write permissions on the workflow instanceWorkflowStateException- if the workflow instance is in a disallowed stateWorkflowParsingException- See Also:
-
remove
public void remove(long workflowInstanceId, boolean force) throws WorkflowDatabaseException, NotFoundException, UnauthorizedException, WorkflowStateException Permanently removes a workflow instance. Option to remove a workflow instance regardless of its status.- Specified by:
removein interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance identifierforce- remove the workflow instance no matter the status- Throws:
WorkflowDatabaseException- if there is a problem writing to the databaseNotFoundException- if no workflow instance with the given identifier could be foundUnauthorizedException- if the current user does not have write permissions on the workflow instanceWorkflowStateException- if the workflow instance is in a disallowed state- See Also:
-
suspend
public WorkflowInstance suspend(long workflowInstanceId) throws WorkflowException, NotFoundException, UnauthorizedException Temporarily suspends a started workflow instance.- Specified by:
suspendin interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance identifier- Returns:
- the workflow instance
- Throws:
WorkflowException- if there is a problem processing the workflowNotFoundException- if no running workflow with this identifier existsUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
resume
public WorkflowInstance resume(long id) throws WorkflowException, NotFoundException, IllegalStateException, UnauthorizedException Resumes a suspended workflow instance.- Specified by:
resumein interfaceWorkflowService- Parameters:
id- the workflow instance identifier- Returns:
- the workflow instance
- Throws:
WorkflowException- if there is a problem processing the workflowNotFoundException- if no paused workflow with this identifier existsIllegalStateException- if the workflow with this identifier is not in the paused stateUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
resume
public WorkflowInstance resume(long workflowInstanceId, Map<String, String> properties) throws WorkflowException, NotFoundException, IllegalStateException, UnauthorizedExceptionResumes a suspended workflow instance, applying new properties to the workflow.- Specified by:
resumein interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow to resumeproperties- the properties to apply to the resumed workflow- Returns:
- the workflow instance
- Throws:
WorkflowException- if there is a problem processing the workflowNotFoundException- if no workflow with this identifier existsIllegalStateException- if the workflow with this identifier is not in the paused stateUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
assertPermission
protected void assertPermission(WorkflowInstance workflow, String action, String workflowOrgId) throws UnauthorizedException Asserts that the current user has permission to take the provided action on a workflow instance.- Parameters:
workflow- the workflow instanceaction- the action to ensure is permitted- Throws:
UnauthorizedException- if the action is not authorized
-
assertMediaPackagePermission
-
update
public void update(WorkflowInstance workflowInstance) throws WorkflowDatabaseException, UnauthorizedException Updates the given workflow instance with regard to the media package, the properties and the operations involved.- Specified by:
updatein interfaceWorkflowService- Parameters:
workflowInstance- the workflow instance- Throws:
WorkflowDatabaseException- if there is a database problem processing the workflowUnauthorizedException- if the current user does not have read permissions on the workflow instance's mediapackage.- See Also:
-
countWorkflowInstances
Gets the total number of workflows that have been created to date.- Specified by:
countWorkflowInstancesin interfaceWorkflowService- Returns:
- The number of workflow instances, regardless of their state
- Throws:
WorkflowDatabaseException- if there is a problem accessing the workflow instances in persistence- See Also:
-
countWorkflowInstances
public long countWorkflowInstances(WorkflowInstance.WorkflowState state) throws WorkflowDatabaseException Gets the total number of workflows that have been created to date and that match the workflow state which might benull.- Specified by:
countWorkflowInstancesin interfaceWorkflowService- Parameters:
state- the workflow state- Returns:
- The number of workflow instances, regardless of their state
- Throws:
WorkflowDatabaseException- if there is a problem accessing the workflow instances in persistence- See Also:
-
getWorkflowInstancesByMediaPackage
public List<WorkflowInstance> getWorkflowInstancesByMediaPackage(String mediaPackageId) throws WorkflowDatabaseException, UnauthorizedException Returns all workflows associated with the given mediapackage Current user needs permission to the mediapackage- Specified by:
getWorkflowInstancesByMediaPackagein interfaceWorkflowService- Parameters:
mediaPackageId- the identifier of the mediapackage- Returns:
- a
ListofWorkflowInstance - Throws:
WorkflowDatabaseExceptionUnauthorizedException- See Also:
-
getRunningWorkflowInstanceByMediaPackage
public Optional<WorkflowInstance> getRunningWorkflowInstanceByMediaPackage(String mediaPackageId, String action) throws WorkflowException, UnauthorizedException, WorkflowDatabaseException Returns theWorkflowInstancecurrently running on the given mediaPackage- Specified by:
getRunningWorkflowInstanceByMediaPackagein interfaceWorkflowService- Parameters:
mediaPackageId- the identifier of the mediaPackageaction- necessary permissions for the workflowInstance- Returns:
- An
Optionalcontaining the currently runningWorkflowInstance - Throws:
WorkflowExceptionUnauthorizedExceptionWorkflowDatabaseException- See Also:
-
mediaPackageHasActiveWorkflows
public boolean mediaPackageHasActiveWorkflows(String mediaPackageId) throws WorkflowDatabaseException Checks if there is at least one workflow currently running on the given mediapackage- Specified by:
mediaPackageHasActiveWorkflowsin interfaceWorkflowService- Parameters:
mediaPackageId- the identifier of the mediapackage- Returns:
- Whether there is a workflow active on the mediapackage
- Throws:
WorkflowDatabaseException- See Also:
-
userHasActiveWorkflows
Checks if there is at least one workflow currently running started by the given user- Specified by:
userHasActiveWorkflowsin interfaceWorkflowService- Parameters:
userId- the identifier of the user- Returns:
- Whether there is a workflow active started by the user
- Throws:
WorkflowDatabaseException- See Also:
-
handleOperationException
protected WorkflowInstance handleOperationException(WorkflowInstance workflow, WorkflowOperationInstance currentOperation) Callback for workflow operations that were throwing an exception. This implementation assumes that the operation worker has already adjusted the current operation's state appropriately.- Parameters:
workflow- the workflow instancecurrentOperation- the current workflow operation- Returns:
- the workflow instance
-
handleOperationResult
protected WorkflowInstance handleOperationResult(WorkflowInstance workflow, WorkflowOperationResult result) throws WorkflowDatabaseException Callback for workflow operation handlers that executed and finished without exception. This implementation assumes that the operation worker has already adjusted the current operation's state appropriately.- Parameters:
workflow- the workflow instanceresult- the workflow operation result- Returns:
- the workflow instance
- Throws:
WorkflowDatabaseException- if updating the workflow fails
-
populateMediaPackageMetadata
Reads the available metadata from the dublin core catalog (if there is one) and updates the mediapackage.- Parameters:
mp- the media package
-
isReadyToAcceptJobs
Whether new jobs can be accepted in general.- Specified by:
isReadyToAcceptJobsin interfaceJobProducer- Parameters:
operation- operation- Returns:
- whether the service is ready to accept jobs
- See Also:
-
isReadyToAccept
Whether the job can be accepted. If we are already running the maximum number of workflows, don't accept another START_WORKFLOW job- Specified by:
isReadyToAcceptin interfaceJobProducer- Parameters:
job- the job being dispatched- Returns:
- whether the service is ready to accept the job
- Throws:
UndispatchableJobException- if the job will never be accepted because it is unacceptable- See Also:
-
acceptJob
Asks the job producer to handle the given job using the provided operation and list of arguments. The implementation of this method must be asynchronous if the processing takes more than a few seconds.- Specified by:
acceptJobin interfaceJobProducer- Parameters:
job- the job being dispatched- Throws:
ServiceRegistryException- if the producer was unable to start work as requested- See Also:
-
process
Processes the workflow job.- Parameters:
job- the job- Returns:
- the job payload
- Throws:
Exception- if job processing fails
-
countJobs
Get the number of jobs in a current status on all nodes.- Specified by:
countJobsin interfaceJobProducer- Returns:
- Number of jobs in this state
- Throws:
ServiceRegistryException- if an error occurs while communicating with the backing data source- See Also:
-
setProfilesReadyIndicator
Dummy callback for osgi- Parameters:
unused- the unused ReadinessIndicator
-
setWorkspace
Callback for the OSGi environment to register with theWorkspace.- Parameters:
workspace- the workspace
-
setServiceRegistry
Callback for the OSGi environment to register with theServiceRegistry.- Parameters:
registry- the service registry
-
getServiceRegistry
-
setSecurityService
Callback for setting the security service.- Parameters:
securityService- the securityService to set
-
setAuthorizationService
Callback for setting the authorization service.- Parameters:
authorizationService- the authorizationService to set
-
setUserDirectoryService
Callback for setting the user directory service- Parameters:
userDirectoryService- the userDirectoryService to set
-
setOrganizationDirectoryService
Sets a reference to the organization directory service.- Parameters:
organizationDirectory- the organization directory
-
setSeriesService
Sets the series service- Parameters:
seriesService- the seriesService to set
-
setAssetManager
Sets the asset manager- Parameters:
assetManager- the assetManager to set
-
addMetadataService
Callback to set the metadata service- Parameters:
service- the metadata service
-
removeMetadataService
Callback to remove a mediapackage metadata service.- Parameters:
service- the mediapackage metadata service to remove
-
addWorkflowDefinitionScanner
Callback to set the workflow definition scanner- Parameters:
scanner- the workflow definition scanner
-
setIndex
Callback to set the Admin UI index.- Parameters:
index- the admin UI index.
-
setPersistence
Callback to set the workflow database- Parameters:
persistence- the workflow database
-
getJobType
The type of jobs that this producer creates.- Specified by:
getJobTypein interfaceJobProducer- Returns:
- the job type
- See Also:
-
cleanupWorkflowInstances
public void cleanupWorkflowInstances(int buffer, WorkflowInstance.WorkflowState state) throws UnauthorizedException, WorkflowDatabaseException Description copied from interface:WorkflowServiceStarts a cleanup of workflow instances with a given lifetime and a specific state- Specified by:
cleanupWorkflowInstancesin interfaceWorkflowService- Parameters:
buffer- minimum lifetime of the workflow instancesstate- state of the workflow instances- Throws:
UnauthorizedExceptionWorkflowDatabaseException
-
getWorkflowStateMappings
- Specified by:
getWorkflowStateMappingsin interfaceWorkflowService- Returns:
- All configured workflow state mappings
-
repopulate
Description copied from interface:IndexProducerRe-add the data of this service to the index.- Specified by:
repopulatein interfaceIndexProducer- Parameters:
type- Limit the data added to the index. Use ALL to re-index all data.- Throws:
IndexRebuildException
-
getService
Description copied from interface:IndexProducerGet the service that implements IndexProducer.- Specified by:
getServicein interfaceIndexProducer- Returns:
- service The service that implements IndexProducer.
-