Note: the following is best viewed with text editors which don't wrap around. Overview -------- This project contains collaboration templates and their corresponding business object definitions to enable: - split/join functionality (and-join only) - SPLIT -- given 3 target collaborations/connectors, the concurrentSend collaboration provides collab developers the ability to send out concurrent requests to these targets. - JOIN -- upon completion of all 3 concurrent pieces of work, control is returned back to the caller of the split join collaboration. Note that control is only returned after all the collaborations have completed (assuming no time-based constraints have been imposed on each split branch -- see below). - timer-restricted concurrent execution of requests - a timeout value can be associated with each request. If the request doesn't complete within the allotted timeframe, the user has an option to specify a compensating action to address any rollback requirements. Note that the compensation can go to a completely different connector than that specified for the forward progress action. Important usage notes: ---------------------- - For timer functionality, the concurrent send collaboration relies on a timer collaboration. To ensure proper timer behavior, please ensure that the timer collaboration is configured with enough threads so as to avoid unnecessary (and unaccounted for) waits in the timer collaboration input mailbox. - The concurrent send collaboration is intimately dependent on the testDestination collaboration. Yes, the name of the testDestination collab is a grievous misnomer. In any case, please use the concurrent send and the test destination collabs as a single unit. Otherwise, synchronization issues may result. In particular, note that the destination collab implements the compensation behavior described above. Step-by-step development instructions ------------------------------------- - Replace the 'sendItem' and the 'compensationItem' attribute datatypes (business object definitions) in the CS_BOWrapper business object definition with the business object definitions you want to use for forward progress (sendItem) and compensation (compensationItem). - Configure the collab you're going to use to invoke the concurrent send functionality with an outbound port that sends out CS_InputWrapper business objects. - Inside the invoking collab, fill out CS_InputWrapper as follows: a) for each of your forward progress business objects, create a CS_BOWrapper. b) for each such CS_BOWrapper, include the following information: b.1) boWrapperBusObj.setWithCreate("metaData.targetPort", destinationPort); where destinationPort is a String corresponding to one of the destination ports of the test destination collaboration (as shipped, these are "destinationPort1", "destinationPort2", and "destinationPort3"). b.2) boWrapperBusObj.setWithCreate("metaData.sendVerb", "Create"); "Create" is the verb used by the testDestination collab and is not the verb on the request business object. It is assumed that the request business object (the forward progress business object) contains the verb necessary for its invocation (same thing with the compensation business object, if provided). b.3) boWrapperBusObj.setWithCreate("metaData.TimeOut", longTimeOut); where longTimeOut is a long value which indicates the timeout value in milliseconds. -1 indicates that no timeout is specified. b.4) boWrapperBusObj.setWithCreate("metaData.sendItem", busObj); where busObj is the BusObj that you want to send out (your forward progress business object). b.5) boWrapperBusObj.setWithCreate("metaData.compensationItem", busObj); where busObj is the BusObj that you want to use as your compensation item should this particular service call times out. c) Each CS_BOWrapper should then be added to the busObjArray found in the sendList attribute of CS_InputWrapper. d) Send your CS_InputWrapper business object to a service call. You're done with the send part. Each item in the sendList will be executed concurrently and timed out as necessary. The service call will block for x milliseconds where x is the lesser of (max timeout specification) and (max forward service call invocation). e) Once the service calls have completed (or timed out), check the return status of each sendList item by looking at each item's return status (the following example checks the return status of the first element in the list): inputWrapperBusObj.getString("sendList[0].returnStatus"); Possible return status values are: - ok (success, no time out) - timed out (the request was timed out) - fail (in which case, the errorInfo attribute of the sendList item contains the error information ). Step-by-step configuration instructions --------------------------------------- - create one collaboration object from the concurrentSend template - create 3 collaboration objects from the testDestination template - create one collaboration object from the timer template - ensure that the timer template has sufficient threads to handle the expected work-load. - bind the collaborations as follows (where ports can be bound to connectors or collaborations): Binding Summary: / forward progress port 1 / testDestinationCollab1 - compensation port 1 / / forward progress port 2 calling collab --- concurrent send collab -- testDestinationCollab2 ---------------------------- | \ \ compensation port 2 | \ testDestinationCollab3 - forward progress port 3 | \ compensation port 3 timer collab Misc ---- Note that a timed out request does not imply that the request is terminated. In particular, since applications don't guarantee (and, for the most part, don't provide) cancel capabilities, in order to ensure that the target systems are not corrupted, timed out requests actually separately continue towards completion and apply the compensation action afterwards. That is right, even though the concurrentSend collab has already returned (due to a time out detected), the target collab will still continue to independently process the request. Furthermore, only after the completion of the forward progress request will the compensation be applied.