cancel
Showing results for 
Search instead for 
Did you mean: 

UserTask auto complete

elf_daniel
Champ in-the-making
Champ in-the-making
Hi Activiti users,

i m new to activiti and stuck at one point.
I have a process (attached) as modification of an example from Daniel Meyer.
(http://www.bpm-guide.de/2011/09/17/build-your-own-activiti-task-explorer-with-cdi-and-jsf-2/)

In the example of Mr. Meyer,
any completion of user task is always through taskList.jsf.

Is it possible to let user fill in in the "change username" and directly to exclusive gateway to be checked by username check?

Any help would be appreciated.

Thank s before

regards

(forgot to explain little bit what the process should do.
the logged in user should be able to start process to create new user,
if the username in startevent too short (<=5),
he must corrects it,
if the username from startevent is correct (>5),
it should be added in a list as string.)
5 REPLIES 5

elf_daniel
Champ in-the-making
Champ in-the-making
uhm,
i m aware my english is really poor,
maybe to make it understandable i should try again

the problem is,
how can we execute a single user task programmatically?

of course it s not a good way if there is more than 1 user in the process,
but in this case,
there is only one user and it's a very simple process,
it's more convenient if there is a way to execute the task directly without always clicking it to working on it.

any advice would be very appreciated

regards

elf_daniel
Champ in-the-making
Champ in-the-making
i m trying to solve this with an action listener within JSF file in start event. (at submit button)

public class NormalActionListener implements ActionListener{
String taskid = new TaskList().getPersonalTaskListId();
@Override
public void processAction(ActionEvent event)
  throws AbortProcessingException {

  try {  
   FacesContext.getCurrentInstance().getExternalContext().redirect("taskForm_reviewTweet.jsf?taskId=" + taskid);
  } catch (IOException e) {
   e.printStackTrace();
  }
}
}

but still i have a problem to get the personal task id.

i tried with

taskId=taskService.createTaskQuery()
             .taskAssignee(currentUser.getUsername())
             .list().get(0).getId();

but it doesnt seem working.

the first taskid by me is always 8, the next ones are always different (of course).

If i write taskId=8,
of course it works only for the first personal user task.

how can it be written in bean to get the personal task id?

can someone help me pls?

regards

Daniel

elf_daniel
Champ in-the-making
Champ in-the-making
i tried with

private String taskId;
public String getPersonalTaskListId() {
if (taskId!=null){
  taskId=taskService.createTaskQuery()
             .taskAssignee(currentUser.getUsername())
             .list().get(0).getId();
}
else {
  taskId="heeeiiiiiiiiiiiii";
}
return taskId;
}

and this is the outcome
http://localhost:8080/jsf-task-management/taskForm_reviewTweet.jsf?taskId=heeeiiiiiiiiiiiii
obviously the method getPersonalTaskListId() is always null.

>_<

elf_daniel
Champ in-the-making
Champ in-the-making
thx to my tutor,
we got this so far but not yet till the end.

maybe the name of the thread is wrong,
it should be usertask auto start,
not usertask auto complete

it works perfectly until a service task after one user task comes.

and some exceptions,
because the browser tries to redirect to another url with taskid parameter,
it can't be found since it is done by service task.

and then comes this url
/taskForm_reviewTweet.jsf?cid=1

can someone share any idea how to handle this?

thx before for any advice

regards

Daniel

elf_daniel
Champ in-the-making
Champ in-the-making
it s done.

omg,
i m really a noob.

if there were more examples bout jsf, activiti and spring together,
maybe would be easier.

i m slow learner without exact examples