Class WorkflowAgent
Proxy class for the Workflow Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class WorkflowAgent : IWorkflowAgent, IAgent
Constructors
WorkflowAgent(IEmailFlowImplementation, IWorkflowEventImplementation, IWorkflowEventResultImplementation, IWorkflowFilterImplementation, IWorkflowGoalImplementation, IWorkflowStepBaseImplementation, IWorkflowStepOptionBaseImplementation, IWorkflowTriggerImplementation, IWorkflowWaitForActionImplementation, ISoRequestItemsAccessor)
Proxy class for the Workflow Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public WorkflowAgent(IEmailFlowImplementation emailFlowImplementation, IWorkflowEventImplementation workflowEventImplementation, IWorkflowEventResultImplementation workflowEventResultImplementation, IWorkflowFilterImplementation workflowFilterImplementation, IWorkflowGoalImplementation workflowGoalImplementation, IWorkflowStepBaseImplementation workflowStepBaseImplementation, IWorkflowStepOptionBaseImplementation workflowStepOptionBaseImplementation, IWorkflowTriggerImplementation workflowTriggerImplementation, IWorkflowWaitForActionImplementation workflowWaitForActionImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IEmailFlowImplementation | emailFlowImplementation | |
IWorkflowEventImplementation | workflowEventImplementation | |
IWorkflowEventResultImplementation | workflowEventResultImplementation | |
IWorkflowFilterImplementation | workflowFilterImplementation | |
IWorkflowGoalImplementation | workflowGoalImplementation | |
IWorkflowStepBaseImplementation | workflowStepBaseImplementation | |
IWorkflowStepOptionBaseImplementation | workflowStepOptionBaseImplementation | |
IWorkflowTriggerImplementation | workflowTriggerImplementation | |
IWorkflowWaitForActionImplementation | workflowWaitForActionImplementation | |
ISoRequestItemsAccessor | accessor |
WorkflowAgent(IEmailFlowImplementation, IWorkflowEventImplementation, IWorkflowEventResultImplementation, IWorkflowFilterImplementation, IWorkflowGoalImplementation, IWorkflowStepBaseImplementation, IWorkflowStepOptionBaseImplementation, IWorkflowTriggerImplementation, IWorkflowWaitForActionImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the Workflow Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public WorkflowAgent(IEmailFlowImplementation emailFlowImplementation, IWorkflowEventImplementation workflowEventImplementation, IWorkflowEventResultImplementation workflowEventResultImplementation, IWorkflowFilterImplementation workflowFilterImplementation, IWorkflowGoalImplementation workflowGoalImplementation, IWorkflowStepBaseImplementation workflowStepBaseImplementation, IWorkflowStepOptionBaseImplementation workflowStepOptionBaseImplementation, IWorkflowTriggerImplementation workflowTriggerImplementation, IWorkflowWaitForActionImplementation workflowWaitForActionImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type | Name | Description |
---|---|---|
IEmailFlowImplementation | emailFlowImplementation | |
IWorkflowEventImplementation | workflowEventImplementation | |
IWorkflowEventResultImplementation | workflowEventResultImplementation | |
IWorkflowFilterImplementation | workflowFilterImplementation | |
IWorkflowGoalImplementation | workflowGoalImplementation | |
IWorkflowStepBaseImplementation | workflowStepBaseImplementation | |
IWorkflowStepOptionBaseImplementation | workflowStepOptionBaseImplementation | |
IWorkflowTriggerImplementation | workflowTriggerImplementation | |
IWorkflowWaitForActionImplementation | workflowWaitForActionImplementation | |
ISoRequestItemsAccessor | accessor | |
IDebugUser | debugUser | |
IServiceCallsRepository | serviceCallsRepository |
Methods
AddAfterWorkflowStepAsync(int, WorkflowStepBase, CancellationToken)
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.
Declaration
public Task<WorkflowStepBase> AddAfterWorkflowStepAsync(int workflowStepId, WorkflowStepBase subStep, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowStepId | Primary key of WorkflowStep |
WorkflowStepBase | subStep | The step to be inserted after given step id. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowStepBase> | The added step |
ConnectEmailFlowContentAsync(int, int, CancellationToken)
Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
Declaration
public Task ConnectEmailFlowContentAsync(int emailFlowId, int messageId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The EmailFlow to connect the message to. |
int | messageId | The s_message to connect to the flow. A shipment, form or flow may be connected to that s_message. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
CopyEmailFlowAsync(int, string, CancellationToken)
Copy an email flow.
Declaration
public Task<int> CopyEmailFlowAsync(int emailFlowId, string newName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The EmailFlow to copy. |
string | newName | The name of the new email flow |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | Newly created email flow id for this content |
CopyEmailFlowContentAsync(int, int, CancellationToken)
Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
Declaration
public Task<int> CopyEmailFlowContentAsync(int emailFlowId, int shipmentId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The EmailFlow to connect the copied content to. |
int | shipmentId | The id of the shipment to copy to the flow. The message of this shipment will also be connected |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | Newly created shipment id for this content |
CreateDefaultEmailFlowAsync(CancellationToken)
Loading default values into a new EmailFlow. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<EmailFlow> CreateDefaultEmailFlowAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<EmailFlow> | New EmailFlow with default values |
CreateDefaultWorkflowEventAsync(CancellationToken)
Loading default values into a new WorkflowEvent. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowEvent> CreateDefaultWorkflowEventAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowEvent> | New WorkflowEvent with default values |
CreateDefaultWorkflowEventResultAsync(CancellationToken)
Loading default values into a new WorkflowEventResult. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowEventResult> CreateDefaultWorkflowEventResultAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowEventResult> | New WorkflowEventResult with default values |
CreateDefaultWorkflowFilterAsync(CancellationToken)
Loading default values into a new WorkflowFilter. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowFilter> CreateDefaultWorkflowFilterAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowFilter> | New WorkflowFilter with default values |
CreateDefaultWorkflowGoalAsync(CancellationToken)
Loading default values into a new WorkflowGoal. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowGoal> CreateDefaultWorkflowGoalAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowGoal> | New WorkflowGoal with default values |
CreateDefaultWorkflowStepFromTypeAsync(WorkflowStepType, CancellationToken)
Creates a new carrier from the step type given, with the right kind of properties, defaults set.
Declaration
public Task<WorkflowStepBase> CreateDefaultWorkflowStepFromTypeAsync(WorkflowStepType stepType, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowStepType | stepType | Step type to create |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowStepBase> |
CreateDefaultWorkflowStepOptionFromTypeAsync(WorkflowSplitOptionType, CancellationToken)
Creates a new carrier from the option type given, with the right kind of properties, defaults set.
Declaration
public Task<WorkflowStepOptionBase> CreateDefaultWorkflowStepOptionFromTypeAsync(WorkflowSplitOptionType optionType, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowSplitOptionType | optionType | Option type to create |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowStepOptionBase> |
CreateDefaultWorkflowTriggerAsync(CancellationToken)
Loading default values into a new WorkflowTrigger. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowTrigger> CreateDefaultWorkflowTriggerAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowTrigger> | New WorkflowTrigger with default values |
CreateDefaultWorkflowWaitForActionAsync(CancellationToken)
Loading default values into a new WorkflowWaitForAction. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<WorkflowWaitForAction> CreateDefaultWorkflowWaitForActionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowWaitForAction> | New WorkflowWaitForAction with default values |
CreateEmailFlowContentAsync(int, string, CancellationToken)
Create content to an email flow
Declaration
public Task<int> CreateEmailFlowContentAsync(int emailFlowId, string contentName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The EmailFlow to connect the created message to. |
string | contentName | The name of the content created |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | Id of shipment created |
DeleteEmailFlowAsync(int, CancellationToken)
Deletes the EmailFlow
Declaration
public Task DeleteEmailFlowAsync(int emailFlowId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The identity of the EmailFlow |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteWorkflowGoalAsync(int, CancellationToken)
Deletes the WorkflowGoal
Declaration
public Task DeleteWorkflowGoalAsync(int workflowGoalId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowGoalId | The identity of the WorkflowGoal |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteWorkflowTriggerAsync(int, CancellationToken)
Deletes the WorkflowTrigger
Declaration
public Task DeleteWorkflowTriggerAsync(int workflowTriggerId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowTriggerId | The identity of the WorkflowTrigger |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteWorkflowWaitForActionAsync(int, CancellationToken)
Deletes the WorkflowWaitForAction
Declaration
public Task DeleteWorkflowWaitForActionAsync(int workflowWaitForActionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowWaitForActionId | The identity of the WorkflowWaitForAction |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
GetEmailFlowAsync(int, CancellationToken)
Gets a EmailFlow object.
Declaration
public Task<EmailFlow> GetEmailFlowAsync(int emailFlowId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The identifier of the EmailFlow object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<EmailFlow> | EmailFlow |
GetWorkflowGoalAsync(int, CancellationToken)
Gets a WorkflowGoal object.
Declaration
public Task<WorkflowGoal> GetWorkflowGoalAsync(int workflowGoalId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowGoalId | The identifier of the WorkflowGoal object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowGoal> | WorkflowGoal |
GetWorkflowStepAsync(int, CancellationToken)
Get Workflowstep by ID
Declaration
public Task<WorkflowStepBase> GetWorkflowStepAsync(int workflowStepId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowStepId | Primary key of WorkflowStep |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowStepBase> | The Workflow step |
GetWorkflowStepOptionAsync(int, CancellationToken)
Get WorkflowStepOption by ID
Declaration
public Task<WorkflowStepOptionBase> GetWorkflowStepOptionAsync(int workflowStepOptionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowStepOptionId | Primary key of WorkflowStep option |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowStepOptionBase> | The Workflow step option |
GetWorkflowTriggerAsync(int, CancellationToken)
Gets a WorkflowTrigger object.
Declaration
public Task<WorkflowTrigger> GetWorkflowTriggerAsync(int workflowTriggerId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowTriggerId | The identifier of the WorkflowTrigger object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowTrigger> | WorkflowTrigger |
GetWorkflowWaitForActionAsync(int, CancellationToken)
Gets a WorkflowWaitForAction object.
Declaration
public Task<WorkflowWaitForAction> GetWorkflowWaitForActionAsync(int workflowWaitForActionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | workflowWaitForActionId | The identifier of the WorkflowWaitForAction object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowWaitForAction> | WorkflowWaitForAction |
RemoveParticipantsFromEmailFlowAsync(int, int[], CancellationToken)
Remove participants (actually workflow instances) from the workflow
Declaration
public Task RemoveParticipantsFromEmailFlowAsync(int emailFlowId, int[] workflowInstanceIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | Primary key of EmailFlow |
int[] | workflowInstanceIds | Array of Workflow instances (representing participants) to be completely removed from the workflow |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
RunAsync(CancellationToken)
Run the workflow engine right now
Declaration
public Task<DateTime> RunAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<DateTime> | Suggested time for next run |
SaveEmailFlowAsync(EmailFlow, CancellationToken)
Updates the existing EmailFlow or creates a new EmailFlow if the id parameter is empty
Declaration
public Task<EmailFlow> SaveEmailFlowAsync(EmailFlow emailFlow, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
EmailFlow | emailFlow | The EmailFlow that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<EmailFlow> | New or updated EmailFlow |
SaveWorkflowGoalAsync(WorkflowGoal, CancellationToken)
Updates the existing WorkflowGoal or creates a new WorkflowGoal if the id parameter is empty
Declaration
public Task<WorkflowGoal> SaveWorkflowGoalAsync(WorkflowGoal workflowGoal, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowGoal | workflowGoal | The WorkflowGoal that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowGoal> | New or updated WorkflowGoal |
SaveWorkflowTriggerAsync(WorkflowTrigger, CancellationToken)
Updates the existing WorkflowTrigger or creates a new WorkflowTrigger if the id parameter is empty
Declaration
public Task<WorkflowTrigger> SaveWorkflowTriggerAsync(WorkflowTrigger workflowTrigger, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowTrigger | workflowTrigger | The WorkflowTrigger that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowTrigger> | New or updated WorkflowTrigger |
SaveWorkflowWaitForActionAsync(WorkflowWaitForAction, CancellationToken)
Updates the existing WorkflowWaitForAction or creates a new WorkflowWaitForAction if the id parameter is empty
Declaration
public Task<WorkflowWaitForAction> SaveWorkflowWaitForActionAsync(WorkflowWaitForAction workflowWaitForAction, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowWaitForAction | workflowWaitForAction | The WorkflowWaitForAction that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<WorkflowWaitForAction> | New or updated WorkflowWaitForAction |
SendEventAsync(WorkflowEvent, CancellationToken)
Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance
Declaration
public Task<WorkflowEventResult> SendEventAsync(WorkflowEvent workflowEvent, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
WorkflowEvent | workflowEvent | Information about the signaled event |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowEventResult> | Any relevant info about the event |
SetStatusOnWorkflowAsync(int, WorkflowDefinitionStatus, CancellationToken)
Set status on workflow, Run or pause flow
Declaration
public Task<WorkflowDefinitionStatus> SetStatusOnWorkflowAsync(int emailFlowId, WorkflowDefinitionStatus status, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | The id of the email flow to run or pause |
WorkflowDefinitionStatus | status | The new status |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<WorkflowDefinitionStatus> | The new status |
TryAddPersonsToEmailFlowAsync(int, int[], CancellationToken)
Try to add a participant to the EmailFlow. Same function available in PersonAgent
Declaration
public Task<bool[]> TryAddPersonsToEmailFlowAsync(int emailFlowId, int[] personIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | emailFlowId | Primary key of EmailFlow |
int[] | personIds | Array of Person Ids |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<bool[]> | True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason |
UpdateFormSubmissionsAsync(int, CancellationToken)
Attempt to update stored field values for up to the given number of form submissions
Declaration
public Task<int> UpdateFormSubmissionsAsync(int maxCount, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | maxCount | The maximum number of form submissions to attempt to save as form field values. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | Number of form submissions converted |