<?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 Re: Start a process instance in a specific task in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5697#M2796</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;B&gt;Mitch Gundrum&lt;/B&gt;, thanks for you help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found another solution using activiti api, I just share if anyone needs it in the future:&lt;/P&gt;&lt;P&gt;public class StartProcessIntoActivity implements Command&amp;lt;ExecutionEntity&amp;gt;, Serializable {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static final long serialVersionUID = 1L;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String businessKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String processKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String initialActivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Map&amp;lt;String, Object&amp;gt; variables ;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public StartProcessIntoActivity(String processKey, String businessKey, String initialActivity, Map&amp;lt;String, Object&amp;gt; variables) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.businessKey = businessKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.initialActivity = initialActivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.processKey = processKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.variables = variables;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@Override&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public ExecutionEntity execute(CommandContext commandContext) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedLatestProcessDefinitionByKey(processKey);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ActivityImpl initial = processDefinition.getActivities().stream().filter(f -&amp;gt; f.getId().equalsIgnoreCase(initialActivity)).findFirst().orElse(null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, initial);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;processDefinition.setVariables(variables);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;processInstance.start();&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return processInstance;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Just call the command using:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; managementService.executeCommand(new StartProcessIntoActivity("_123456", businessKey, "Task_1f6r24w",variables))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Feb 2018 14:36:57 GMT</pubDate>
    <dc:creator>willian_assoni</dc:creator>
    <dc:date>2018-02-20T14:36:57Z</dc:date>
    <item>
      <title>Start a process instance in a specific task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5695#M2794</link>
      <description>Hello,Is there a way to start a process in a different point of the flow? example&lt;IMG id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;tart --&amp;gt; fristUserTask --&amp;gt; secondUserTask --&amp;gt; thirdUserTask --&amp;gt; EndIf I create a new instance of the Procces above, the active activity will be "fristUserTask". But if for some reason I want to start a new</description>
      <pubDate>Thu, 15 Feb 2018 15:56:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5695#M2794</guid>
      <dc:creator>willian_assoni</dc:creator>
      <dc:date>2018-02-15T15:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Start a process instance in a specific task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5696#M2795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey willian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if perhaps you could add a simple form task to the beginning of your workflow with a dropdown field to choose the starting point of your workflow. You could then use the sequence flows to determine which task is executed after the start with logic like 'if (startingpointdropdown = second)'. It might look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/19299_Capture.JPG" style="width: 620px; height: 136px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 00:27:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5696#M2795</guid>
      <dc:creator>mgundrum</dc:creator>
      <dc:date>2018-02-16T00:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Start a process instance in a specific task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5697#M2796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;B&gt;Mitch Gundrum&lt;/B&gt;, thanks for you help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found another solution using activiti api, I just share if anyone needs it in the future:&lt;/P&gt;&lt;P&gt;public class StartProcessIntoActivity implements Command&amp;lt;ExecutionEntity&amp;gt;, Serializable {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static final long serialVersionUID = 1L;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String businessKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String processKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String initialActivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Map&amp;lt;String, Object&amp;gt; variables ;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public StartProcessIntoActivity(String processKey, String businessKey, String initialActivity, Map&amp;lt;String, Object&amp;gt; variables) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.businessKey = businessKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.initialActivity = initialActivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.processKey = processKey;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.variables = variables;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@Override&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public ExecutionEntity execute(CommandContext commandContext) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedLatestProcessDefinitionByKey(processKey);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ActivityImpl initial = processDefinition.getActivities().stream().filter(f -&amp;gt; f.getId().equalsIgnoreCase(initialActivity)).findFirst().orElse(null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, initial);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;processDefinition.setVariables(variables);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;processInstance.start();&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return processInstance;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Just call the command using:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; managementService.executeCommand(new StartProcessIntoActivity("_123456", businessKey, "Task_1f6r24w",variables))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 14:36:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-in-a-specific-task/m-p/5697#M2796</guid>
      <dc:creator>willian_assoni</dc:creator>
      <dc:date>2018-02-20T14:36:57Z</dc:date>
    </item>
  </channel>
</rss>

