Package com.almende.eve.entity.activity

Examples of com.almende.eve.entity.activity.Activity.withStatus()


              + duration + " ms");

          // duration does not match. adjust the end time
          endTime = startTime.plus(duration);
          activity.withStatus().setEnd(endTime.toString());
          activity.withStatus().setUpdated(DateTime.now().toString());

          changed = true;
        }
      }
    }
View Full Code Here


      }
    }
   
    // location constraints
    String newLocation = activity.withConstraints().withLocation().getSummary();
    String oldLocation = activity.withStatus().withLocation().getSummary();
    if (newLocation != null && !newLocation.equals(oldLocation)) {
      activity.withStatus().withLocation().setSummary(newLocation);
      changed = true;
    }
   
View Full Code Here

   
    // location constraints
    String newLocation = activity.withConstraints().withLocation().getSummary();
    String oldLocation = activity.withStatus().withLocation().getSummary();
    if (newLocation != null && !newLocation.equals(oldLocation)) {
      activity.withStatus().withLocation().setSummary(newLocation);
      changed = true;
    }
   
    if (changed) {
      // store the updated activity
View Full Code Here

    logger.info("syncEvents started");
    Activity activity = getActivity();

    boolean changed = false;
    if (activity != null) {
      String updatedBefore = activity.withStatus().getUpdated();

      for (Attendee attendee : activity.withConstraints().withAttendees()) {
        String agent = attendee.getAgent();
        if (agent != null) {
          if (attendee.getResponseStatus() != RESPONSE_STATUS.declined) {
View Full Code Here

          }
        }
      }

      activity = getActivity();
      String updatedAfter = activity.withStatus().getUpdated();

      changed = !updatedBefore.equals(updatedAfter);
    }
   
    return changed;
View Full Code Here

    }

    // Check if the activity is finished
    // If not, schedule a new update task. Else we are done
    Activity activity = getActivity();
    String start =   (activity != null) ? activity.withStatus().getStart() : null;
    String updated = (activity != null) ? activity.withStatus().getUpdated() : null;
    boolean isFinished = false;
    if (start != null && (new DateTime(start)).isBefore(DateTime.now())) {
      // start of the event is in the past
      isFinished = true;
View Full Code Here

    // Check if the activity is finished
    // If not, schedule a new update task. Else we are done
    Activity activity = getActivity();
    String start =   (activity != null) ? activity.withStatus().getStart() : null;
    String updated = (activity != null) ? activity.withStatus().getUpdated() : null;
    boolean isFinished = false;
    if (start != null && (new DateTime(start)).isBefore(DateTime.now())) {
      // start of the event is in the past
      isFinished = true;
      if (updated != null && (new DateTime(updated)).isAfter(new DateTime(start))) {
View Full Code Here

        }
      }

      // TODO: not so nice adjusting the activityStatus here this way
      activity = getActivity();
      if (activity.withStatus().getActivityStatus() != Status.ACTIVITY_STATUS.error) {
        // store status of a activity as "planned"
        activity.withStatus().setActivityStatus(Status.ACTIVITY_STATUS.planned);
        getState().put("activity", activity);
      }
View Full Code Here

      // TODO: not so nice adjusting the activityStatus here this way
      activity = getActivity();
      if (activity.withStatus().getActivityStatus() != Status.ACTIVITY_STATUS.error) {
        // store status of a activity as "planned"
        activity.withStatus().setActivityStatus(Status.ACTIVITY_STATUS.planned);
        getState().put("activity", activity);
      }

      startAutoUpdate();
    } else {
View Full Code Here

      }

      startAutoUpdate();
    } else {
      // store status of a activity as "executed"
      activity.withStatus().setActivityStatus(Status.ACTIVITY_STATUS.executed);
      getState().put("activity", activity);

      logger.info("The activity is over, my work is done. Goodbye world.");
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.