<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Activiti 7 Task Query in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/activiti-7-task-query/m-p/23568#M10288</link>
    <description>&lt;P&gt;I would like some guidance on how to query user tasks for a process. My process has two user tasks and what I have managed to do is to start a process programmatically but cannot proceed beyond that in terms of querying the tasks of the process and completing the tasks.&lt;/P&gt;&lt;P&gt;This is what I have in code:&lt;/P&gt;&lt;PRE&gt;Map&amp;lt;String, Object&amp;gt; variables = new HashMap&amp;lt;&amp;gt;();
		User user = userRepository.findByUsername(assignee);
		System.out.println("Last Name: "+user.getLastname());
		variables.put("user", user);
		variables.put("memberID", member.getId());
		variables.put("Owner", user.getUsername());
		
        ProcessInstance processInstance =  processRuntime.start(ProcessPayloadBuilder
                .start()
                .withProcessDefinitionKey(process_key)
                .withName(member.getFullname())
                .withVariables(variables)
                .build());
       
      
        GetTasksPayload getTasksPayload = new GetTasksPayload();
        getTasksPayload.setProcessInstanceId(processInstance.getId());
        getTasksPayload.setAssigneeId(user.getUsername());
              
        Page&amp;lt;Task&amp;gt; tasks = taskRuntime.tasks(Pageable.of(0, 10), getTasksPayload);
       
       tasks.getContent().forEach(task -&amp;gt; {
            System.out.println("Task Name is :"+ task.getName());
        });
       &lt;/PRE&gt;&lt;P&gt;The .foreach part does not print as expected.&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 22:41:24 GMT</pubDate>
    <dc:creator>PatJansen</dc:creator>
    <dc:date>2019-11-26T22:41:24Z</dc:date>
    <item>
      <title>Activiti 7 Task Query</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-7-task-query/m-p/23568#M10288</link>
      <description>&lt;P&gt;I would like some guidance on how to query user tasks for a process. My process has two user tasks and what I have managed to do is to start a process programmatically but cannot proceed beyond that in terms of querying the tasks of the process and completing the tasks.&lt;/P&gt;&lt;P&gt;This is what I have in code:&lt;/P&gt;&lt;PRE&gt;Map&amp;lt;String, Object&amp;gt; variables = new HashMap&amp;lt;&amp;gt;();
		User user = userRepository.findByUsername(assignee);
		System.out.println("Last Name: "+user.getLastname());
		variables.put("user", user);
		variables.put("memberID", member.getId());
		variables.put("Owner", user.getUsername());
		
        ProcessInstance processInstance =  processRuntime.start(ProcessPayloadBuilder
                .start()
                .withProcessDefinitionKey(process_key)
                .withName(member.getFullname())
                .withVariables(variables)
                .build());
       
      
        GetTasksPayload getTasksPayload = new GetTasksPayload();
        getTasksPayload.setProcessInstanceId(processInstance.getId());
        getTasksPayload.setAssigneeId(user.getUsername());
              
        Page&amp;lt;Task&amp;gt; tasks = taskRuntime.tasks(Pageable.of(0, 10), getTasksPayload);
       
       tasks.getContent().forEach(task -&amp;gt; {
            System.out.println("Task Name is :"+ task.getName());
        });
       &lt;/PRE&gt;&lt;P&gt;The .foreach part does not print as expected.&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 22:41:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-7-task-query/m-p/23568#M10288</guid>
      <dc:creator>PatJansen</dc:creator>
      <dc:date>2019-11-26T22:41:24Z</dc:date>
    </item>
  </channel>
</rss>

