[jboss-user] [jBPM] - Re: jbpm5 RULEFLOW VARIABLE CHANGED null

Luis Tamayo do-not-reply at jboss.com
Fri Sep 2 17:19:26 EDT 2011


Luis Tamayo [http://community.jboss.org/people/luis.tamayo] created the discussion

"Re: jbpm5 RULEFLOW VARIABLE CHANGED null"

To view the discussion, visit: http://community.jboss.org/message/624542#624542

--------------------------------------------------------------
Thanks, for your answer.

I run this code to start task:
public String iniciarTareaSolicitudEmpleado( ){
                    HumanTaskClientMina htk = new HumanTaskClientMina();
                    User u= new User("operator");
                    List<TaskSummary> t = htk.getAssignedTasks( u );
                    System.out.println( "Tarea " + t.get( 0 ).getId() );
                    htk.startTask( u , t.get( 0 ));
                    return null;
          }

public void startTask(User user, TaskSummary task) {
                    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
                    client.start( task.getId(), user.getId(), operationResponseHandler);
                    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
          }

I run this code to complete task:
public String termiTareaSolicitudEmpleado( ){
                    HumanTaskClientMina htk = new HumanTaskClientMina();
                    User u= new User("operator");
                    List<TaskSummary> t = htk.getAssignedTasks( u );
                    htk.completeTask(u, t.get( 0 ), null);
                    return null;
          }

public String termiTareaOperator( ){
                    HumanTaskClientMina htk = new HumanTaskClientMina();
                    User u= new User("operator");
                    List<TaskSummary> t = htk.getAssignedTasks( u );
                    Map<String, Object> m = new HashMap<String, Object>();
                    m.put( "persona" , new Persona( "1713", "OSO T" ));

                    htk.completeTask(u, t.get( 0 ), null);
                    return null;
          }

public void completeTask(User user, TaskSummary task, Map data) {
                    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
                    ContentData contentData = null;
                    if (data != null) {
                              ByteArrayOutputStream bos = new ByteArrayOutputStream();
                              ObjectOutputStream out;
                              try {
                                        out = new ObjectOutputStream(bos);
                                        out.writeObject(data);
                                        out.close();
                                        contentData = new ContentData();
                                        contentData.setContent(bos.toByteArray());
                                        contentData.setAccessType(AccessType.Inline);
                              }
                              catch (IOException e) {
                                        System.err.print(e);
                              }
                    }
                    client.complete(task.getId(), user.getId(), contentData, operationResponseHandler);
                    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
          }

Where should i set persona values??

Thanks in advance.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/624542#624542]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110902/bb54ce04/attachment-0001.html 


More information about the jboss-user mailing list