return new Callable<Response>() {
@Override
public Response call() throws Exception {
URIBuilder uri = uri( Workflow.SERVICE_PATH, "/jobs" );
addQueryParam( uri, "action", action );
HttpPost request = new HttpPost( uri.build() );
HttpEntity entity = null;
if( text != null ) {
entity = new StringEntity( text, ContentType.create( "application/xml", "UTF-8" ) );
} else if( file != null ) {
entity = new FileEntity( new File( file ), ContentType.create( "application/xml" ) );