Package de.danet.an.workflow.omgcore

Examples of de.danet.an.workflow.omgcore.WfAuditHandler


  assertTrue(process != null);

  // additional subscribers
  final int[] counters = new int[5];
  EventSubscriber subsAll = workflowService().createEventSubscriber ();
  subsAll.setEventHandler(new WfAuditHandler () {
    public void receiveEvent (WfAuditEvent e) {
        counters[0] += 1;
    }
      });
  EventSubscriber subsProc = workflowService()
      .createEventSubscriber (procKey, null);
  subsProc.setEventHandler(new WfAuditHandler () {
    public void receiveEvent (WfAuditEvent e) {
        counters[1] += 1;
    }
      });
  EventSubscriber subsPSC = workflowService().createEventSubscriber
      (procKey, WfAuditEvent.PROCESS_STATE_CHANGED);
  subsPSC.setEventHandler(new WfAuditHandler () {
    public void receiveEvent (WfAuditEvent e) {
        assertTrue (e.eventType().equals
        (WfAuditEvent.PROCESS_STATE_CHANGED));
        counters[2] += 1;
    }
      });
  EventSubscriber subsASC = workflowService().createEventSubscriber
      (procKey, WfAuditEvent.ACTIVITY_STATE_CHANGED);
  subsASC.setEventHandler(new WfAuditHandler () {
    public void receiveEvent (WfAuditEvent e) {
        assertTrue (e.eventType().equals
        (WfAuditEvent.ACTIVITY_STATE_CHANGED));
        counters[3] += 1;
    }
      });
  EventSubscriber subsPASC = workflowService().createEventSubscriber
      (procKey, WfAuditEvent.PROCESS_STATE_CHANGED
       + ", " + WfAuditEvent.ACTIVITY_STATE_CHANGED);
  subsPASC.setEventHandler(new WfAuditHandler () {
    public void receiveEvent (WfAuditEvent e) {
        assertTrue (e.eventType().equals
        (WfAuditEvent.PROCESS_STATE_CHANGED)
        || e.eventType().equals
        (WfAuditEvent.ACTIVITY_STATE_CHANGED));
View Full Code Here


        (new IOException (e.getMessage())).initCause (e);
      }
  }

  public void setEventHandler (WfAuditHandler hndlr) throws IOException {
      final WfAuditHandler handler = hndlr;
      try {
    subs.setMessageListener (new MessageListener () {
      public void onMessage (Message msg) {
          Object e = null;
          try {
        e = ((ObjectMessage)msg).getObject();
        if (logger.isDebugEnabled()) {
            logger.debug
          ("EventSubscriber " + this
           + " received " + e
           + " with processKey="
           + msg.getStringProperty("processKey")
           + " and eventType="
           + msg.getStringProperty("eventType"));
        }
        handler.receiveEvent((WfAuditEvent)e);
          } catch (JMSException ex) {
        logger.error (ex.getMessage (), ex);
          } catch (InvalidPerformerException ex) {
        // deliberatly ignored.
          } catch (RemoteException ex) {
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.omgcore.WfAuditHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.