docs: protected BAMTaskSummaryImpl createTask(TaskEvent event, Status newStatus, BAMTaskWorker worker) {
          BAMTaskSummaryImpl result = null;
          Task ti = event.getTask();
          TaskPersistenceContext persistenceContext = getPersistenceContext(((TaskContext)event.getTaskContext()).getPersistenceContext());
          try {
  	        if (ti == null) {
  	            logger.error("The task instance does not exist.");
  	            return result;
  	        }
  	
  	        Status status = newStatus != null ? newStatus : ti.getTaskData().getStatus();
  	
  	        String actualOwner = "";
  	        if (ti.getTaskData().getActualOwner() != null) {
  	            actualOwner = ti.getTaskData().getActualOwner().getId();
  	        }
  	
  	        result = new BAMTaskSummaryImpl(ti.getId(), ti.getName(), status.toString(), event.getEventDate(), actualOwner, ti.getTaskData().getProcessInstanceId());
  	        if (worker != null) worker.createTask(result, ti);
  	        persistenceContext.persist(result);
  	    
  	
  	        return result;
          } finally {
          	cleanup(persistenceContext);
          }
      }