Examples of TaskData


Examples of com.art.anette.datamodel.dataobjects.sqldata.TaskData

     * @param workPackageId die ID des WorkPackage
     */
    public Task(DBControl dbControl, long id, long employee, long workPackageId) {
        super(dbControl, id);
        this.employee = employee;
        actual = new TaskData();
        modified = new TaskData();
        actual.workPackage = workPackageId;
        modified.workPackage = workPackageId;
    }
View Full Code Here

Examples of org.apache.ambari.eventdb.model.TaskData

  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/task")
  public TaskData getTaskSummary(@QueryParam("jobId") String jobId, @QueryParam("width") int steps, @QueryParam("workflowId") String workflowId,
      @DefaultValue("-1") @QueryParam("startTime") long minFinishTime, @DefaultValue("-1") @QueryParam("endTime") long maxStartTime) {
    TaskData points = new TaskData();
    PostgresConnector conn = null;
    try {
      conn = getConnector();
      List<TaskAttempt> taskAttempts = null;
      long startTime = -1;
View Full Code Here

Examples of org.apache.ambari.eventdb.model.TaskData

 
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/task")
  public TaskData getTaskDetails(@QueryParam("jobId") String jobId, @QueryParam("width") int steps) {
    TaskData points = new TaskData();
    PostgresConnector conn = null;
    try {
      conn = getConnector();
      long[] times = conn.fetchJobStartStopTimes(jobId);
      if (times != null) {
View Full Code Here

Examples of org.apache.ambari.eventdb.model.TaskData

  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/task")
  public TaskData getTaskSummary(@QueryParam("jobId") String jobId, @QueryParam("width") int steps, @QueryParam("workflowId") String workflowId,
      @DefaultValue("-1") @QueryParam("startTime") long minFinishTime, @DefaultValue("-1") @QueryParam("endTime") long maxStartTime) {
    TaskData points = new TaskData();
    PostgresConnector conn = null;
    try {
      conn = getConnector();
      List<TaskAttempt> taskAttempts = null;
      long startTime = -1;
View Full Code Here

Examples of org.drools.task.TaskData

                                UserInfo userInfo) {
      if (userInfo == null) {
        return;
      }
     
        TaskData data = task.getTaskData();
        User owner = data.getActualOwner();
        User creator = data.getCreatedBy();
        Date createdOn = data.getCreatedOn();

        if ( task.getDeadlines() == null ) {
            return;
        }
View Full Code Here

Examples of org.drools.task.TaskData

                buildMapByLanguage( users,
                                    (User) entity );
            }
        }

        TaskData taskData = task.getTaskData();
        Map<String, Object> doc = null;
        if ( taskData != null ) {
            Content content = em.find( Content.class,
                                       taskData.getDocumentContentId() );
            if ( content != null ) {
                ExpressionCompiler compiler = new ExpressionCompiler( new String( content.getContent() ) );
                doc = (Map<String, Object>) MVEL.executeExpression( compiler.compile() );
            } else {
                doc = Collections.emptyMap();
View Full Code Here

Examples of org.drools.task.TaskData

        // do nothing
      }
    }
    task.setPriority(priority);
   
    TaskData taskData = new TaskData();
    taskData.setWorkItemId(workItem.getId());
    taskData.setSkipable(!"false".equals(workItem.getParameter("Skippable")));
        //Sub Task Data
        Long parentId = (Long) workItem.getParameter("ParentId");
        if(parentId != null){
            taskData.setParentId(parentId);
        }

        String subTaskStrategiesCommaSeparated = (String) workItem.getParameter("SubTaskStrategies");
        if(subTaskStrategiesCommaSeparated!= null && !subTaskStrategiesCommaSeparated.equals("")){
            String[] subTaskStrategies =  subTaskStrategiesCommaSeparated.split(",");
            List<SubTasksStrategy> strategies = new ArrayList<SubTasksStrategy>();
            for(String subTaskStrategyString : subTaskStrategies){
                SubTasksStrategy subTaskStrategy = SubTasksStrategyFactory.newStrategy(subTaskStrategyString);
                strategies.add(subTaskStrategy);
            }
            task.setSubTaskStrategies(strategies);
        }

        PeopleAssignments assignments = new PeopleAssignments();
    List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();

        String actorId = (String) workItem.getParameter("ActorId");
    if (actorId != null) {
     
      String[] actorIds = actorId.split(",");
      for (String id: actorIds) {
        User user = new User();
        user.setId(id.trim());
        potentialOwners.add(user);
      }
            //Set the first user as creator ID??? hmmm might be wrong
            if (potentialOwners.size() > 0){
                taskData.setCreatedBy((User)potentialOwners.get(0));
            }
        }
        String groupId = (String) workItem.getParameter("GroupId");
    if (groupId != null) {
     
View Full Code Here

Examples of org.drools.task.TaskData

        // do nothing
      }
    }
    task.setPriority(priority);
   
    TaskData taskData = new TaskData();
    taskData.setWorkItemId(workItem.getId());
    taskData.setSkipable(!"false".equals(workItem.getParameter("Skippable")));
        //Sub Task Data
        Long parentId = (Long) workItem.getParameter("ParentId");
        if(parentId != null){
            taskData.setParentId(parentId);
        }

        String subTaskStrategiesCommaSeparated = (String) workItem.getParameter("SubTaskStrategies");
        if(subTaskStrategiesCommaSeparated!= null && !subTaskStrategiesCommaSeparated.equals("")){
            String[] subTaskStrategies =  subTaskStrategiesCommaSeparated.split(",");
            List<SubTasksStrategy> strategies = new ArrayList<SubTasksStrategy>();
            for(String subTaskStrategyString : subTaskStrategies){
                SubTasksStrategy subTaskStrategy = SubTasksStrategyFactory.newStrategy(subTaskStrategyString);
                strategies.add(subTaskStrategy);
            }
            task.setSubTaskStrategies(strategies);
        }

        PeopleAssignments assignments = new PeopleAssignments();
    List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();

        String actorId = (String) workItem.getParameter("ActorId");
    if (actorId != null) {
     
      String[] actorIds = actorId.split(",");
      for (String id: actorIds) {
        User user = new User();
        user.setId(id.trim());
        potentialOwners.add(user);
      }
            //Set the first user as creator ID??? hmmm might be wrong
            if (potentialOwners.size() > 0){
                taskData.setCreatedBy((User)potentialOwners.get(0));
            }
        }
        String groupId = (String) workItem.getParameter("GroupId");
    if (groupId != null) {
     
View Full Code Here

Examples of org.drools.task.TaskData

        // do nothing
      }
    }
    task.setPriority(priority);
   
    TaskData taskData = new TaskData();
    taskData.setWorkItemId(workItem.getId());
    taskData.setSkipable(!"false".equals(workItem.getParameter("Skippable")));
        //Sub Task Data
        Long parentId = (Long) workItem.getParameter("ParentId");
        if(parentId != null){
            taskData.setParentId(parentId);
        }

        String subTaskStrategiesCommaSeparated = (String) workItem.getParameter("SubTaskStrategies");
        if(subTaskStrategiesCommaSeparated!= null && !subTaskStrategiesCommaSeparated.equals("")){
            String[] subTaskStrategies =  subTaskStrategiesCommaSeparated.split(",");
            List<SubTasksStrategy> strategies = new ArrayList<SubTasksStrategy>();
            for(String subTaskStrategyString : subTaskStrategies){
                SubTasksStrategy subTaskStrategy = SubTasksStrategyFactory.newStrategy(subTaskStrategyString);
                strategies.add(subTaskStrategy);
            }
            task.setSubTaskStrategies(strategies);
        }

        PeopleAssignments assignments = new PeopleAssignments();
    List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();

        String actorId = (String) workItem.getParameter("ActorId");
    if (actorId != null) {
     
      String[] actorIds = actorId.split(",");
      for (String id: actorIds) {
        User user = new User();
        user.setId(id.trim());
        potentialOwners.add(user);
      }
            //Set the first user as creator ID??? hmmm might be wrong
            if (potentialOwners.size() > 0){
                taskData.setCreatedBy((User)potentialOwners.get(0));
            }
        }
        String groupId = (String) workItem.getParameter("GroupId");
    if (groupId != null) {
     
View Full Code Here

Examples of org.drools.task.TaskData

        em.persist( group );
        em.getTransaction().commit();
    }

    public void addTask(Task task, ContentData contentData) {
        TaskData taskData = task.getTaskData();
        // new tasks start off with status created
        taskData.setStatus( Status.Created );

        // execute "addTask" rules
        if (ruleBases != null) {
          RuleBase ruleBase = ruleBases.get("addTask");
          if (ruleBase != null) {
            StatefulSession session = ruleBase.newStatefulSession();
          Map<String, Object> globals = this.globals.get("addTask");
          if (globals != null) {
            for (Map.Entry<String, Object> entry: globals.entrySet()) {
              session.setGlobal(entry.getKey(), entry.getValue());
            }
          }
          TaskServiceRequest request = new TaskServiceRequest("addTask", null, null);
          session.setGlobal("request", request);
            session.insert(task);
            session.insert(contentData);
            session.fireAllRules();
            if (!request.isAllowed()) {
              String error = "Cannot add Task:\n";
              if (request.getReasons() != null) {
                for (String reason: request.getReasons()) {
                  error += reason + "\n";
                }
              }
              throw new RuntimeException(error);
            }
          }
        }

        if ( task.getPeopleAssignments() != null ) {
            List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners();
            if ( potentialOwners.size() == 1 ) {
                // if there is a single potential owner, assign and set status to Reserved
                OrganizationalEntity potentialOwner = potentialOwners.get( 0 );
                // if there is a single potential user owner, assign and set status to Reserved
                if(potentialOwner instanceof User){
                taskData.setActualOwner( (User) potentialOwners.get( 0 ) );
                taskData.setStatus( Status.Reserved );
                }
                //If there is a group set as potentialOwners, set the status to Ready ??
                if(potentialOwner instanceof Group){

                    taskData.setStatus( Status.Ready );
                }
            } else if ( potentialOwners.size() > 1 ) {
                // multiple potential owners, so set to Ready so one can claim.
                taskData.setStatus( Status.Ready );
            } else {
                //@TODO we have no potential owners
            }
        } else {
            //@TODO we have no potential owners
        }

        // set the CreatedOn date if it's not already set
        if ( taskData.getCreatedOn() == null ) {
            taskData.setCreatedOn( new Date() );
        }

        //@FIXME for now we activate on creation, unless date is supplied
        if ( taskData.getActivationTime() == null ) {
            taskData.setActivationTime( taskData.getCreatedOn() );
        }
       
        em.getTransaction().begin();
        em.persist( task );
        if (contentData != null) {
          Content content = new Content();
          content.setContent(contentData.getContent());
          em.persist( content );
            taskData.setDocumentAccessType( contentData.getAccessType() );
            taskData.setDocumentType( contentData.getType() );
            taskData.setDocumentContentId( content.getId() );
        }
        em.getTransaction().commit();

        long now = System.currentTimeMillis();
        // schedule after it's been persisted, otherwise the id's won't be assigned
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.