@PermitAll public class ProcessServiceBean extends com.whitestein.lsps.common.SecureAndLoggingService implements ProcessServiceLocal, ProcessServiceRemote
Constructor and Description |
---|
ProcessServiceBean()
Creates new instance.
|
ProcessServiceBean(ModelInstanceDao modelInstanceDao,
ProcessLogDao processLogDao,
ModelProviderService modelProviderService,
CommunicationService communicationService)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
ExecutionTrace |
createAndStartModelInstance(long modelId,
StringProperties properties,
boolean synchronously,
boolean startInterpretation)
Creates new model instance for given model id and properties and possibly starts
the model instance interpretation, This can be done
either synchronously or asynchronously.
|
ExecutionTrace |
createAndStartModelInstanceWithParent(long modelId,
StringProperties properties,
Long parentModelInstanceId,
boolean synchronously,
boolean startInterpretation)
Creates new model instance for given model id and properties and possibly starts
the model instance interpretation, This can be done
either synchronously or asynchronously.
|
ExecutionTrace |
createModelInstance(long modelId,
StringProperties properties,
boolean synchronously)
Creates new model instance for given model id and properties.
|
Long |
createModelInstanceSimple(long modelId,
StringProperties properties,
boolean synchronously)
Creates new model instance for given model id and properties.
|
ModelInstanceInfoList |
findModelInstances(ModelInstanceCriteria criteria)
Returns model instance info-s according to the provided criteria.
|
CompressedModelInstance |
getCompressedModelInstance(long modelInstanceId)
Returns a compressed model instance execution state for given model
instance* id or null if it does not exist.
|
CompressedString |
getCompressedModelInstanceXml(long modelInstanceId,
List<ModelInstanceData> data)
Returns the specified model instance as an xml structure or null if it does not exist.
|
CompressedData |
getCompressedRawModelInstanceXml(long modelInstanceId)
Returns the specified model instance as an xml structure or null if it does not exist.
|
ModelInstance |
getModelInstance(long modelInstanceId)
Returns complete model instance execution state for given model instance id or null if it
does not exist.
|
ModelInstanceInfo |
getModelInstanceInfo(long modelInstanceId)
Returns model instance info for given model instance id or null if it does not exist.
|
String |
getModelInstanceXml(long modelInstanceId,
List<ModelInstanceData> data)
Returns the specified model instance as an xml structure or null if it does not exist.
|
ByteData |
getRawModelInstanceXml(long modelInstanceId)
Returns the specified model instance as an xml structure or null if it does not exist.
|
void |
notifyModelInstance(long modelInstanceId,
String reason,
boolean synchronously)
Notifies a model instance.
|
void |
notifyTask(long modelInstanceId,
long taskId,
String reason,
boolean synchronously)
Notifies a task in model instance.
|
void |
removeAllFormPreviewModelInstances()
Removes all model instances created by form preview.
|
void |
removeSignalFromModelInstance(long modelInstanceId,
long id,
boolean synchronously)
Removes a signal from a running model instance.
|
ExternalRecordValue |
resolveReference(long modelInstanceId,
ExternalRecordValue value)
Resolves external record value reference to a value, attributes of which
are populated.
|
void |
restartModelInstances(Collection<Long> modelInstanceIds,
long newModuleId)
Restarts model instances with new model.
|
void |
resumeModelInstance(long modelInstanceId,
boolean synchronously)
Resumes model instance execution.
|
ExecutionTrace |
sendSignalToModelInstance(long modelInstanceId,
ObjectValue signal,
boolean synchronously)
Sends a signal to a running model instance.
|
void |
setCompressedRawModelInstanceXml(long modelInstanceId,
CompressedData data)
Sets the model instance state.
|
void |
setRawModelInstanceXml(long modelInstanceId,
ByteData data)
Sets the model instance state.
|
ExecutionTrace |
startInterpretModelInstance(long modelInstanceId,
boolean synchronously)
Starts the interpretation of an existing model instance for given model instance id.
|
List<Long> |
startInterpretModelInstanceSimple(long modelInstanceId,
boolean synchronously)
Starts the interpretation of an existing model instance for given model instance id.
|
void |
suspendModelInstance(long modelInstanceId,
boolean synchronously)
Suspends model instance execution.
|
ExecutionTrace |
terminateModelInstance(long modelInstanceId,
boolean synchronously)
Terminates model instance for given model instance id.
|
void |
updateContextVariable(long modelInstanceId,
long contextId,
String variable,
ObjectValue value,
boolean synchronously)
Updates the value of a given variable.
|
void |
updateGoalState(long modelInstanceId,
long processInstanceId,
String goalName,
boolean reactivate,
boolean synchronously)
Changes the state of the given goal.
|
void |
updateRecordField(long modelInstanceId,
String recordType,
String recordId,
String field,
ObjectValue value,
boolean synchronously)
Updates the value of a given record field.
|
public ProcessServiceBean()
public ProcessServiceBean(ModelInstanceDao modelInstanceDao, ProcessLogDao processLogDao, ModelProviderService modelProviderService, CommunicationService communicationService)
modelInstanceDao
- processLogDao
- modelProviderService
- communicationService
- NullPointerException
- if any argument is null@RightsAllowed(value="ModelInstance:Read") public ModelInstanceInfo getModelInstanceInfo(long modelInstanceId)
ProcessService
getModelInstanceInfo
in interface ProcessService
modelInstanceId
- process id@RightsAllowed(value="ModelInstance:Read") public ModelInstanceInfoList findModelInstances(ModelInstanceCriteria criteria)
ProcessService
findModelInstances
in interface ProcessService
criteria
- criteria for searchingModelInstanceInfo
s@RightsAllowed(value="ModelInstance:Read") public ModelInstance getModelInstance(long modelInstanceId)
ProcessService
getModelInstance
in interface ProcessService
@RightsAllowed(value="ModelInstance:Read") public CompressedModelInstance getCompressedModelInstance(long modelInstanceId)
ProcessService
Returns a compressed model instance execution state for given model instance* id or null if it does not exist. The state does not contain BPMN transactions.
Use this method when transferring large model instance states over the network.
getCompressedModelInstance
in interface ProcessService
@RightsAllowed(value="Signal:Send") public ExecutionTrace sendSignalToModelInstance(long modelInstanceId, ObjectValue signal, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
sendSignalToModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
SimpleType
@RightsAllowed(value="Signal:Remove") public void removeSignalFromModelInstance(long modelInstanceId, long id, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
removeSignalFromModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Create") public ExecutionTrace createModelInstance(long modelId, StringProperties properties, boolean synchronously) throws ModuleNotFoundException
ProcessService
ProcessService.startInterpretModelInstance(long, boolean)
. This can be done
either synchronously or asynchronously. If asynchronously, the returned
ModelInstanceInfo
will not contain the model instance id (the id
will be -1).createModelInstance
in interface ProcessService
ModuleNotFoundException
- if no model exists for the given model id@RightsAllowed(value="ModelInstance:Create") public Long createModelInstanceSimple(long modelId, StringProperties properties, boolean synchronously) throws ModuleNotFoundException
ProcessService
ProcessService.startInterpretModelInstance(long, boolean)
. This can be done
either synchronously or asynchronously. If asynchronously, the returned
ModelInstanceInfo
will not contain the model instance id (the id
will be -1).createModelInstanceSimple
in interface ProcessService
ModuleNotFoundException
- if no model exists for the given model id@RightsAllowed(value="ModelInstance:Create") public ExecutionTrace createAndStartModelInstance(long modelId, StringProperties properties, boolean synchronously, boolean startInterpretation) throws ModuleNotFoundException
ProcessService
ModelInstanceInfo
will not contain the model instance id (the id
will be -1).createAndStartModelInstance
in interface ProcessService
ModuleNotFoundException
- if no model exists for the given model id@RightsAllowed(value="ModelInstance:Create") public ExecutionTrace createAndStartModelInstanceWithParent(long modelId, StringProperties properties, Long parentModelInstanceId, boolean synchronously, boolean startInterpretation) throws ModuleNotFoundException
ProcessService
createAndStartModelInstanceWithParent
in interface ProcessService
parentModelInstanceId
- id of the parent model instance, may be null
ModuleNotFoundException
- if no model exists for the given model id@RightsAllowed(value="ModelInstance:Terminate") public ExecutionTrace terminateModelInstance(long modelInstanceId, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException
ProcessService
terminateModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
- if the model instance is finished@RightsAllowed(value="ModelInstance:Create") public ExecutionTrace startInterpretModelInstance(long modelInstanceId, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
startInterpretModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
- if the model instance is finishedErrorException
@RightsAllowed(value="ModelInstance:Create") public List<Long> startInterpretModelInstanceSimple(long modelInstanceId, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
startInterpretModelInstanceSimple
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
- if the model instance is finishedErrorException
@RightsAllowed(value="Variables:Update") public void updateContextVariable(long modelInstanceId, long contextId, String variable, ObjectValue value, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
updateContextVariable
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="Variables:Update") public void updateRecordField(long modelInstanceId, String recordType, String recordId, String field, ObjectValue value, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
updateRecordField
in interface ProcessService
recordId
- The identifier of the record. The identifier is a string
representation of the holder's
handle
.ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="GoalState:Update") public void updateGoalState(long modelInstanceId, long processInstanceId, String goalName, boolean reactivate, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
updateGoalState
in interface ProcessService
reactivate
- true if the goal should be reactivatedModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Read") public String getModelInstanceXml(long modelInstanceId, List<ModelInstanceData> data)
ProcessService
getModelInstanceXml
in interface ProcessService
@RightsAllowed(value="ModelInstance:Read") public CompressedString getCompressedModelInstanceXml(long modelInstanceId, List<ModelInstanceData> data)
ProcessService
getCompressedModelInstanceXml
in interface ProcessService
@RightsAllowed(value="ModelInstance:Read") public ByteData getRawModelInstanceXml(long modelInstanceId)
ProcessService
Unlike ProcessService.getCompressedModelInstanceXml(long, List)
, this method
returns the raw XML as is stored in model instance state.
This is useful when the XML is not valid and cannot be unmarshalled by JAXB.
getRawModelInstanceXml
in interface ProcessService
@RightsAllowed(value="ModelInstance:Read") public CompressedData getCompressedRawModelInstanceXml(long modelInstanceId)
ProcessService
Unlike ProcessService.getCompressedModelInstanceXml(long, List)
, this method
returns the raw XML as is stored in model instance state.
This is useful when the XML is not valid and cannot be unmarshalled by JAXB.
getCompressedRawModelInstanceXml
in interface ProcessService
@RightsAllowed(value="ModelInstance:Write") public void setRawModelInstanceXml(long modelInstanceId, ByteData data) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException
ProcessService
setRawModelInstanceXml
in interface ProcessService
ModelInstanceNotFoundException
InvalidModelInstanceStateException
@RightsAllowed(value="ModelInstance:Write") public void setCompressedRawModelInstanceXml(long modelInstanceId, CompressedData data) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException
ProcessService
setCompressedRawModelInstanceXml
in interface ProcessService
ModelInstanceNotFoundException
InvalidModelInstanceStateException
@RightsAllowed(value="ModelInstance:Suspend") public void resumeModelInstance(long modelInstanceId, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
resumeModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Suspend") public void suspendModelInstance(long modelInstanceId, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
suspendModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Notify") public void notifyModelInstance(long modelInstanceId, String reason, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
notifyModelInstance
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Notify") public void notifyTask(long modelInstanceId, long taskId, String reason, boolean synchronously) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
notifyTask
in interface ProcessService
ModelInstanceNotFoundException
- if no running model instance exists for the given model instance idInvalidModelInstanceStateException
ErrorException
@RightsAllowed(value="ModelInstance:Read") public void removeAllFormPreviewModelInstances()
ProcessService
removeAllFormPreviewModelInstances
in interface ProcessService
public ExternalRecordValue resolveReference(long modelInstanceId, ExternalRecordValue value) throws ModelInstanceNotFoundException
ProcessService
resolveReference
in interface ProcessService
modelInstanceId
- the identifier of the model instance in which the value is definedvalue
- an external record value which is just a reference, that
is it's ExternalRecordValue.isReferenceOnly()
returns true
.ModelInstanceNotFoundException
ExternalRecordValue.isReferenceOnly()
public void restartModelInstances(Collection<Long> modelInstanceIds, long newModuleId) throws ModelInstanceNotFoundException, InvalidModelInstanceStateException, ErrorException
ProcessService
restartModelInstances
in interface ProcessService
newModuleId
- id of the new module, if -1 the current model of each instance is usedModelInstanceNotFoundException
InvalidModelInstanceStateException
ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.