Groovy Script Function apiAccessor in Error

1
0
-1

Hi there,

basic I know and really annoying for me, new to Groovy...

I'm writing the following function to return the process name...but apiAccesor and processRuntimeAPI keep getting flagged as follows:

Groovy:Apparent variable 'apiAccessor' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes:

How do I declare the calls? I've lost patience... :)

thanks and regards Seán

import org.bonitasoft.engine.api.ProcessRuntimeAPI;
import java.util.logging.Logger;

def static myName(String key){
       
ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
String processName = processRuntimeAPI.getProcessInstance(processInstanceId).getName();

String taskName = null;
if(processName.contains(" ")){
        taskName = processName.substring(0, processName.indexOf(" "));
        }
        else{
           taskName = processName;
        }
       
}

Comments

Submitted by ismaraycaridad on Tue, 04/26/2016 - 22:05

Hi there,
I'm getting the same error. Do you found how resolve this error?
regards

1 answer

1
0
-1

Hi there,
I'm getting the same error. Do you found how resolve this error?
regards

Notifications