Port COM Proxy

This section examines the interface exposed by the COM proxy for the Port object. You can acquire a reference to this object either through the IWFWorkflowInstance.Port property or through a port moniker string you have received from another application.

In Visual Basic, the type library for this object is SkedCore.dll, the same as that for the group manager and schedule instance earlier.

Through this COM proxy, you can QI for an interface implemented by the component for which this is a proxy. However, you can only QI for the interface actually used by the XLANG schedule. If the component has implemented other interfaces, the proxy does not expose them.

After you have a reference to the interface, and the port is set up to receive a message, then you can call a method on that interface. The method call is intercepted by the engine before passing the call to the component. This provides a mechanism to pass messages programmatically into a schedule.

The properties described in this section are those of the proxy itself and not of the interfaces of the component for which this object is the proxy.

The following code fragments illustrate how to get a reference to the port proxy and then how to use the proxy to make a method call on the component. In the following code, oComp is an interface of the COM component bound to MyPort:

Dim oPort As COMRUNTIME.IWFProxy 
Set oPort = GetObject("sked:///{4607B374-C0BB-40F0-909D-355C1951F774}/MyPort")
Dim oComp As MyProgID.MyClass
Set oComp = oPort
oComp.MyMethod

The properties of a port COM proxy are described in this section. There are no methods for this object. Table 11.7 summarizes the properties a port proxy.

Table 11.7. Properties of Port COM Proxy
PropertyDescription
FullyQualifiedNameMoniker for the port instance
WorkFlowInstanceInterface of the schedule instance containing this port

Each property is described in the order listed in Table 11.7. The property is identified with a bolded label; this is followed by a signature and a description.

Property FullyQualifiedName

Property FullyQualifiedName As String 

The property FullyQualifiedName returns a string (example below), which contains a moniker for the port instance for which this object is the proxy:

sked://MyMachine!XLANG Scheduler/{7F4BE554-1698-4FDE-9FFB-4B58C21EB033}/MyPort 

The moniker can be used in a GetObject call to get a reference to the proxy as long as the schedule is not terminated.

This is a read-only property.

Property WorkflowInstance

Property WorkflowInstance As IWFWorkflowInstance 

The property WorkflowInstance returns an interface to the XLANG schedule instance that has implemented the component for which object is the proxy. You would use this property to locate the schedule instance if you had an object reference to the proxy.

This is a read-only property.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset