<?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 integration through an API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23117#M11155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to integrate Activiti within an application through API calls. I have been spending time looking around the source code of Activiti to figure out the right entry point to this exercise. I have a few question that I'd appreciate an answer to. First, here's what I'm trying to do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Configure the process engine programmatically&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. instantiate a ProcessEngine instance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Deploy a ProcessDefinition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Start a process instance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Query in-progress process instances of a particular process definition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. Query the state of in-progress process instance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7. Associate an object (web form that has nothing to do with Activiti forms) with a task&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;8. Associate the task with a roles and users in LDAP store (active directory)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;9. trigger an action in an exclusive gateway on a task&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I managed to do 1 - 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm struggling with 5-9. I'd appreciate pointers and maybe code examples of how to go about accessing the execution entities to perform those actions from the process engine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hany Mesha&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Dec 2010 05:57:41 GMT</pubDate>
    <dc:creator>hmesha</dc:creator>
    <dc:date>2010-12-27T05:57:41Z</dc:date>
    <item>
      <title>Activiti integration through an API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23117#M11155</link>
      <description>Hi all,I'm trying to integrate Activiti within an application through API calls. I have been spending time looking around the source code of Activiti to figure out the right entry point to this exercise. I have a few question that I'd appreciate an answer to. First, here's what I'm trying to do:1. C</description>
      <pubDate>Mon, 27 Dec 2010 05:57:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23117#M11155</guid>
      <dc:creator>hmesha</dc:creator>
      <dc:date>2010-12-27T05:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti integration through an API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23118#M11156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hany,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5. This is quite easy, this can be done using the API with the ProcessInstanceQuery:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;ProcessInstance&amp;gt; instancesRunning = runtimeService.createProcessInstanceQuery().processDefinitionKey("myProcess").list();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;6. The ProcessInstance objects, queried in step 5 contain a lot of information about the process instance. To get the variables for the instance, use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;Map&amp;lt;String, Object&amp;gt; vars = runtimeService.getVariables(instance.getId());&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;7. Depends on what you are trying to do. If each task-instance has it's own object you'd like to store, you can use task-local variables (will be introducded in 5.1 release, comibg out in the beginning of january. If you want to use it as a resource as task-form, I suggest you read &lt;/SPAN&gt;&lt;A href="http://activiti.org/userguide/index.html#externalFormRendering" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#externalFormRendering&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;8. For setting candidat users/groups for a task, check out &lt;/SPAN&gt;&lt;A href="http://activiti.org/userguide/index.html#bpmnUserTask" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#bpmnUserTask&lt;/A&gt;&lt;SPAN&gt;, section User assignement. The LDAP integration doesn't come out of the box, but as far as I know some members of the community are working on this. Not shure wat the current status is on that, do a quick search for 'LDAP' on the forum, that will get you started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;9. Not really sure what you are trying to do. It's possible to ruin custom java-coe when a task starts or completes. You can also add serviceTasks which perform you java-code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;check out &lt;/SPAN&gt;&lt;A href="http://activiti.org/userguide/index.html#bpmnJavaServiceTaskXML" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#bpmnJavaServiceTaskXML&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://activiti.org/userguide/index.html#taskListeners" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#taskListeners&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Dec 2010 09:20:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23118#M11156</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2010-12-27T09:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti integration through an API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23119#M11157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Frederik,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#6, you mentioned that the process instance object variables can be used to obtain information about the current state of the process instance. Can you please elaborate what variables are set and what's their ID's?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For 7, 8, and 9 what I'm trying to do is to have a web application to allow a user to login and edit a form then perform actions that are represented by action buttons on the form. Those action buttons text should be populated from the workflow instance actions based on the current active activity the process is at. For example, let's take the loan request example that's is used in the user guide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. When the user logs in the web application and click on the loan request link, a process instance should be created but not start execution&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The form loads for edit and the button text should be the next sequence flow that the process instance next operation is specified. In this case, it's 'Submit'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. When the user submits the form, the workflow instance transition to the next state. Which in this case submitted&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. The workflow instance now automatically moves to the next set of candidate according to the process definition which is to advance the workflow intance to the candidates that will approve and reject.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. When those candidate login to the web application should be able to see the buttons with text populated ('approve 'reject') which will be the possible directions on the process instance gateway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. Once a user clicks either on, the workflow instance advances to the execution path choosen by the user according to the process instance definition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what I'm trying to achieve in my application. To do so, I'm writing a set of calls to interact with Activiti process engine that will either query the engine for information about where the process is at (current active activity), list of possible actions (destinations from the current active activity), signal a process instance execution (submit), perform a specified action by the user (approve or reject).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think what I'm trying to do is achievable but requires more knowledge about how Activiti works!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate if you can point me in the right direction to implement this in Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hany Mesha&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 00:18:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-through-an-api/m-p/23119#M11157</guid>
      <dc:creator>hmesha</dc:creator>
      <dc:date>2010-12-28T00:18:49Z</dc:date>
    </item>
  </channel>
</rss>

