public static <T> T withProcessApplicationContext(Callable<T> callable, ProcessApplicationReference reference) throws Exception {
    try {
      setCurrentProcessApplication(reference);
      return callable.call();
    }
    finally {
      clear();
    }
  }
public static < T > T withProcessApplicationContext ( Callable < T > callable , ProcessApplicationReference reference ) throws Exception { try { setCurrentProcessApplication ( reference ) ; return callable . call ( ) ; } finally { clear ( ) ; } }
<p>Takes a callable and executes all engine API invocations within that callable in the context
of the given process application

<p>Equivalent to
<pre>
try {
ProcessApplicationContext.setCurrentProcessApplication("someProcessApplication");
callable.call();
} finally {
ProcessApplicationContext.clear();
}
</pre>

@param callable the callable to execute
@param reference a reference of the process application to switch into