AnsweredAssumed Answered

Alfresco WebScript and Activiti API

Question asked by vincent-kali on Sep 30, 2018
Latest reply on Oct 3, 2018 by vincent-kali

I would like to use activiti API in an Alfresco JAVA Webscript to query some process variables (runtime and historical). I use Spring ApplicationContextAware interface to get instanciate ActivitiUtil class like this:


ActivitiUtil getActivitiUtilInstance (){
     try {
         ProcessEngine processEngine = (ProcessEngine) this.applicationContext.getBean("activitiProcessEngine");
         if (processEngine == null){
          logger.error ("processEngine is null !");
          return null;
          return (new ActivitiUtil(processEngine, this.deployWorkflowsInTenant));
     }catch(Exception e){
      return null;


This is OK but when calling any method (eg: activitiUtil.getRuntimeService().getVariables(activitiProcessInstance)), following exception is thrown:


A valid SecureContext was not provided in the RequestContext


Same issue when enforcing user context using 'AuthenticationUtil.runAs'


Any idea ?