Package com.gengoai.hermes.workflow
Interface Action
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
Annotate
,ImportDocuments
,KeywordExtraction
,SpellChecker
,TermCounts
public interface Action extends Serializable
An action defines a processing step to perform on a
Corpus
with a givenContext
which results in either modifying the corpus or the context. Action implementations can persist their state to be reused at a later time including across jvm instances & runs. This is done by implementing theloadPreviousState(DocumentCollection, Context)
method. An action can ignore its state and reprocess the corpus when either the config settingprocessing.override.all
is set to true or the config settingclassName.override
is set tp true.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
getOverrideStatus()
Gets the override status for this processing module, which can be defined using configuration in the formfully.qualified.class.name.override=true
or all processing can be reperformed usingprocessing.override.all=true
.default State
loadPreviousState(DocumentCollection corpus, Context context)
Loads from a previous processing state.DocumentCollection
process(DocumentCollection corpus, Context context)
Process corpus.
-
-
-
Method Detail
-
getOverrideStatus
default boolean getOverrideStatus()
Gets the override status for this processing module, which can be defined using configuration in the formfully.qualified.class.name.override=true
or all processing can be reperformed usingprocessing.override.all=true
. By default, the status is false, which means try to load the previous state.- Returns:
- True force reprocessing, False try to load the previous state.
-
loadPreviousState
default State loadPreviousState(DocumentCollection corpus, Context context)
Loads from a previous processing state.- Parameters:
corpus
- the corpus being processedcontext
- the context of the processor- Returns:
- the processing state (NOT_LOADED by default meaning there is no previous state).
-
process
DocumentCollection process(DocumentCollection corpus, Context context) throws Exception
Process corpus.- Parameters:
corpus
- the corpuscontext
- the context- Throws:
Exception
- the exception
-
-