AnsweredAssumed Answered

Hook point for document generation: TemplateVariableProcessor could not be resolved

Question asked by mario.fliegner on May 13, 2016
Latest reply on May 31, 2016 by mario.fliegner
Hi there,

I'm trying to manipulate some form values before generating a PDF with the Alfresco Activiti Suite 1.4.1 "document generation task". I'm using the latest documentation: https://docs.alfresco.com/activiti/docs/dev-guide/1.4.0/#templateVariableProcessor
Unfortunately, I can't compile the Java class example because the
TemplateVariableProcessor
could not be implemented. This is because the of the import
com.activiti.api.docgen.TemplateVariableProcessor
. The
com.activiti.api
package could not be resolved!
As mentioned in the documentation above, my POM contains the following:


  <dependency>
    <groupId>com.activiti</groupId>
    <artifactId>activiti-app-logic</artifactId>
    <version>1.4.1</version>
  </dependency>



Maybe at this point I make already a mistake? Because even based on the documentation https://docs.alfresco.com/activiti/docs/dev-guide/1.4.0/#_custom_logic I can build against a particular suite version
${suite.version}
. I assume it's the Alfresco Activiti Suite version, right? So I'm using the latest one which is 1.4.1. But this version could not be resolved. Another strange thing is, that I can't find the package
com.activiti
on https://maven.alfresco.com/nexus. Only
org.activiti
is available. But if I use "org" instead "com" it doesn't work either. For
org.activiti
I've also tried the version 6.0.0.Beta2 (http://mvnrepository.com/artifact/org.activiti/activiti-app-logic).

How do I get the example working?
I appreciate any advice!

BR,
Mario


For completeness my Java code:

package com.activiti.extension.bean;
import org.activiti.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;
import org.apache.log4j.Logger;
import com.activiti.api.docgen.TemplateVariableProcessor;

@Component
public class CustomTemplateProcessor implements TemplateVariableProcessor {
    private static final Logger logger = Logger.getLogger(CustomTemplateProcessor.class);
    public Object process(DelegateExecution execution, String variableName, Object value) {

        logger.info("processing <"+variableName+"> with value <"+value+">");
        return value.toString() + "___" + "HELLO_WORLD";
    }
}




Outcomes