Class WorkResponse
The response sent by a worker back to the system when work is completed.
public class WorkResponse
- Inheritance
-
objectWorkResponse
- Derived
-
WorkResponse<T>
Constructors
WorkResponse()
public WorkResponse()
WorkResponse(WorkResponseStatus)
public WorkResponse(WorkResponseStatus status)
Parameters
status
WorkResponseStatus
WorkResponse(WorkResponseStatus, LogEntryLevel, string)
public WorkResponse(WorkResponseStatus status, LogEntryLevel logEntryLevel, string message)
Parameters
status
WorkResponseStatuslogEntryLevel
LogEntryLevelmessage
string
WorkResponse(WorkResponseStatus, ResponseLogEntry)
public WorkResponse(WorkResponseStatus status, ResponseLogEntry message)
Parameters
status
WorkResponseStatusmessage
ResponseLogEntry
Properties
JobExternalId
External Id of the Job this response represents.
public Guid JobExternalId { get; set; }
Property Value
Messages
Response messages. These are persisted in the primary JobFlow database for debugging and tracing.
public List<ResponseLogEntry> Messages { get; set; }
Property Value
Properties
Additional properties to be sent in the response.
public Dictionary<string, string> Properties { get; set; }
Property Value
ResponseData
Additional data that can be used within the Flow rules.
public string ResponseData { get; set; }
Property Value
ResponseDataType
Type name for the class that the ResponseData is serialized from.
public string ResponseDataType { get; set; }
Property Value
Remarks
If this is not null or empty and ResponseData is not null or empty, then the implementation for IWorkResponseMessageHandler will convert this WorkResponse to an instance of WorkResponse<T> based on the type specified in this property.
For example, if this property is set to "MyProject.MyType", then this class will be converted to an instance of WorkResponse<MyType%gt; before being passed to the Flow processing engine. In this case, the property ResponseDataObject will contain the deserialized object.
Status
Response status.
public WorkResponseStatus Status { get; set; }
Property Value
Methods
FromRequest(IWorkRequest, WorkResponseStatus, params ResponseLogEntry[])
Generate a response message from the original incoming request.
public static WorkResponse FromRequest(IWorkRequest jobModel, WorkResponseStatus status = WorkResponseStatus.Success, params ResponseLogEntry[] messages)
Parameters
jobModel
IWorkRequeststatus
WorkResponseStatusmessages
ResponseLogEntry[]
Returns
FromRequest<D>(IWorkRequest, D, WorkResponseStatus, params ResponseLogEntry[])
Generate a response message from the original incoming request. Allows specifying a return data object.
public static WorkResponse<D> FromRequest<D>(IWorkRequest jobModel, D data, WorkResponseStatus status = WorkResponseStatus.Success, params ResponseLogEntry[] messages) where D : class
Parameters
jobModel
IWorkRequestdata
Dstatus
WorkResponseStatusmessages
ResponseLogEntry[]
Returns
- WorkResponse<D>
Type Parameters
D
SetResponseData<T>(T)
public void SetResponseData<T>(T value)
Parameters
value
T
Type Parameters
T
WithData(object)
public static WorkResponse WithData(object data)
Parameters
data
object