By making the registering Observer Gateway object a form of manager work item

By making the registering observer gateway object a

This preview shows page 48 - 50 out of 100 pages.

By making the registering Observer Gateway object a form of “manager”, work item requests can be analysed and the work delegated to some other object or even external system. The routing can be performed by parsing the full URL path defined against the work item, or even by inspection of the XML data associated with the work item (this being available once the work item has been checked-out of the runtime - and hence moved from the “enabled” state to the “executing” state). Page 48 of 100
Image of page 48
1 public i n t e r f a c e ObserverGateway { 2 3 String getScheme () ; 4 5 void announceWorkItems ( 6 Announcements < NewWorkItemAnnouncement > announcements ) ; 7 8 void cancelAllWorkItemsInGroupOf ( 9 Announcements < CancelWorkItemAnnouncement > announcements ) ; 10 11 void announceTimerExpiry ( YAWLServiceReference yawlService , YWorkItem item ) ; 12 13 void announceCaseCompletion ( YAWLServiceReference yawlService , 14 Y I d e n t i f i e r caseID , Document casedata ) ; 15 16 void announceCaseCompletion ( Y I d e n t i f i e r caseID , Document casedata ) ; 17 18 void announceCaseSuspended ( Y I d e n t i f i e r caseID ) ; 19 20 void announceCaseSuspending ( Y I d e n t i f i e r caseID ) ; 21 22 void announceCaseResumption ( Y I d e n t i f i e r caseID ) ; 23 24 void announceWorkItemStatusChange (YWorkItem workItem , 25 YWorkItemStatus oldStatus , YWorkItemStatus newStatus ) ; 26 27 void announceEngineInitialised ( Set < YAWLServiceReference > s e r v i c e s ) ; 28 29 void announceCaseCancellation ( Set < YAWLServiceReference > s e r v i c e s , Y I d e n t i f i e r id ) ; 30 31 void shutdown () ; Listing 5.1: The Observer Gateway Interface If we take the earlier URL examples, the use of a manager allows us for example to route all work requests for the “sales” domain to an external non-Java based system via some JNI wrapper interface. Work requests for the “inventory” domain however could be routed via a JMS interface to some external Java based application. Internally within the Engine, all calls to register an object implementing the ObserverGateway interface result in a callback reference being stored within a table, and therefore many Observer Gateway objects can register with the Engine. When the Engine enables a new workitem, the atomic task definition associated with that workitem is examined and any associated custom service URL is extracted. The ObserverGatewayController within the Engine then examines all registered Observer Gateways, and if the URL scheme matches, a callback is invoked to inform all gateways for the given scheme (e.g. http) announcing the new workitem. 5.5.1 The ObserverGateway Interface The customer service manager or custom service itself (if no manager class is being utilised, must implement the org.yawlfoundation.yawl.engine.ObserverGateway interface. The interface is shown for YAWL 2.1 release is shown in Listing 5.1.
Image of page 49
Image of page 50

You've reached the end of your free preview.

Want to read all 100 pages?

  • Spring '17
  • Sui
  • yawl

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes