Class GenericDataObjectModificationBuilder
- java.lang.Object
-
- com.flowable.dataobject.engine.impl.runtime.GenericDataObjectModificationBuilder
-
- All Implemented Interfaces:
DataObjectModificationBuilder
public class GenericDataObjectModificationBuilder extends Object implements DataObjectModificationBuilder
- Author:
- Filip Hrisafov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classGenericDataObjectModificationBuilder.ExecuteModification
-
Field Summary
Fields Modifier and Type Field Description protected Collection<String>accessibleByGroupsprotected booleanaccessibleBySetprotected StringaccessibleByUserprotected CommandExecutorcommandExecutorprotected DataObjectHandlingContextcontextprotected Map<String,Object>dataprotected StringdefinitionIdprotected StringdefinitionKeyprotected StringlookupIdprotected Stringoperationprotected Map<String,Object>originalDataprotected StringtenantId
-
Constructor Summary
Constructors Constructor Description GenericDataObjectModificationBuilder(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataObjectModificationBuilderaccessibleByUserOrGroups(String userId, Collection<String> groupKeys)DataObjectModificationBuilderdefinitionId(String id)Set the id of the data object definition the update operation should be based on.DataObjectModificationBuilderdefinitionKey(String key)Set the key of the data object definition the update operation should be based on.StringgetDefinitionId()Returns the id of the data object definition this modification builder is based on.Map<String,Object>getModificationData()Map<String,Object>getOriginalData()DataObjectModificationBuilderlookupId(String lookupId)The id of the data object that should be modified with the data.DataObjectInstanceVariableContainermodify()Persists the modified data object instance.DataObjectModificationBuildermodifyFromPayload(DataObjectHandlingContext context)If a modification builder is used to modify a data object given by the payload sent from a form typically, this method is invoked to modify the data object according the given payload data.DataObjectModificationBuilderoperation(String operation)Set the key of the operation that should be used to create the object.DataObjectModificationBuilderoriginalValue(String valueName, Object value)Generic setter for a data object field value specified by its name and value to be set.DataObjectModificationBuildertenantId(String tenantId)Set the tenant id for data object definition.DataObjectModificationBuildervalue(String valueName, Object value)Generic setter for a data object field value specified by its name and value to be set.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.flowable.dataobject.api.runtime.DataObjectModificationBuilder
accessibleByUser
-
-
-
-
Field Detail
-
commandExecutor
protected final CommandExecutor commandExecutor
-
definitionId
protected String definitionId
-
definitionKey
protected String definitionKey
-
tenantId
protected String tenantId
-
operation
protected String operation
-
lookupId
protected String lookupId
-
context
protected DataObjectHandlingContext context
-
accessibleByUser
protected String accessibleByUser
-
accessibleByGroups
protected Collection<String> accessibleByGroups
-
accessibleBySet
protected boolean accessibleBySet
-
-
Constructor Detail
-
GenericDataObjectModificationBuilder
public GenericDataObjectModificationBuilder(CommandExecutor commandExecutor)
-
-
Method Detail
-
getDefinitionId
public String getDefinitionId()
Description copied from interface:DataObjectModificationBuilderReturns the id of the data object definition this modification builder is based on.- Specified by:
getDefinitionIdin interfaceDataObjectModificationBuilder- Returns:
- the id of the data object definition
-
definitionId
public DataObjectModificationBuilder definitionId(String id)
Description copied from interface:DataObjectModificationBuilderSet the id of the data object definition the update operation should be based on. Must only be provided, if the data object definition key is not set.- Specified by:
definitionIdin interfaceDataObjectModificationBuilder
-
definitionKey
public DataObjectModificationBuilder definitionKey(String key)
Description copied from interface:DataObjectModificationBuilderSet the key of the data object definition the update operation should be based on. If set, the latest definition id is used. The key is ignored, if the definition id is set directly.- Specified by:
definitionKeyin interfaceDataObjectModificationBuilder
-
tenantId
public DataObjectModificationBuilder tenantId(String tenantId)
Description copied from interface:DataObjectModificationBuilderSet the tenant id for data object definition. This can be used together with the definition key for the lookup- Specified by:
tenantIdin interfaceDataObjectModificationBuilder
-
operation
public DataObjectModificationBuilder operation(String operation)
Description copied from interface:DataObjectModificationBuilderSet the key of the operation that should be used to create the object.- Specified by:
operationin interfaceDataObjectModificationBuilder
-
lookupId
public DataObjectModificationBuilder lookupId(String lookupId)
Description copied from interface:DataObjectModificationBuilderThe id of the data object that should be modified with the data. Only relevant when using the default update operation.- Specified by:
lookupIdin interfaceDataObjectModificationBuilder
-
modifyFromPayload
public DataObjectModificationBuilder modifyFromPayload(DataObjectHandlingContext context)
Description copied from interface:DataObjectModificationBuilderIf a modification builder is used to modify a data object given by the payload sent from a form typically, this method is invoked to modify the data object according the given payload data.- Specified by:
modifyFromPayloadin interfaceDataObjectModificationBuilder- Parameters:
context- the data object context containing the data and full payload and further information for parsing the content into the data object- Returns:
- the builder instance for method chaining
-
value
public DataObjectModificationBuilder value(String valueName, Object value)
Description copied from interface:DataObjectModificationBuilderGeneric setter for a data object field value specified by its name and value to be set.- Specified by:
valuein interfaceDataObjectModificationBuilder- Parameters:
valueName- the name of the data object field to set a valuevalue- the value to be set- Returns:
- the builder instance for method chaining
-
originalValue
public DataObjectModificationBuilder originalValue(String valueName, Object value)
Description copied from interface:DataObjectModificationBuilderGeneric setter for a data object field value specified by its name and value to be set.- Specified by:
originalValuein interfaceDataObjectModificationBuilder- Parameters:
valueName- the name of the data object field to set a valuevalue- the value to be set- Returns:
- the builder instance for method chaining
-
accessibleByUserOrGroups
public DataObjectModificationBuilder accessibleByUserOrGroups(String userId, Collection<String> groupKeys)
- Specified by:
accessibleByUserOrGroupsin interfaceDataObjectModificationBuilder
-
modify
public DataObjectInstanceVariableContainer modify()
Description copied from interface:DataObjectModificationBuilderPersists the modified data object instance. This operation will try to return the container that was modified. NOTE: Whether something is returned or not depends on the implementation for the operation- Specified by:
modifyin interfaceDataObjectModificationBuilder- Returns:
- the modified data object instance which might be the very same or actually a new one returned by the data source
-
getModificationData
public Map<String,Object> getModificationData()
- Specified by:
getModificationDatain interfaceDataObjectModificationBuilder
-
getOriginalData
public Map<String,Object> getOriginalData()
- Specified by:
getOriginalDatain interfaceDataObjectModificationBuilder
-
-