@Entity
public class ModelInstanceEntity
extends com.whitestein.lsps.common.AbstractEntity
Modifier and Type | Field and Description |
---|---|
static String |
COUNT_UNFINISHED_MODEL_INSTANCES
Query name.
|
static String |
FIND_FORM_PREVIEW_MODEL_INSTANCES
Query name.
|
Modifier | Constructor and Description |
---|---|
protected |
ModelInstanceEntity()
Creates new empty instance of
ModelInstanceEntity . |
|
ModelInstanceEntity(Module model,
ModelInstanceEntity parent,
Map<String,String> properties,
ModelInstanceType type,
ModelInstanceResourceAllocator idAllocator)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addNotification(String notification)
Adds a notification.
|
void |
addProperty(String name,
String value)
Adds a property.
|
AllocatedModelInstanceResources |
allocateDetachmentAndValueIds(long allocatedSize)
Allocates next range of value ids and detachment id.
|
AllocatedModelInstanceResources |
allocateValueIds(long allocatedSize)
Allocates next range of value ids.
|
void |
clearNotifications()
Clears all notifications.
|
void |
clearTempModelInstance() |
Date |
getFinishedDate()
Returns the finished date.
|
ModelInstanceInfo |
getInfo(boolean includeProperties)
Returns
ModelInstanceInfo for this model instance. |
long |
getLastAllocatedValueId()
Returns the last allocated value id.
|
long |
getLastDetachmentId()
Returns the last detachment id.
|
ModelInstanceState |
getLifecycleState()
Returns life-cycle state.
|
Module |
getModel()
Returns the model.
|
String |
getModelHash()
Returns the model hash.
|
long |
getModelId()
Returns the model id.
|
ModelInstance |
getModelInstance(ModelInstanceUtilsService modelInstanceUtilsService)
Returns the model instance.
|
ModelUpdate |
getModelInstanceMigration()
Returns the model instance migration.
|
String |
getModelName()
Returns the model name.
|
String |
getModelVersion()
Returns the model version.
|
ModelInstanceEntity |
getParent()
Returns the parent model instance.
|
Map<String,String> |
getProperties()
Returns an unmodifiable map of model instance properties.
|
String |
getProperty(String name)
Returns a model instance property by its name.
|
Date |
getStartedDate()
Returns the started date
|
byte[] |
getStateData()
Returns the state data (XML), unzipped (if zip loader has been used).
|
boolean |
isFinished()
Returns true if the model instance is finished.
|
boolean |
isRunning()
Returns true if the model instance is running.
|
boolean |
isUsed()
Returns true if the model instance is already used in the current thread.
|
void |
marshallState()
Saves the model instance state.
|
void |
postPersist()
This method must be called after persisting this entity.
|
void |
setFinishedDate(Date finishedDate)
Sets the finished date.
|
void |
setId(Long id) |
void |
setLifecycleState(ModelInstanceState state)
Sets life-cycle state.
|
void |
setModelInstance(Module model,
ModelInstance mi,
boolean createProperties)
Sets model instance.
|
void |
setModelInstanceMigration(ModelUpdate modelInstanceMigration)
Sets the model instance migration.
|
void |
setNotifications(Collection<String> notifications)
Sets the notifications set to the given notification collection.
|
void |
setStartedDate(Date startedDate)
Sets the started date.
|
void |
setStateData(byte[] data)
Sets the state data.
|
void |
setUsed(boolean used)
Sets isUsed to the value.
|
public static final String FIND_FORM_PREVIEW_MODEL_INSTANCES
public static final String COUNT_UNFINISHED_MODEL_INSTANCES
protected ModelInstanceEntity()
ModelInstanceEntity
.public ModelInstanceEntity(Module model, ModelInstanceEntity parent, Map<String,String> properties, ModelInstanceType type, ModelInstanceResourceAllocator idAllocator)
model
- parent
- properties
- type
- idAllocator
- NullPointerException
- if agentName
or modelName
or modelVersion
or modelHash
is nullpublic ModelInstance getModelInstance(ModelInstanceUtilsService modelInstanceUtilsService)
modelInstanceUtilsService
- public void setId(Long id)
setId
in class com.whitestein.lsps.common.AbstractEntity
public ModelInstanceEntity getParent()
public Module getModel()
public long getModelId()
public String getModelName()
public String getModelVersion()
public String getModelHash()
public ModelInstanceState getLifecycleState()
public void setLifecycleState(ModelInstanceState state)
state
- public boolean isFinished()
public boolean isRunning()
public ModelUpdate getModelInstanceMigration()
public void setModelInstanceMigration(ModelUpdate modelInstanceMigration)
modelInstanceMigration
- public Date getStartedDate()
public void setStartedDate(Date startedDate)
startedDate
- public Date getFinishedDate()
public void setFinishedDate(Date finishedDate)
finishedDate
- public Map<String,String> getProperties()
public String getProperty(String name)
name
- public byte[] getStateData()
public void setStateData(byte[] data)
data
- the new state data (unzipped)public void marshallState()
public ModelInstanceInfo getInfo(boolean includeProperties)
ModelInstanceInfo
for this model instance.includeProperties
- ModelInstanceInfo
for this model instancepublic void postPersist()
PostPersist
does not
work, because it is called only after flushing the entity.public void setModelInstance(Module model, ModelInstance mi, boolean createProperties)
model
- mi
- createProperties
- public void addProperty(String name, String value)
name
- value
- public void clearNotifications()
public void clearTempModelInstance()
public void addNotification(String notification)
notification
- public void setNotifications(Collection<String> notifications)
notifications
- public void setUsed(boolean used)
used
- public boolean isUsed()
public long getLastAllocatedValueId()
public long getLastDetachmentId()
public AllocatedModelInstanceResources allocateValueIds(long allocatedSize)
allocatedSize
- public AllocatedModelInstanceResources allocateDetachmentAndValueIds(long allocatedSize)
allocatedSize
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.