Hi
I have a script task node in my process definition, and I want to do a little complicated operations inside it, more than manipulation of process variables. I decided to write a class and proper methods to do that, and then call them from inside code I wrote inside 'Action' of this user task node. First, please tell me how to that in the right way, and after that, if there is a better alternative for that, please let me know it.
I wrote something like:
MyClass x = new MyClass();
x.myMethod();
in the action and chose the javaDialect, and wrote something like:
import com.MyClass;
in the import tab of action for the script task. But when I run the app, I see this error:
java.lang.IllegalArgumentException: Cannot add asset: Process Compilation error com.MyClass cannot be resolved to a type
com.MyClass cannot be resolved to a type,
It takes place in the line I want to add asset to RuntimeEnvironment to get RuntimeManager from it:
RuntimeEnvironment runtimeEnvironment = RuntimeEnvironmentBuilder.Factory.get()
.newDefaultBuilder()
.entityManagerFactory(emf)
.userGroupCallback(myUserGroupCallback)
.addAsset(
ResourceFactory.newClassPathResource("Sample.bpmn"),
ResourceType.BPMN2)
.get();
How should I import a class and then use its methods inside action of a script task?
Is there another way to do some machine task in certain places of a flow?