public ProcessInstanceRef(
      String id, String processDefinitionId, Date startDate, Date endDate, boolean suspended) {

    if (null == startDate) throw new IllegalArgumentException("An instance requires a start date");

    if (endDate != null && suspended)
      throw new IllegalArgumentException(
          "An instance cannot be ended and suspended at the same time");

    this.id = id;
    this.definitionId = processDefinitionId;
    this.startDate = startDate;
    this.endDate = endDate;
    this.suspended = suspended;
    initLifecycle();
  }
 public ProcessInstanceRef() {
   initLifecycle();
 }
 // it's actually just used for unmarshalling, TODO: fix it
 public void setSuspended(boolean suspended) {
   this.suspended = suspended;
   initLifecycle();
 }