Package de.danet.an.workflow.omgcore

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


  (Collection auditEvents){

  assertTrue(auditEvents.size()==4);
  SortedMap sorted = new TreeMap ();
  for (Iterator i = auditEvents.iterator(); i.hasNext();) {
      WfAuditEvent ae = (WfAuditEvent)i.next ();
      sorted.put (ae.timeStamp(), ae);
  }

  for (Iterator i = sorted.values().iterator(); i.hasNext();) {
      Object o = i.next();
      if (o instanceof WfCreateProcessAuditEvent) {
View Full Code Here


  process = createProcess("ut-procdef-audit", "auditTest2", req);
  String procKey = process.key();
  assertTrue(process!=null);
  process.start ();

  WfAuditEvent e = null;
  while (true) {
            e = subs.receive(5000);
            assertTrue ("Timeout receiving event", e != null);
      if (e.eventType().equals (WfAuditEvent.PROCESS_STATE_CHANGED)
    && e.processKey().equals (procKey)
    && ((WfStateAuditEvent)e).newState().startsWith ("closed")) {
    break;
      }
  }
        assertTrue (e instanceof ProcessClosedAuditEvent);
View Full Code Here

      });

  process.start ();

  while (true) {
      WfAuditEvent e = subs.receive(5000);
      assertTrue ("Timeout receiving event", e != null);
      if (e.eventType().equals (WfAuditEvent.PROCESS_STATE_CHANGED)
    && e.processKey().equals (procKey)
    && ((WfStateAuditEvent)e).newState().startsWith ("closed")) {
    break;
      }
  }
View Full Code Here

     * @param auditEvents the audit events to display
     */
    private void displayAuditEvents(Collection auditEvents){
  for (Iterator i = auditEvents.iterator(); i.hasNext();) {
      Object o = i.next();
      WfAuditEvent ae = (WfAuditEvent)o;
      System.err.println(" --------------------- ");
      System.err.println(" event type = " + ae.eventType());
      System.err.println(" time stamp = " + ae.timeStamp());
      System.err.println(" activity key = " + ae.activityKey());
      System.err.println(" activity name = " + ae.activityName());
      System.err.println(" process key = " + ae.processKey());
      System.err.println(" process name = " + ae.processName());
      System.err.println(" process manager name = "
             + ae.processMgrName());
      System.err.println(" process manager version = "
             + ae.processMgrVersion());
      if (o instanceof WfAssignmentAuditEvent){
    WfAssignmentAuditEvent aae =(WfAssignmentAuditEvent)o;
    System.err.println(" old resource key = "
           + aae.oldResourceKey());
    System.err.println(" new resource key = "
View Full Code Here

            try {
                if (eventSelection.equals("allEvents")
                    || eventSelection.equals("processEvents")) {
                    for (Iterator i = process().history().iterator();
                         i.hasNext();) {
                        WfAuditEvent evt = (WfAuditEvent)i.next();
                        evtList.add(new EventWrapper(evt));
                    }
                }
                if (eventSelection.equals("allEvents")) {
                    for (Iterator i = process().steps().iterator();
                         i.hasNext();) {
                        WfActivity act = (WfActivity)i.next();
                        for (Iterator j = act.history().iterator();
                            j.hasNext();) {
                            WfAuditEvent evt = (WfAuditEvent)j.next();
                            evtList.add(new EventWrapper(evt));                           
                        }
                    }
                } else if (!eventSelection.equals("processEvents")) {
                    try {
                        WfActivity act=process().activityByKey(eventSelection);
                        for (Iterator j = act.history().iterator();
                            j.hasNext();) {
                            WfAuditEvent evt = (WfAuditEvent)j.next();
                            evtList.add(new EventWrapper(evt));                           
                        }
                    } catch (InvalidKeyException e) {
                        logger.debug("Cannot find activity (ignored): "
                                     + eventSelection);
View Full Code Here

  State oldState = getPaTypedState();
  setPaLastStateTime (new Date());
  setPaTypedState (newState);
        int auditSel = getPaAuditEventSelection();
        // base event information
  WfAuditEvent event = auditEventBase
            ((this instanceof AbstractProcess)
             ? WfAuditEvent.PROCESS_STATE_CHANGED
             : WfAuditEvent.ACTIVITY_STATE_CHANGED);
        // Now add general or specific information to the event. Note that we
        // must always fire a state audit event if a process closes (see below),
View Full Code Here

     */
    public void onMessage(Message message) {
  WorkflowEngine wfe = null;
  try {
      Map args = (Map)((ObjectMessage)message).getObject();
      WfAuditEvent evt = (DefaultAuditEvent)args.get("event");
      try {
    engine().processEvent (evt);
       } catch (RedeliveryRequiredException e) {
    int requeued = 1;
    if (message.propertyExists("requeuedCount")) {
View Full Code Here

  Thread.sleep (500);
  boolean noneToJ = false;
  boolean jToM = false;
  boolean mToNone = false;
  for (Iterator i = act.history().iterator (); i.hasNext ();) {
      WfAuditEvent evt = (WfAuditEvent)i.next ();
      if (evt instanceof WfAssignmentAuditEvent) {
    WfAssignmentAuditEvent ae = (WfAssignmentAuditEvent)evt;
    if (ae.oldResourceName() == null
        && ae.newResourceName().equals ("ML")
        && !noneToJ) {
View Full Code Here

            // well, if there is nothing to append...
            return;
        }
        Iterator iterator = history.iterator();
        while (iterator.hasNext()) {
            WfAuditEvent event = (WfAuditEvent) iterator.next();

            String asapEventType = getAsapEventType(event);
            if (asapEventType == null) {
                continue;
            }
           
            SOAPElement eventNode
                = historyNode.addChildElement("Event", Consts.ASAP_PREFIX);
            Date date = event.timeStamp();
            SOAPElement timeNode
                = eventNode.addChildElement("Time", Consts.ASAP_PREFIX);
            timeNode.addTextNode(XMLUtil.toXsdGMTDateTime(date));
            SOAPElement type
                = eventNode.addChildElement("EventType", Consts.ASAP_PREFIX);
View Full Code Here

            // Now handle events
            WfXmlAuditHandler handler
                = new WfXmlAuditHandler (wfs, observerRegistry);
            while (running) {
                try {
                    WfAuditEvent event = eventSubscriber.receive();
                    handler.receiveEvent(event);
                } catch (Exception e) {
                    logger.warn
                        ("Cannot handle event (ignored): " + e.getMessage());
                }
View Full Code Here

TOP

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

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.