Class WorkflowAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Agent lets you configure workflow automation
Inheritance
object ← AgentBase ← WorkflowAgentImplements
IWorkflowAgent, IAgentBase, IDisposableInherited Members
AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T>(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()Examples
<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (WorkflowAgent agent = new WorkflowAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
WorkflowAgent(HttpClient)
Constructor: Agent lets you configure workflow automationParameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
WorkflowAgent(WebApiOptions, HttpClient)
Constructor: Agent lets you configure workflow automationParameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
AddAfterWorkflowStepAsync(int, WorkflowStepBase, RequestOptions)
Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.Parameters
workflowStepId int
Primary key of WorkflowStep
subStep WorkflowStepBase
The step to be inserted after given step id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowStepBase> The added stepConnectEmailFlowContentAsync(int, int, RequestOptions)
Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.Parameters
emailFlowId int
The EmailFlow to connect the message to.
messageId int
The s_message to connect to the flow. A shipment, form or flow may be connected to that s_message.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskCopyEmailFlowAsync(int, string, RequestOptions)
Copy an email flow.Parameters
emailFlowId int
The EmailFlow to copy.
newName string
The name of the new email flow
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> Newly created email flow id for this contentCopyEmailFlowContentAsync(int, int, RequestOptions)
Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.Parameters
emailFlowId int
The EmailFlow to connect the copied content to.
shipmentId int
The id of the shipment to copy to the flow. The message of this shipment will also be connected
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> Newly created shipment id for this contentCreateDefaultEmailFlowAsync(RequestOptions)
Set default values into a new EmailFlow. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<EmailFlow> A blank EmailFlowCreateDefaultWorkflowEventAsync(RequestOptions)
Set default values into a new WorkflowEvent. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowEvent> A blank WorkflowEventCreateDefaultWorkflowEventResultAsync(RequestOptions)
Set default values into a new WorkflowEventResult. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowEventResult> A blank WorkflowEventResultCreateDefaultWorkflowFilterAsync(RequestOptions)
Set default values into a new WorkflowFilter. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowFilter> A blank WorkflowFilterCreateDefaultWorkflowGoalAsync(RequestOptions)
Set default values into a new WorkflowGoal. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowGoal> A blank WorkflowGoalCreateDefaultWorkflowStepFromTypeAsync(WorkflowStepType, RequestOptions)
Creates a new carrier from the step type given, with the right kind of properties, defaults set.Parameters
stepType WorkflowStepType
Step type to create
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowStepBase>CreateDefaultWorkflowStepOptionFromTypeAsync(WorkflowSplitOptionType, RequestOptions)
Creates a new carrier from the option type given, with the right kind of properties, defaults set.Parameters
optionType WorkflowSplitOptionType
Option type to create
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowStepOptionBase>CreateDefaultWorkflowTriggerAsync(RequestOptions)
Set default values into a new WorkflowTrigger. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowTrigger> A blank WorkflowTriggerCreateDefaultWorkflowWaitForActionAsync(RequestOptions)
Set default values into a new WorkflowWaitForAction. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowWaitForAction> A blank WorkflowWaitForActionCreateEmailFlowContentAsync(int, string, RequestOptions)
Create content to an email flowParameters
emailFlowId int
The EmailFlow to connect the created message to.
contentName string
The name of the content created
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> Id of shipment createdDeleteEmailFlowAsync(int, RequestOptions)
Deletes the EmailFlowParameters
emailFlowId int
The identity of the EmailFlow
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskDeleteWorkflowGoalAsync(int, RequestOptions)
Deletes the WorkflowGoalParameters
workflowGoalId int
The identity of the WorkflowGoal
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskDeleteWorkflowTriggerAsync(int, RequestOptions)
Deletes the WorkflowTriggerParameters
workflowTriggerId int
The identity of the WorkflowTrigger
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskDeleteWorkflowWaitForActionAsync(int, RequestOptions)
Deletes the WorkflowWaitForActionParameters
workflowWaitForActionId int
The identity of the WorkflowWaitForAction
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskGetEmailFlowAsync(int, RequestOptions)
Gets a specific EmailFlow object.Parameters
emailFlowId int
The identifier of the EmailFlow object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<EmailFlow> EmailFlowGetWorkflowFencingInfoAsync(RequestOptions)
Get the current Workflow fencing status for the tenantParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<FencingInfo> Current fencing status including count, maximum, and warning stateGetWorkflowGoalAsync(int, RequestOptions)
Gets a specific WorkflowGoal object.Parameters
workflowGoalId int
The identifier of the WorkflowGoal object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowGoal> WorkflowGoalGetWorkflowStepAsync(int, RequestOptions)
Get Workflowstep by IDParameters
workflowStepId int
Primary key of WorkflowStep
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowStepBase> The Workflow stepGetWorkflowStepOptionAsync(int, RequestOptions)
Get WorkflowStepOption by IDParameters
workflowStepOptionId int
Primary key of WorkflowStep option
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowStepOptionBase> The Workflow step optionGetWorkflowTriggerAsync(int, RequestOptions)
Gets a specific WorkflowTrigger object.Parameters
workflowTriggerId int
The identifier of the WorkflowTrigger object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowTrigger> WorkflowTriggerGetWorkflowWaitForActionAsync(int, RequestOptions)
Gets a specific WorkflowWaitForAction object.Parameters
workflowWaitForActionId int
The identifier of the WorkflowWaitForAction object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowWaitForAction> WorkflowWaitForActionRemoveParticipantsFromEmailFlowAsync(int, int[], RequestOptions)
Remove participants (actually workflow instances) from the workflowParameters
emailFlowId int
Primary key of EmailFlow
workflowInstanceIds int[]
Array of Workflow instances (representing participants) to be completely removed from the workflow
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskRunAsync(RequestOptions)
Run the workflow engine right nowParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<DateTime> Suggested time for next runSaveEmailFlowAsync(EmailFlow, RequestOptions)
Updates the existing EmailFlow or creates a new EmailFlow if the id parameter is 0.Parameters
emailFlow EmailFlow
The EmailFlow that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<EmailFlow> New or updated EmailFlowSaveWorkflowGoalAsync(WorkflowGoal, RequestOptions)
Updates the existing WorkflowGoal or creates a new WorkflowGoal if the id parameter is 0.Parameters
workflowGoal WorkflowGoal
The WorkflowGoal that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowGoal> New or updated WorkflowGoalSaveWorkflowTriggerAsync(WorkflowTrigger, RequestOptions)
Updates the existing WorkflowTrigger or creates a new WorkflowTrigger if the id parameter is 0.Parameters
workflowTrigger WorkflowTrigger
The WorkflowTrigger that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowTrigger> New or updated WorkflowTriggerSaveWorkflowWaitForActionAsync(WorkflowWaitForAction, RequestOptions)
Updates the existing WorkflowWaitForAction or creates a new WorkflowWaitForAction if the id parameter is 0.Parameters
workflowWaitForAction WorkflowWaitForAction
The WorkflowWaitForAction that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowWaitForAction> New or updated WorkflowWaitForActionSendEventAsync(WorkflowEvent, RequestOptions)
Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instanceParameters
workflowEvent WorkflowEvent
Information about the signaled event
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowEventResult> Any relevant info about the eventSetStatusOnWorkflowAsync(int, WorkflowDefinitionStatus, RequestOptions)
Set status on workflow, Run or pause flowParameters
emailFlowId int
The id of the email flow to run or pause
status WorkflowDefinitionStatus
The new status
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<WorkflowDefinitionStatus> The new statusTryAddPersonsToEmailFlowAsync(int, int[], RequestOptions)
Try to add a participant to the EmailFlow. Same function available in PersonAgentParameters
emailFlowId int
Primary key of EmailFlow
personIds int[]
Array of Person Ids
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool[]> True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reasonUpdateFormSubmissionsAsync(int, RequestOptions)
Attempt to update stored field values for up to the given number of form submissionsParameters
maxCount int
The maximum number of form submissions to attempt to save as form field values.
requestOptions RequestOptions
Override language/culture codes on this request.