<?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 Alfresco WebScript and Activiti API in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43491#M17902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to use activiti API in an Alfresco JAVA Webscript to query some process variables (runtime and historical). I use Spring&amp;nbsp;ApplicationContextAware interface to get instanciate ActivitiUtil class like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActivitiUtil getActivitiUtilInstance (){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ProcessEngine processEngine = (ProcessEngine) this.applicationContext.getBean("activitiProcessEngine");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (processEngine == null){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;logger.error ("processEngine is null !");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}else{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return (new ActivitiUtil(processEngine, this.deployWorkflowsInTenant));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}catch(Exception e){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;e.printStackTrace();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is OK but when calling any method (eg:&amp;nbsp;activitiUtil.getRuntimeService().getVariables(activitiProcessInstance)), following exception is thrown:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A valid SecureContext was not provided in the RequestContext&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same issue when enforcing user context using 'AuthenticationUtil.runAs'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Sep 2018 17:11:56 GMT</pubDate>
    <dc:creator>vincent-kali</dc:creator>
    <dc:date>2018-09-30T17:11:56Z</dc:date>
    <item>
      <title>Alfresco WebScript and Activiti API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43491#M17902</link>
      <description>I would like to use activiti API in an Alfresco JAVA Webscript to query some process variables (runtime and historical). I use Spring&amp;nbsp;ApplicationContextAware interface to get instanciate ActivitiUtil class like this:ActivitiUtil getActivitiUtilInstance (){&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;try {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ProcessEngine processEngi</description>
      <pubDate>Sun, 30 Sep 2018 17:11:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43491#M17902</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-09-30T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco WebScript and Activiti API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43492#M17903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should (typically) not be calling the low-level Activiti APIs directly, instead using the Alfresco WorkflowService as an abstraction over the workflow engine. Additionally, you may be facing such issues because your web script may not be marked as requiring an authentication context and so you do not have a fully logged-in user. AuthenticationUtil.runAs should be a fix to that in most cases, but should generally be considered a dirty cludge unless you have a specific business requirement to execute code in the context of a specific user. Also note that AuthenticationUtil.runAs will not help you for any functionality that may trigger transaction-level behaviour because such "semi-asynch" logic will be run outside of the runAs-context and as a result continue to&amp;nbsp;result in the same error if that async-logic needs to have a valid security context.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2018 10:36:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43492#M17903</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-10-01T10:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco WebScript and Activiti API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43493#M17904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Webscript controllers are defined with: &amp;lt;authentication&amp;gt;user&amp;lt;/authentication&amp;gt;, which should require and&amp;nbsp;authentication context. Am I wrong ?&lt;/P&gt;&lt;P&gt;Something that's unclear for me: my webscript is calling&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #727174; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;WorkflowService &lt;/SPAN&gt;which is instantiating A&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #727174; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;ctivitiUtil helper class, getting actitivi API services and to call API methods , without any user context Exception.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #727174; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;Why instantiating&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;A&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #727174; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;ctivitiUtil directly in my WS &lt;/SPAN&gt;and calling activiti API should be an issue ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #727174; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;Thanks for your help&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:41:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43493#M17904</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-10-02T14:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco WebScript and Activiti API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43494#M17905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep in mind that Alfresco services also add AOP handling, i.e. transaction/security management. It is generally not a good idea to work around them unless you really understand the technical details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:59:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43494#M17905</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-10-02T15:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco WebScript and Activiti API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43495#M17906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK Thanks for your advise.&lt;/P&gt;&lt;P&gt;I'm facing a simple business need: I want to query worklows on process variables (not task) during its whole lifecycle.&lt;/P&gt;&lt;P&gt;Then using workflow service,&amp;nbsp;I can:&lt;/P&gt;&lt;P&gt;- get start task properties to get 'static' view of process variables set at startup&lt;/P&gt;&lt;P&gt;- get path properies to get execution and parent process&amp;nbsp;variables&amp;nbsp;(at run time)&lt;/P&gt;&lt;P&gt;- but how to&amp;nbsp;access these&amp;nbsp;process&amp;nbsp;variables&amp;nbsp;after runtime (historical data) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2018 07:01:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-webscript-and-activiti-api/m-p/43495#M17906</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-10-03T07:01:37Z</dc:date>
    </item>
  </channel>
</rss>

