Package org.jbpm.task

Examples of org.jbpm.task.TaskData


        // do nothing
      }
    }
    task.setPriority(priority);
   
    TaskData taskData = new TaskData();
    taskData.setWorkItemId(workItem.getId());
    taskData.setProcessInstanceId(workItem.getProcessInstanceId());
    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 && actorId.trim().length() > 0) {
      String[] actorIds = actorId.split(",");
      for (String id: actorIds) {
        potentialOwners.add(new User(id.trim()));
      }
            //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 && groupId.trim().length() > 0) {
View Full Code Here


                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

                                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

        List<OrganizationalEntity> recipients = new ArrayList<OrganizationalEntity>();
        peopleAssignments.setRecipients( recipients );
        recipients.add( users.get( "sly" ) );
        recipients.add( users.get( "liz" ) );

        TaskData taskData = new TaskData();
        task1.setTaskData( taskData );
       
        taskData.setActualOwner( users.get( "liz" ) );
        taskData.setCreatedBy( users.get( "sly" ) );

        taskData.setActivationTime( new Date( 10000000 ) );
        taskData.setCreatedOn( new Date( 10000000 ) );
        taskData.setExpirationTime( new Date( 10000000 ) );
        taskData.setStatus( Status.Created );
       
        taskData.setDocumentAccessType( AccessType.Inline );
        taskData.setDocumentType( "mvel" );
        taskData.setDocumentContentId( 20 );

        List<Attachment> attachments = new ArrayList<Attachment>();
        taskData.setAttachments( attachments );

        Attachment attachment = new Attachment();
        attachment.setAccessType( AccessType.Inline );
        attachment.setAttachedAt( new Date( 10000000 ) );
        attachment.setAttachedBy( users.get( "liz" ) );
        attachment.setContentType( "text" );
        attachment.setName( "file.txt" );
        attachment.setSize( 5000);
        attachment.setAttachmentContentId( 5 );
        attachments.add( attachment );

        attachment = new Attachment();
        attachment.setAccessType( AccessType.Url );
        attachment.setAttachedAt( new Date( 10000000 ) );
        attachment.setAttachedBy( users.get( "liz" ) );
        attachment.setContentType( "text" );
        attachment.setName( "file2.txt" );
        attachment.setSize( 500 );
        attachment.setAttachmentContentId( 3 );
        attachments.add( attachment );

        List<Comment> comments = new ArrayList<Comment>();
        taskData.setComments( comments );
        Comment comment = new Comment();
        comment.setAddedBy( users.get( "peter" ) );
        comment.setAddedAt( new Date( 10000000 ) );
        comment.setText( "this is a short comment" );
        comments.add( comment );
View Full Code Here

    Task task = new Task();
    List<I18NText> names1 = new ArrayList<I18NText>();
    I18NText text1 = new I18NText("en-UK", "tarea1");
    names1.add(text1);
    task.setNames(names1);
    TaskData taskData = new TaskData();
    taskData.setStatus(Status.Created);
    taskData.setCreatedBy(new User("usr0"));
    taskData.setActualOwner(new User("usr0"));
    task.setTaskData(taskData);
   
    ContentData data = new ContentData();
    BlockingAddTaskResponseHandler addTaskHandler = new BlockingAddTaskResponseHandler();
    client.addTask(task, data, addTaskHandler);
   
    long taskId = addTaskHandler.getTaskId();

    client.disconnect();
   
    client.connect();
   
    assertTrue("taskId debe ser un valor mayor a cero", taskId > 0);
   
    Task task2 = new Task();
    List<I18NText> names2 = new ArrayList<I18NText>();
    I18NText text2 = new I18NText("en-UK", "tarea1");
    names2.add(text2);
    task2.setNames(names2);
    TaskData taskData2 = new TaskData();
    taskData2.setStatus(Status.Created);
    taskData2.setCreatedBy(new User("usr0"));
    taskData2.setActualOwner(new User("usr0"));
    task2.setTaskData(taskData2);
     
    ContentData data2 = new ContentData();
    BlockingAddTaskResponseHandler addTaskHandler2 = new BlockingAddTaskResponseHandler();
    client.addTask(task2, data2, addTaskHandler2);
View Full Code Here

  public Object getTaskContentInput(TaskSummary taskSum) {
    BlockingGetTaskResponseHandler handlerT = new BlockingGetTaskResponseHandler();
    client.getTask(taskSum.getId(), handlerT);
    Task task2 = handlerT.getTask();
    TaskData taskData = task2.getTaskData();
    BlockingGetContentResponseHandler handlerC = new BlockingGetContentResponseHandler();
    client.getContent(taskData.getDocumentContentId(), handlerC);
    Content content = handlerC.getContent();
    ByteArrayInputStream bais = new ByteArrayInputStream(
        content.getContent());
    try {
      ObjectInputStream is = new ObjectInputStream(bais);
View Full Code Here

        try {
            task.setPriority(new Integer(priority));
        } catch (NumberFormatException e) {
            // do nothing
        }
        TaskData taskData = new TaskData();
        taskData.setSkipable(skippableButton.getSelection());
        task.setTaskData(taskData);

        String actors = actorText.getText();
        PeopleAssignments assignments = new PeopleAssignments();
        String[] actorIds = actors.trim().split(",");
View Full Code Here

TOP

Related Classes of org.jbpm.task.TaskData

Copyright © 2018 www.massapicom. 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.