public interface DeviceExecItem
DeviceExecItem-s may represent results of (reported-to-user) method calls,
closure executions or just results of groovy script evaluations.
For instance, if a Task
for a device represents a groovy script with two (reported-to-user) method calls and one asynchronous
closure invocation, there will four DeviceExecItem objects representing each partial result
for the device execution of this Task:
A General Result for the groovy script evaluation of the Task.
A Result for each (user-reported) method call, thus totally two.
A Result for the groovy script evaluation of the Closure.
Source origin description is provided by the getResultSource() method.
Together with the execution status and source origin, this report contains a result value
in case such is provided upon completion of the respective execution.| Modifier and Type | Interface and Description |
|---|---|
static class |
DeviceExecItem.State
Defines possible execution statuses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the execution item.
|
java.lang.String |
getDeviceId()
Returns id of the device executing the represented execution item.
|
java.lang.String |
getDeviceType()
Returns type of the device executing the represented execution item.
|
java.lang.String |
getExecItemId()
Returns unique identifier of this execution item.
|
DeviceExecItem.State |
getExecState()
Returns the execution state of this
DeviceExecItem. |
java.util.Date |
getFinishTime()
Returns the time at which the
DeviceExecItem turns from
DeviceExecItem.State.RUNNING_WAIT_CONFIRMATION to some of the FINISHED_xxx states. |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns custom properties assigned to this execution item.
|
java.lang.Object |
getProperty(java.lang.String key)
Gets the value of an execution item property by property name.
|
java.lang.String |
getResultSource()
Provides description about the origin of the
DeviceExecItem such as method name
or closure evaluation or general task action evaluation with respect to the execution source. |
java.lang.Object |
getResultValue()
Returns result value if any.
|
java.lang.String |
getRuleId()
Returns the id of the Rule this execution item belongs to.
|
java.util.Date |
getStartTime()
Returns the time at which the
DeviceExecItem turns from
DeviceExecItem.State.RUNNING_PENDING_EXECUTION to DeviceExecItem.State.RUNNING_WAIT_CONFIRMATION. |
java.lang.String |
getStateDescription()
May return a additional description of the Execution Item state if needed.
|
java.lang.String |
getTaskId()
Returns the id of the Task this execution item belongs to.
|
java.lang.String |
getTaskName()
Returns the name of the Task this execution item belongs to.
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties,
boolean append)
Sets the execution item properties.
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets execution item property.
|
java.lang.String getExecItemId()
java.lang.String getResultSource()
DeviceExecItem such as method name
or closure evaluation or general task action evaluation with respect to the execution source.DeviceExecItem.State getExecState()
DeviceExecItem.java.lang.String getStateDescription()
ManagementException - if system error occurs.java.lang.Object getResultValue()
getExecState()) is DeviceExecItem.State.FINISHED_SUCCESS. For statuses: DeviceExecItem.State.FINISHED_WARNING
and DeviceExecItem.State.FINISHED_ERROR this method might return an error message.java.util.Date getStartTime()
DeviceExecItem turns from
DeviceExecItem.State.RUNNING_PENDING_EXECUTION to DeviceExecItem.State.RUNNING_WAIT_CONFIRMATION.java.util.Date getFinishTime()
DeviceExecItem turns from
DeviceExecItem.State.RUNNING_WAIT_CONFIRMATION to some of the FINISHED_xxx states.java.lang.String getDeviceType()
java.lang.String getDeviceId()
java.util.Map<java.lang.String,java.lang.Object> getProperties()
setProperty(String, Object)
and setProperties(Map, boolean) methods, as well as on the back end - by the Script Service
interpreting the execution.void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties,
boolean append)
throws ManagementException
properties - execution item properties.append - if true the supplied properties will be appended/added to any properties currently existing for
this execution item, otherwise any existing properties will be fully replaced by the supplied ones.ManagementException - if system error occurs.java.lang.Object getProperty(java.lang.String key)
key - property namevoid setProperty(java.lang.String key,
java.lang.Object value)
throws ManagementException
key - property name.value - property value.ManagementException - if system error occurs.void cancel()
throws ManagementException
ManagementException - if system error occurs.java.lang.String getRuleId()
java.lang.String getTaskId()
java.lang.String getTaskName()
Copyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.