You should try with a workItem insitead of an ActionScript, it will give you more control to debug what is going wrong with your code.. It's not a problem of jBPM5 it's related with java.. You should test your code and then call it from the process.
Cheers