Exemplo n.º 1
0
 public static EActivityDef getActivityDef(EActivity activity) {
   EObject object = activity.getData();
   if (object != null) {
     EClass eClass = object.eClass();
     if (eClass instanceof EActivityDef) {
       return (EActivityDef) eClass;
     }
     for (EClass eSupertype : eClass.getESuperTypes()) {
       if (eSupertype instanceof EActivityDef) {
         return (EActivityDef) eSupertype;
       }
     }
     return ActivityDictionary.getInstance().getActivityDef(object.eClass().getName());
   }
   return null;
 }
 private void addActivityEdges(TemporalEdgeManager manager, EActivity activity) {
   TemporalMember member = activity.getMember(TemporalMember.class);
   Date start = member == null ? null : member.getStartTime();
   Date end = member == null ? null : member.getEndTime();
   boolean instantaneous = DateUtils.same(start, end);
   List<Long> list = new ArrayList<Long>();
   if (instantaneous && start != null) {
     list.add(start.getTime());
   } else {
     if (start != null) {
       list.add(start.getTime());
     }
     if (end != null) {
       list.add(end.getTime());
     }
   }
   manager.addTimes(activity, list);
 }
 protected EActivity makeActivityNamed(String name) {
   EActivity activity = PlanFactory.eINSTANCE.createEActivity();
   activity.setName(name);
   return activity;
 }