Table of Contents

Class WorkResponse

Namespace
JobFlow.Models.Jobs
Assembly
JobFlow.Models.dll

The response sent by a worker back to the system when work is completed.

public class WorkResponse
Inheritance
object
WorkResponse
Derived

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 WorkResponseStatus
logEntryLevel LogEntryLevel
message string

WorkResponse(WorkResponseStatus, ResponseLogEntry)

public WorkResponse(WorkResponseStatus status, ResponseLogEntry message)

Parameters

status WorkResponseStatus
message ResponseLogEntry

Properties

JobExternalId

External Id of the Job this response represents.

public Guid JobExternalId { get; set; }

Property Value

Guid

Messages

Response messages. These are persisted in the primary JobFlow database for debugging and tracing.

public List<ResponseLogEntry> Messages { get; set; }

Property Value

List<ResponseLogEntry>

Properties

Additional properties to be sent in the response.

public Dictionary<string, string> Properties { get; set; }

Property Value

Dictionary<string, string>

ResponseData

Additional data that can be used within the Flow rules.

public string ResponseData { get; set; }

Property Value

string

ResponseDataType

Type name for the class that the ResponseData is serialized from.

public string ResponseDataType { get; set; }

Property Value

string

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

WorkResponseStatus

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 IWorkRequest
status WorkResponseStatus
messages ResponseLogEntry[]

Returns

WorkResponse

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 IWorkRequest
data D
status WorkResponseStatus
messages 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

Returns

WorkResponse