Activity activity = execution.getActivity();
String subProcessActivityName = subProcessInstance.getActivityName();
if (outcomeExpression!=null) {
ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
Object value = scriptManager.evaluateExpression(outcomeExpression, null);
// if the value is a String and matches the name of an outgoing transition
if ( (value instanceof String)
&& (activity.hasOutgoingTransition(((String) value)))
) {
// then take that one