Package org.jbpm.task

Examples of org.jbpm.task.Comment


                    session.write(resultsCmnd);
                    break;
                }
                case AddCommentRequest: {
                    response = CommandName.AddCommentResponse;
                    Comment comment = (Comment) cmd.getArguments().get(1);
                    taskSession.addComment((Long) cmd.getArguments().get(0),
                            comment);

                    List args = new ArrayList(1);
                    args.add(comment.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddCommentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
View Full Code Here


   
    public static List<Comment> readCommentList(ObjectInput in) throws IOException, ClassNotFoundException  {
        int size = in.readInt();
        List<Comment> list = new ArrayList<Comment>(size);
        for ( int i = 0; i < size; i++ ) {
            Comment item = new Comment();
            item.readExternal( in );
            list.add( item );
        }
        return list;
    }    
View Full Code Here

        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 );

        comment = new Comment();
        comment.setAddedBy( users.get( "steve" ) );
        comment.setAddedAt( new Date( 10000000 ) );
        comment.setText( "this is a loooooooooooooooooooooooooooooooooooooooooooooooong comment" );
        comments.add( comment );

        List<I18NText> names = new ArrayList<I18NText>();
        task1.setNames( names );
        List<I18NText> subjects = new ArrayList<I18NText>();
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        Comment comment = new Comment();
        Date addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "luke" ) );
        comment.setText( "This is my comment1!!!!!" );
       
        BlockingAddCommentResponseHandler addCommentResponseHandler = new BlockingAddCommentResponseHandler();
        client.addComment( taskId, comment,addCommentResponseHandler );     
        assertTrue( addCommentResponseHandler.getCommentId() != comment.getId() );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Comment> comments1 = task1.getTaskData().getComments();
        assertEquals(1, comments1.size() );
        Comment returnedComment = comments1.get( 0 );       
        assertEquals( "This is my comment1!!!!!", returnedComment.getText() );
        assertEquals( addedAt, returnedComment.getAddedAt() );
        assertEquals( users.get( "luke" ), returnedComment.getAddedBy() );
       
        assertEquals( (long)addCommentResponseHandler.getCommentId(), (long) returnedComment.getId() );
       
        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setComments( comments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);      
       
        // test we can have multiple comments
        comment = new Comment();
        addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "tony" ) );
        comment.setText( "This is my comment2!!!!!" );
       
View Full Code Here

TOP

Related Classes of org.jbpm.task.Comment

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.