@declare{"actionInvoker"}
package @{package};

public class @{invokerClassName} implements org.jbpm.process.instance.impl.Action, org.drools.core.spi.CompiledInvoker
{
    private static final long serialVersionUID  = 510l;

    public void execute(org.kie.api.runtime.process.ProcessContext context) throws Exception {

        @foreach{type : globalTypes, identifier : globals} @{type} @{identifier} = ( @{type} ) context.getKnowledgeRuntime().getGlobal( "@{identifier}" );
        @end{}

        @foreach{type : variableTypes, identifier : variables} @{type} @{identifier} = ( @{type} ) context.getVariable( "@{identifier}" );
        @end{}

        @{processClassName}.@{methodName} (
	        context@if{globals != empty},@end{}
	        @foreach{identifier : globals} @{identifier}
	        @end{","}@if{variables != empty},@end{}
	        @foreach{identifier : variables} @{identifier}
	        @end{","} );
    }
    
    public String getMethodBytecode() {
        return null;
    }    
}
@end{}

@declare{"returnValueEvaluatorInvoker"}
package @{package};

public class @{invokerClassName} implements org.jbpm.process.instance.impl.ReturnValueEvaluator, org.drools.core.spi.CompiledInvoker
{
    private static final long serialVersionUID  = 510l;

    public Object evaluate(org.kie.api.runtime.process.ProcessContext processContext) throws Exception {

        @foreach{type : globalTypes, identifier : globals} @{type} @{identifier} = ( @{type} ) processContext.getKnowledgeRuntime().getGlobal( "@{identifier}" );
        @end{}

        @foreach{type : variableTypes, identifier : variables} @{type} @{identifier} = ( @{type} ) processContext.getVariable( "@{identifier}" );
        @end{}

        return @{processClassName}.@{methodName} (
	        processContext@if{globals != empty},@end{}
	        @foreach{identifier : globals} @{identifier}
	        @end{","}@if{variables != empty},@end{}
	        @foreach{identifier : variables} @{identifier}
	        @end{","} );
    }
    
    public String getMethodBytecode() {
        return null;
    }
}
@end{}
