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 class
GenericDataObjectModificationBuilder.ExecuteModification
-
Field Summary
Fields Modifier and Type Field Description protected Collection<String>
accessibleByGroups
protected boolean
accessibleBySet
protected String
accessibleByUser
protected CommandExecutor
commandExecutor
protected DataObjectHandlingContext
context
protected Map<String,Object>
data
protected String
definitionId
protected String
definitionKey
protected String
lookupId
protected String
operation
protected Map<String,Object>
originalData
protected String
tenantId
-
Constructor Summary
Constructors Constructor Description GenericDataObjectModificationBuilder(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataObjectModificationBuilder
accessibleByUserOrGroups(String userId, Collection<String> groupKeys)
DataObjectModificationBuilder
definitionId(String id)
Set the id of the data object definition the update operation should be based on.DataObjectModificationBuilder
definitionKey(String key)
Set the key of the data object definition the update operation should be based on.String
getDefinitionId()
Returns the id of the data object definition this modification builder is based on.Map<String,Object>
getModificationData()
Map<String,Object>
getOriginalData()
DataObjectModificationBuilder
lookupId(String lookupId)
The id of the data object that should be modified with the data.DataObjectInstanceVariableContainer
modify()
Persists the modified data object instance.DataObjectModificationBuilder
modifyFromPayload(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.DataObjectModificationBuilder
operation(String operation)
Set the key of the operation that should be used to create the object.DataObjectModificationBuilder
originalValue(String valueName, Object value)
Generic setter for a data object field value specified by its name and value to be set.DataObjectModificationBuilder
tenantId(String tenantId)
Set the tenant id for data object definition.DataObjectModificationBuilder
value(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:DataObjectModificationBuilder
Returns the id of the data object definition this modification builder is based on.- Specified by:
getDefinitionId
in interfaceDataObjectModificationBuilder
- Returns:
- the id of the data object definition
-
definitionId
public DataObjectModificationBuilder definitionId(String id)
Description copied from interface:DataObjectModificationBuilder
Set 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:
definitionId
in interfaceDataObjectModificationBuilder
-
definitionKey
public DataObjectModificationBuilder definitionKey(String key)
Description copied from interface:DataObjectModificationBuilder
Set 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:
definitionKey
in interfaceDataObjectModificationBuilder
-
tenantId
public DataObjectModificationBuilder tenantId(String tenantId)
Description copied from interface:DataObjectModificationBuilder
Set the tenant id for data object definition. This can be used together with the definition key for the lookup- Specified by:
tenantId
in interfaceDataObjectModificationBuilder
-
operation
public DataObjectModificationBuilder operation(String operation)
Description copied from interface:DataObjectModificationBuilder
Set the key of the operation that should be used to create the object.- Specified by:
operation
in interfaceDataObjectModificationBuilder
-
lookupId
public DataObjectModificationBuilder lookupId(String lookupId)
Description copied from interface:DataObjectModificationBuilder
The id of the data object that should be modified with the data. Only relevant when using the default update operation.- Specified by:
lookupId
in interfaceDataObjectModificationBuilder
-
modifyFromPayload
public DataObjectModificationBuilder modifyFromPayload(DataObjectHandlingContext context)
Description copied from interface:DataObjectModificationBuilder
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.- Specified by:
modifyFromPayload
in 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:DataObjectModificationBuilder
Generic setter for a data object field value specified by its name and value to be set.- Specified by:
value
in 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:DataObjectModificationBuilder
Generic setter for a data object field value specified by its name and value to be set.- Specified by:
originalValue
in 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:
accessibleByUserOrGroups
in interfaceDataObjectModificationBuilder
-
modify
public DataObjectInstanceVariableContainer modify()
Description copied from interface:DataObjectModificationBuilder
Persists 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:
modify
in 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:
getModificationData
in interfaceDataObjectModificationBuilder
-
getOriginalData
public Map<String,Object> getOriginalData()
- Specified by:
getOriginalData
in interfaceDataObjectModificationBuilder
-
-