Package de.danet.an.workflow.omgcore

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


      } else if (o instanceof WfDataAuditEvent){
    WfDataAuditEvent dae =(WfDataAuditEvent)o;
    System.err.println(" old data = " + dae.oldData());
    System.err.println(" new data = " + dae.newData());
      } else if (o instanceof WfStateAuditEvent){
    WfStateAuditEvent sae =(WfStateAuditEvent)o;
    System.err.println(" old state = " + sae.oldState());
    System.err.println(" new state = " + sae.newState());
      }
  }     
    }
View Full Code Here


  try {
      if (event instanceof ImplCompleteAuditEvent) {
    handleImplCompletedEvent ((ImplCompleteAuditEvent)event);
    return;
      }
      WfStateAuditEvent evt = (WfStateAuditEvent)event;
      State oldState = State.fromString (evt.oldState());
      State newState = State.fromString (evt.newState());
      if (oldState.isSameOrSubState(NotRunningState.NOT_STARTED)) {
    if (newState == RunningState.RUNNING) {
        handleStartedEvent (evt);
        return;
    }
View Full Code Here

                // The old state is not defined, and we are not allowed to
                // add an empty string.
                oldState = "open.notrunning";
                newState = "open.notrunning";
            } else {
                WfStateAuditEvent stateEvent = (WfStateAuditEvent) event;
                oldState = StateMapper.omg2asapState(stateEvent.oldState());
                newState = StateMapper.omg2asapState(stateEvent.newState());
            }
            SOAPElement oldStateNode
                = eventNode.addChildElement("OldState", Consts.ASAP_PREFIX);
            oldStateNode.addTextNode(oldState);
            SOAPElement newStateNode
View Full Code Here

      eventData4 = ev.pProcessMgrName();
      eventData5 = ev.pProcessMgrVersion();
  } else if (event instanceof WfDataAuditEvent){
      eventData1 = Long.toString (recKey);
  } else if (event instanceof WfStateAuditEvent){
      WfStateAuditEvent ev = (WfStateAuditEvent)event;
      eventData1 = ev.oldState();
      eventData2 = ev.newState();
  }
  prepStmt.setString (offset++, eventData1);
  prepStmt.setString (offset++, eventData2);
  prepStmt.setString (offset++, eventData3);
        prepStmt.setString (offset++, eventData4);
View Full Code Here

        String type = event.eventType();
        if (!type.equals(WfAuditEvent.PROCESS_STATE_CHANGED)) {
            return;
        }
       
        WfStateAuditEvent stateEvent = (WfStateAuditEvent) event;
       
        String mgrName = stateEvent.processMgrName();
        String[] ids = mgrName.split("/");
        String packageId = ids[0];
        String processId = ids[1];
        String processKey = stateEvent.processKey();

        Collection observers;
        try {
            observers = observerRegistry.getObservers(packageId, processId, processKey);
        } catch (SQLException sqle) {
            logger.warn("error retrieving observer list", sqle);
            return;
        }

        for (Iterator iterator=observers.iterator(); iterator.hasNext();) {
            ObserverInfo observerInfo = (ObserverInfo)iterator.next();
            ResourceReference resRef = new ResourceReference
                (observerInfo.getSenderBase(),
                 packageId, processId, event.processKey());
            InstanceResponseGenerator irg = new InstanceResponseGenerator
                (observerRegistry, workflowService, resRef);
            try {
                sendStateChanged
                    (observerInfo.getObserverKey(), irg, stateEvent);
                if (stateEvent instanceof ProcessClosedAuditEvent) {
                    ProcessData result
                            = ((ProcessClosedAuditEvent)stateEvent).result();
                    sendCompleted (observerInfo.getObserverKey(), irg, result);
                }
            } catch (IllegalStateException e) {
                logger.warn ("Problem sending event to "
                        + observerInfo.getObserverKey() + ": "
                        + e.getMessage(), e);
                try {
                    observerRegistry.unsubscribe(observerInfo.getObserverKey());
                } catch (SQLException ee) {
                    logger.warn("error removing observer", ee);
                    return;
                }
            }
        }
       
        // Do some cleanup if the process is no more available.
        if (stateEvent.newState().startsWith("closed")) {
            try {
                observerRegistry.unsubscribe(packageId, processId, processKey);
            } catch (SQLException e) {
                logger.warn("error unsubscribing observer", e);
                return;
View Full Code Here

TOP

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

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.