Récupération du nom de l'initiateur d'un workflow [Résolu]

huberd
Champ in-the-making
Champ in-the-making
Bonjour, je souhaite récupérer le nom de l'initiateur d'un workflow dans une classe Java. Comment puis-je proceder ?
Merci pour votre aide.
2 REPLIES 2

alexist
Champ in-the-making
Champ in-the-making
Il faut affecter la tache à l'intiateur du workflow :
 <task name="wf:myTask" swimlane="initiator" >
  </task>‍‍
Puis dans la classe java réalisant l'action, il faut utiliser l'objet executionContext pour récuperer l'acteur :

executionContext.getTaskInstance().getActorId()‍
Ou alors tout simplement ca :
executionContext.getJbpmContext().getActorId();‍
A tester, je suis pas sur à 100%

huberd
Champ in-the-making
Champ in-the-making
Il faut affecter la tache à l'intiateur du workflow :
 <task name="wf:myTask" swimlane="initiator" >
  </task>‍‍
Puis dans la classe java réalisant l'action, il faut utiliser l'objet executionContext pour récuperer l'acteur :

executionContext.getTaskInstance().getActorId()‍
Ou alors tout simplement ca :
executionContext.getJbpmContext().getActorId();‍
A tester, je suis pas sur à 100%

Cela ne marche pas.
Dans le premier cas, j'obtiens une exception, dans le second cas, la valeure retournée est nulle