Figure 722 Set the Advanced Port Properties Reflecting the Component Characteristics

IIM KBI P-jyr.lfc-1.

i»? r+ +> h :++ s-h 1 —i


ill tuWC.


-i.fc-i ilrna. riiidin

■T Ul.HUBf

Ivul l" fr-m r bM r- Jxt r


1 jWUfllH. h-iSKH Ul-j> HiWii


7. You have reached the end of the wizard, and by clicking Finish, the wizard will create a port and a COM Component shape that can be used in the business flow. Remember, the port is still empty, since the XML Communication Wizard has not been run.

Now we get back to the noninstantiating COM component. Suppose you send out a message and the recipient of the message needs to send you a response.The question is, where should this message be dropped off? There are some issues: first, the recipient lives somewhere on the Internet; second, the communication is asynchronous and you expect a response somewhere down the flow; and third, this response should be delivered to this specific instance of the XLANG schedule instance, although more instances of the same XLANG schedule can exist at the same time.

The solution sounds simple: you tell the recipient the exact location that they can deliver the response. But how? This is where the fun part comes in.

■ You create a port in your XLANG schedule drawing, where you expect the documents to be delivered.

■ You make the schedule instance identifier (GUID) part of the //Reply-to field in the message. Remember, this GUID is part of every port reference.

■ You create an Active Server Page on your Web server that can intercept the reply and transfer it to the port.This means that the //Reply-to field also has to hold the HTTP address of this ASP—although HTTPS is better, security wise.The Reply-to might look something like this: host1!groupmgr1/{4CCA62DA-00ED-4418-8CE6-9ED3BDBDF3DC}. Note:The part to the right of "InstanceID=" is a moniker.

■ To do this, you need to create a component with a method that the ASP can call to hand over the moniker (InstanceId) and the document. Let's call this method HandOver.

■ Up to this point, it has been straightforward, but now we have to address the noninstantiated component.To do this, you create an empty method that has one string parameter that can be used to pass the document. Lets call this empty method ReceiverPort.

■ In the XLANG schedule drawing, you create a COM component port that has ReceiverPort selected as the method. Of course, before this, you have to register the component on your local system.

■ The method HandOver does the actual trick. Since ReceiverPort is a method turned port, you can address it by adding "/ReceiverPort" to the InstancelD, making it into the moniker of the port. HandOver can now access the port by calling:

oRcvPort = GetObject(InstanceID & "/ReceiverPort") oRcvPort.ReceiverPort(sDocument) 'passing the document.

This works, even though there is no code in the ReceiverPort function, and it does not have to be instantiated to be active. Two final remarks:

■ A port on a XLANG schedule diagram is in fact an interface to a component, which means that COM+ components can reference ports on your diagram directly.

■ In the preceding example, we used an ASP page, but there are more ways you can use this same technique of noninstantiated components; for example, using ISAPI, IBM MQSeries, or any other solution that can make a call to the noninstantiated component.

Was this article helpful?

0 0

Post a comment