cancel
Showing results for 
Search instead for 
Did you mean: 

Completed tasks not Archived

vamsi25
Champ in-the-making
Champ in-the-making
Hi,

I deployed and started the process using java class.When the user claims the task and completes it,then its not showing in archived folder.There are couple of scenearios ive tested

for candidateGroups  and  potential owner in bpmn xml  if i use activiti:formProperty for both types of assigning

complete tasks are not shown in archive.if i dont use formProperty then it shows in archived

Below is my bpmn xml:
<?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: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="bookorder" name="Order book">
                <startEvent id="startevent1" name="Start"/>
                <sequenceFlow id="sequenceflow1" name="Validate order" sourceRef="startevent1" targetRef="scripttask1"/>
                <scriptTask id="scripttask1" name="Validate order" scriptFormat="groovy">
                        <script>
                                out:println "validating order for isbn " + isbn;
                        </script>
                </scriptTask>
                <sequenceFlow id="sequenceflow2" name="Sending to sales" sourceRef="scripttask1" targetRef="usertask1"/>
                <userTask id="usertask1" name="Work on order" activiti:candidateGroups="sales">
                        <documentation>book order user task</documentation>
                       
                        <extensionElements>
      
        <activiti:formProperty id="isbn" name="isbn"  writable="false"/>
       
       
      </extensionElements>
                </userTask>
                <sequenceFlow id="sequenceflow3" name="Ending process" sourceRef="usertask1" targetRef="endevent1"/>
                <endEvent id="endevent1" name="End"/>
        </process>
</definitions>
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
You mean in Explorer, right?

Did you tweak the history settings of the engine? That's the only reason I can think of why a completed task would not pop up in the archived tab,

chrisx_212
Champ in-the-making
Champ in-the-making
EDIT: I think I solved the problem here. The thing is, in TaskDetailPanel class, if there is no form, then there is a ButtonClickListener where you actually change the Owner to the Assignee if the Owner is null. Archive page only displays tasks which has an Owner. If the task has Forms, then it doesn't have the listener thus the program does not change the Owner to the Assignee, therefore the Archive page will not display it. You should find the place to put the listeners in FormPropertiesForm class.

Therefore, it has nothing to do with the bpmn file.

sunitanayak83
Champ in-the-making
Champ in-the-making
I am trying to deploy and start a process using java class. My process gets deployed (I am able to see it in the H2 database  -  ACT_RE_DEPLOYMENT table ). I am assigning the process to the "INITIATOR", but the "INITIATOR" is unable to claim it and complete it. I am using Alfresco Activiti Enterprise BPM version= v1.4.1. Below is my java code :

public class ProcessTestProcess
{

private String filename = "C:\\Users\\User\\workspace\\TestingActiviti\\src\\main\\resources\\diagrams\\abcProcess.bpmn";

@Rule
public ActivitiRule activitiRule = new ActivitiRule();

@Test
public void startProcess() throws Exception
{
  RepositoryService repositoryService = activitiRule.getRepositoryService();
  repositoryService.createDeployment().name("SUNITA268XX").tenantId("tenant_1").addInputStream("process.bpmn20.xml",
    new FileInputStream(filename)).deploy();
  RuntimeService runtimeService = activitiRule.getRuntimeService();
 
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
  assertNotNull(processInstance.getId());
  System.out.println("id " + processInstance.getId());
 
  TaskService taskService = activitiRule.getTaskService();
  Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).taskAssignee("1000").singleResult();
  
   System.out.println(task.getName());
  
   Map<String, Object> variables = new HashMap<String, Object>();
      variables.put("age", 210);
      taskService.addComment(task.getId(), processInstance.getId(), "GO AWAY SPOOKY SPIDER….OH NOOOOOO…..");
   taskService.complete(task.getId(), variables);
   Assert.assertEquals("Form Filling", task.getName());
   
 
}
}