cancel
Showing results for 
Search instead for 
Did you mean: 

Problème taskService en activiti

fatma19
Confirmed Champ
Confirmed Champ

Bonjour je suis en train de tester taskService  avec un simple example qui affiche hello world avec javaDelegate,mais j ai pas compris pourquoi ca ne marche pas aucune erreur n'est affichée comme si le workflow n'a pas démarré.

Qu'est ce que je dois faire? 

Voici mon code ainsi que mon workflow et merci d'avance Smiley Happy 

<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">   <process id="myProcess" name="My process" isExecutable="true">     <serviceTask id="servicetask1" name="Service Task" activiti:class="org.activiti.Test3"></serviceTask>     <startEvent id="startevent1" name="Start"></startEvent>     <endEvent id="endevent1" name="End"></endEvent>     <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>     <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>   </process>   <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">     <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">       <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">         <omgdc:Bounds height="55.0" width="105.0" x="370.0" y="130.0"></omgdc:Bounds>       </bpmndi:BPMNShape>       <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">         <omgdc:Bounds height="35.0" width="35.0" x="210.0" y="140.0"></omgdc:Bounds>       </bpmndi:BPMNShape>       <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">         <omgdc:Bounds height="35.0" width="35.0" x="660.0" y="140.0"></omgdc:Bounds>       </bpmndi:BPMNShape>       <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">         <omgdi:waypoint x="245.0" y="157.0"></omgdi:waypoint>         <omgdi:waypoint x="370.0" y="157.0"></omgdi:waypoint>       </bpmndi:BPMNEdge>       <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">         <omgdi:waypoint x="475.0" y="157.0"></omgdi:waypoint>         <omgdi:waypoint x="660.0" y="157.0"></omgdi:waypoint>       </bpmndi:BPMNEdge>     </bpmndi:BPMNPlane>   </bpmndi:BPMNDiagram> </definitions> 

mon main 

public class Test {

public static void main(String[] args) {     // TODO Auto-generated method stub     ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();     RepositoryService repositoryService = processEngine.getRepositoryService();     repositoryService.createDeployment()       .addClasspathResource("org/activiti/test/yz.bpmn")       .deploy();     //starting it      Map<String, Object> variables = new HashMap<String, Object>();     variables.put("employeeName", "Kermit");     variables.put("numberOfDays", new Integer(4));     variables.put("vacationMotivation", "I'm really tired!");     RuntimeService runtimeService = processEngine.getRuntimeService();     ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess");        // Fetch all tasks for the management group     TaskService taskService = processEngine.getTaskService();     java.util.List<org.activiti.engine.task.Task> tasks = taskService.createTaskQuery().taskCandidateGroup("management").list();     for (org.activiti.engine.task.Task task : tasks) {      System.out.println("Task available: " + task.getName());     }


mon java delegate class
public class Test3 implements JavaDelegate{
public void execute(DelegateExecution arg0) throws Exception {     System.out.println("tessssssssssssst"); }
}
2 REPLIES 2

ycoulon
Employee
Employee

Bonjour,

Malheuresement la manière dont votre code est formaté n'est pas très lisible.

Pourriez-vous peut être déposé cela sur github ou sous forme de fichier attaché afin que nous puisions y jeter un oeil ?

Au passage avez-vous jeter un oeil aux tutoriels lié à activiti + spring ? Ils fournissent un bon point de départ : Getting started with Activiti and Spring Boot 

Yann

fatma19
Confirmed Champ
Confirmed Champ