Package com.almende.eve.entity.activity

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


          }
        }
      }

      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

      return false;
    }
   
    // read planned start and end from the activity
    DateTime activityStart = null;
    if (activity.withStatus().getStart() != null) {
      activityStart = new DateTime(activity.withStatus().getStart());
    }
    DateTime activityEnd = null;
    if (activity.withStatus().getEnd() != null) {
      activityEnd = new DateTime(activity.withStatus().getEnd());
View Full Code Here

    */
   
    // check time constraints
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration != null) {
      String start = activity.withStatus().getStart();
      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
        DateTime endTime = new DateTime(end);
        Interval interval = new Interval(startTime, endTime);
View Full Code Here

   
    // check time constraints
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration != null) {
      String start = activity.withStatus().getStart();
      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
        DateTime endTime = new DateTime(end);
        Interval interval = new Interval(startTime, endTime);
        if (interval.toDurationMillis() != duration) {
View Full Code Here

              + "Changed end time to match the duration of "
              + 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

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.