Interface ISequentialUpdating<TData,TElement extends IWorkflowElementEntity,TVersion extends Comparable<TVersion>>
-
- Type Parameters:
TData
- Type of the properties model for the workflow element.TElement
- Type of the workflow element, i.e. a node or trigger.TVersion
- Type of the parsed version.
- All Superinterfaces:
ICustomParametersUpdateable
,IElementHandler<TData,TElement>
,IResourceBundleLocator
,IWorkflowElementTypeProviding
- All Known Subinterfaces:
ISemverUpdating<TData,TElement>
,ISemverUpdatingNode<TData>
,ISemverUpdatingTrigger<TData>
- All Known Implementing Classes:
FcCompressAsZipHandler
,FcEmailHandler
,FcHttpRequestHandler
public interface ISequentialUpdating<TData,TElement extends IWorkflowElementEntity,TVersion extends Comparable<TVersion>> extends IElementHandler<TData,TElement>
ImplementsICustomParametersUpdateable.updateCustomParams(IUpdateCustomParametersParams)
by running the transitions (upgrades) between the previous and the current version. The version string is parsed into the given type.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
CURRENT_HANDLER_VERSION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<TVersion,IUpdateTransition>
getTransitions()
A map from the version where an update is required to that update.TVersion
parseVersion(String version)
Parses the version string into a comparable instance.default com.alibaba.fastjson.JSONObject
updateCustomParams(IUpdateCustomParametersParams params)
Updates the custom parameters to the currentIVersionedCustomParametersProviding.getCustomParametersVersion()
.-
Methods inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
extractDescription, extractName, extractSearchTerms, getCascadingStyleSheet, getCascadingStyleSheet, getDataModelClass, getDisplayLabel, getElementSummaryModel, getElementSummaryXhtml, getFastJsonConverter, getFilterCriteriaForEntities, getHelpPageLocation, getJavaScript, getJavaScript, getLocalizedTypeName, getPropertiesBeanClass, getPropertiesViewXhtml, getResourceBundle, getVersion, isAvailable, isHasUserVisibleName, readEntityReferences, readPlaceholders, validateGlobal, validateLocal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.interfaces.workflow.IWorkflowElementTypeProviding
getType
-
-
-
-
Method Detail
-
getTransitions
Map<TVersion,IUpdateTransition> getTransitions()
A map from the version where an update is required to that update. For example, if the properties model needs to be updated in version1.1.7
,1.3.4
, and2.2.0
, the returned map should have one entry for each of these three versions.- Returns:
- A map from the version to the update for that version.
-
parseVersion
TVersion parseVersion(String version)
Parses the version string into a comparable instance.- Parameters:
version
- Version string to parse.- Returns:
- The parsed version object. Must not be
null
, use a default, such as0.0.0
.
-
updateCustomParams
default com.alibaba.fastjson.JSONObject updateCustomParams(IUpdateCustomParametersParams params)
Description copied from interface:ICustomParametersUpdateable
Updates the custom parameters to the currentIVersionedCustomParametersProviding.getCustomParametersVersion()
.The properties are stored as JSON, and the version is stored along with it. Later (such as after the software was updated), when this JSON needs to be retrieved again, the version is compared against the current version. When the versions are not equal,
ICustomParametersUpdateable.updateCustomParams(IUpdateCustomParametersParams)
is called on the raw JSON data, giving you a chance to update the properties before they are deserialized.Please note that the previous version is only guaranteed to be different from the current version. You must not assume the previous version is lower than the current one, e.g. when the software was downgraded. This is a low-level interface,
The default implementation simply assumes there are not changes and return the data that was passed in.
- Specified by:
updateCustomParams
in interfaceICustomParametersUpdateable
- Parameters:
params
- The JSON data to update, and the current and previous version.- Returns:
- The updated JSON data. You may mutate the given JSON, or create a fresh JSON object.
-
-