Workflow service

Webservice

The webservice is a WCF webservice which allows the clients to start and communicate with the workflows. The table below describes the operations available with the webservice.

Operation

Signature

Description

CreateWorkflowFromXml

Guid CreateWorkflowFromXml(string workflowData);

 

Creates a new workflow instance, based on the parameter workflowData.

The parameter must be loadable as strings in XmlDocument, and interpreted as a value of the type workflowCreationData.

CreateWorkflow

 

Guid CreateWorkflow(WorkflowCreationData workflowData);

Creates a new running workflow instance based on workflowCreationData.

The value returned is a unique identifier for the created workflow instance.

WorkflowCreationData contains specifications such as workflow type and version.

ResumeBookmark

BookmarkResumptionResult ResumeBookmark(Guid instanceId, string bookmarkName, object value);

This method is invoked by user actions in the client, or the expiration of a process. The parameters it needs is the workflow instance ID, the bookmark ID, and an object value, for example the ID of a proxy user.

The value returned indicates whether the call succeeded or not:
Success, NotFound, NotReady.

GetWorkflowStatus WorkflowStatus GetWorkflowStatus(Guid instanceId);

The value returned is the current status of the workflow: Created, Running, Persisted, Completed or Faulted.


Host

The table below describes the operations available with the host.

Operation

Signature

Description

CreateWorkflowFromXml

Guid CreateWorkflowFromXml(string workflowData, sjSession session);

 

Creates a new workflow instance, based on the parameter workflowData. It must be loadable as strings in XmlDocument, and interpreted as a value of the type workflowCreationData.

The parameter session is an impersonated SOM session.

CreateWorkflow

 

Guid CreateWorkflow(WorkflowCreationData workflowData, sjSession session);

Creates a new running workflow instance based on workflowCreationData.

The value returned is a unique identifier for the created workflow instance.

WorkflowCreationData contains specifications such as workflow type and version.

The parameter session is an impersonated SOM session.

CreateWorkflow

Guid CreateWorkflow(WorkflowCreationData workflowData, sjSession session, Action<WorkflowApplicationCompletedEventArgs> CompletedCallback)

 

 

The same as the previous CreateWorkflow, but it also includes the paramters CompletedCallback which is called when the workflow is completed.

ResumeBookmark

BookmarkResumptionResult ResumeBookmark(Guid instanceId, string bookmarkName, object value, sjSession session);

This method is invoked by user actions in the client, or the expiration of a process. The parameters it needs is the workflow instance ID, the bookmark ID, and an object value, for example the ID of a proxy user.

The parameter session is an impersonated SOM session.

The value returned indicates whether the call succeeded or not:
Success, NotFound, NotReady.

ResumeBookmark

BookmarkResumptionResult ResumeBookmark(Guid instanceId, string bookmarkName, object value, sjSession session, Action<WorkflowApplicationCompletedEventArgs> CompletedCallback)

The same as the previous ResumeBookmark, but it also includes the parameter CompletedCallback which is called when the workflow is completed.

GetWorkflowStatus

WorkflowStatus GetWorkflowStatus(Guid instanceId);

The value returned is the current status of the workflow: Created, Running, Persisted, Completed or Faulted.

Initialize

void Initialize(sjSession session)

Initializes the workflow host and loads the data from the db which is necessary for creating workflows. Creates workflow descriptors, that is, the known workflows in the database, type, version, and XAML that describes the workflow types as an internal data structure.

In addition, it sets up timers for pending timeouts in currently persisted workflows.

GetOutputs

IDictionary<string, object> GetOutputs(Guid instanceId, sjSession session)

Gets the output argument IDictionary<string, object> for a given completed workflow instance.

Limitation: outputs can only be gotten for workflows which have been completed by this instance of the workflow host. In all other cases, null will be returned. The reason is that this type of output is not stored in the database.

GetWorkflowInformation

RunningWorkflowInformation GetWorkflowInformation(Guid instanceId, sjSession session)

Returns all available information on a workflow instance.

 

GetKnownWorkflows

IEnumerable<WorkflowType> GetKnownWorkflows

Gets all workflow types available, that is, those workflow types where the host is able to create workflow instances.

InjectWorkflowDescriptor

void InjectWorkflowDescriptor(Activity activity, sjSession session)

Makes an activity known to the workflow host, so that workflow instances can be created from it.

The parameter activity is the workflow which is to be made known to the host.

session is a SOM session.

InjectWorkflowDescriptor

void InjectWorkflowDescriptor(string xaml, string typeName, Version version, sjSession session)

Makes a workflow described by XAML known to the workflow host, so that workflow instances can be created from it.

The parameter xaml is the XAML string, typeName is the type name by which the workflow is to be known. version is the versionm, andsession is a SOM session.

Interface types

The interface types are represented by classes. Below, these classes are described:

WorkflowCreationData

public WorkflowType WorkflowType { get; private set; }

WorkflowType gets the workflow type.

 

public string WorkflowTitle { get; private set; }

WorkflowTitle gets the workflow title.

 

public string WorkflowParent { get; private set; }

WorkflowParent gets the parent workflow?

 

public string ProcessId { get; private set; }

ProcessID gets the ID of the running process.

 

public string Description { get; private set; }

Description gets the description of the process.

 

public string AssociatedRegister { get; private set; }

AssociatedRegister gets the name of the case register, record (document), contact or address.

 

public string AssociatedRegisterKey { get; private set; }

AssociatedRegisterKey gets the register key.

 

public DateTime EndDate { get; private set; }

EndDate gets the workflow end date.

 

public IDictionary<string, object> Arguments { get; private set; }

IDictionary gets the values of the workflow in arguments.

 

WorkflowStatus

The table describes the values that WorkflowStatus can get:

Value

Description

Created

The workflow instance has been created but is not yet running.

Running

The workflow instance is running.

Persisted

The workflow instance is idle and persisted.

Completed

The workflow instance is completed.

Faulted

The workflow instance has been terminated by an unhandled exception.

RunningWorkflowInformation

public WorkflowDescriptor Descriptor { get; }

Descriptor gets the descriptor of a running workflow. See description of WorkflowDescriptor.

 

public string Owner { get; }

Owner gets the name code of the process owner.

 

public WorkflowStatus Status { get; }

Status gets the status of the workflow. See description of WorkflowStatus.

 

public Exception ExceptionThrown { get; }

ExceptionThrown gets the exception description when the workflow is faulted.

 

public IDictionary<string, object> Outputs { get; }

IDictionary<string, object> gets the output argument for a given completed workflow instance.

 

public DateTime PendingTimerExpiration { get; }

PendingTimerExpiration gets the expiration date and time of a pending workflow, if a timer is running for the workflow.

 

public bool TimerRunning { get; private set; }

TimerRunning tells if there is a timer on the workflow, and if it is not yet expired.

 

public string ServerName { get; private set; }

ServerName gets the name of the server that the host will be running on if the timer on the workflow expires.

WorkflowDescriptor

public Activity WorkflowType { get; private set; }

WorkflowType gets the workflow type as a .NET System.Activities.Activity.

 

public Version Version { get; private set; }

Version gets the version of the workflow as a .NET System.Version.

 

public string WorkflowKey { get; private set; }

WorkflowKey gets the key in the workflow register.

 

public string AssemblyKey { get; private set; }

AssemblyKey gets the workflow assembly key in the workflow_assembly register.

 

WorkflowType

public string TypeName { get; private set; }

TypeName gets the name of the workflow type.

 

public Version Version { get; private set; }

Version gets the version of the workflow.