ICustomFlow Interface
The interface that an implementer of a flow would need to implement in their executable assembly for their flow to participate in the system.
/// <summary>
/// Interface defining a set of methods /// used in a Custom Flow implementation. /// </summary>
public interface ICustomFlow : IDisposable
{
/// <summary>
/// Called when the Flow is initialized and all properties are available. /// </summary>
/// <param name="model">
/// A class that provides access to both the Generic session as well as /// access to the Flows properties that are managed by the base flow /// <see cref="ITaskModel" />
/// </param>
void Initialize(ITaskModel model);
/// <summary>
/// Called when the Flow is Executed. /// </summary>
/// <param name="token">
/// The Cancellation token. this should be checked during long running /// Flows to see if a cancellation has been requested. occurres during a /// Task.Dispose operation.
/// </param>
void Execute(CancellationToken token);
/// <summary>
/// Called when a Flows property value has been modified from the server. /// </summary>
/// <param name="property">The Modified property <see cref="BaseProperty"/> </param> void PropertyChanged(BaseProperty property);
}
ITaskModel Interface
The ITaskModel interface is passed to the executable assemply of a flow and gives the logic of the flow access to properties on the custom flow, and access to the information model of the system via a session object.
139 {
/// <summary>
/// Gets a value that provides access /// to the Generic Session
/// </summary>
IGenericSession Session { get; }
/// <summary>
/// gets a value that provides access to the /// Flows properties and their values.
/// </summary>
IProvideTaskProperty TaskProperties { get; } }
IProvideTaskProperty Interface
IProvideTaskProperty Interface is used by the execution logic of a flow to easily access properties on the custom flow allowing for reading and writing property values.
public interface IProvideTaskProperty
{
/// <summary>
/// Given a NodeId this method will return a property /// </summary>
/// <param name="nodeId">The property NodeId</param>
/// <returns>returns a Base Property if property matching NodeId is found else null</returns>
/// <example>
/// BaseProperty property = this.FindProperty(PropertyNodeId); /// </example>
BaseProperty FindProperty(NodeId nodeId);
/// <summary>
/// Given a property name this method will attempt to find a property with the given name /// this is a generic function and will return a specific type of property.
/// </summary>
/// <typeparam name="TType">The Type of property to return</typeparam> /// <param name="name">The Property Name</param>
/// <example>
/// StringProperty property = this.FindProperty<StringProperty>("MyStringProperty"); /// </example>
/// <returns></returns>
TType FindProperty<TType>(string name) where TType : BaseProperty;
/// <summary>
/// Given a NodeId this function will find the property and return the value /// </summary>
/// <param name="nodeId">The Property NodeId</param> /// <returns>The Property value as Object</returns> /// <example>
/// object value = this.GetPropertyValue(PropertyNodeId); /// </example>
object GetPropertyValue(NodeId nodeId);
/// <summary>
/// Given a NodeId this function will find the property and return the value
/// This is a Generic function and will attempt to cast the value to the specified type /// </summary>
/// <typeparam name="VType">The Value type</typeparam> /// <param name="name">The Name of the property</param>
140 /// <returns>The Property value</returns> /// <example>
/// string value = this.GetPropertyValue<string>("MyPropertyName") /// </example>
VType GetPropertyValue<VType>(string name); }
IGenericSession Interface
The IGenericSession Interface provides access to the information model of the Status Device loud system. It provides methods for reading and writing property values, reading history, making method calls and determining the status of the connection to the information model.
public interface IGenericSession
{
/// <summary>
/// Gets a value that specifies if /// the Session object is connected. /// </summary>
bool IsConnected { get; }
/// <summary>
/// Gets a value that indicates if this /// instance has been disposed.
/// </summary>
bool IsDisposed { get; }
/// <summary>
/// Performs a browse operation using the provided /// Requests using the Opc.Ua.Client.Session
/// </summary>
/// <param name="requests">The requests to browse</param>
/// <returns>Browse Responses for each individual request</returns>
IEnumerable<BrowseResponse> Browse(IEnumerable<BrowseRequest> requests, uint maxNumItemsPerRequest = 500);
/// <summary>
/// Performs a browse next operation using the provided
/// Requests using the Opc.Ua.Client.Session to get extra results /// </summary>
/// <param name="requests">The requests to browse with continuation tokens</param> /// <returns>Browse Responses for each individual request</returns>
IEnumerable<BrowseResponse> BrowseNext(IEnumerable<BrowseRequest> requests); /// <summary>
/// Method used to invoke server side methods. /// </summary>
/// <param name="requests">Collection of call requests to invoke on the server.</param> /// <returns>results of the server method invocation.</returns>
IEnumerable<CallResponse> Call(IEnumerable<CallRequest> requests);
/// <summary>
/// Method used to invoke server side methods. /// </summary>
/// <param name="request">call request to invoke on the server.</param> /// <returns>result of the server method invocation.</returns>
CallResponse Call(CallRequest request);
141 /// <summary>
/// performs a historical read operation against the specified node ids. /// </summary>
/// <param name="request"></param> /// <returns></returns>
HistoryReadResponse HistoryRead(HistoryReadRequest request);
/// <summary>
/// Performs a read operation using the provided /// requests using the Opc.Ua.Client.Session /// </summary>
/// <param name="requests">The requests to Read the value for</param> /// <returns>Read Response for each request.</returns>
IEnumerable<ReadResponse> Read(IEnumerable<ReadRequest> requests);
/// <summary>
/// Subscribes to the specified items /// </summary>
/// <param name="requests"></param> /// <returns></returns>
IEnumerable<SubscribeResponse> Subscribe(IEnumerable<SubscribeRequest> requests);
/// <summary>
/// Translates the provided StartingNode and Browse Path into a node id. /// </summary>
/// <param name="requests">a collection of Translate Requests</param> /// <returns>A collection of Translate Responses.</returns>
IEnumerable<TranslateResponse> TranslateBrowsePathToNodeId(IEnumerable<TranslateRequest> requests);
/// <summary>
/// Deletes Monitored items and the optional subscription. /// </summary>
/// <param name="requests"></param> /// <returns></returns>
IEnumerable<UnsubscribeRespose> Unsubscribe(IEnumerable<UnsubscribeRequest> requests);
/// <summary>
/// Performs a write operation using the provided requests /// </summary>
/// <param name="requests">A Collection of write requests.</param> /// <returns>A collection of write responses.</returns>
IEnumerable<WriteResponse> Write(IEnumerable<WriteRequest> requests); }
142