@ Override @ Path ( "/{ownerType}/{ownerId}" ) @ ApiOperation ( value = "Retrieve values for an ownerType and ownerId" , notes = "Response is a generic JSON object with names/values." ) public JSONObject get ( String path , Map < String , String > headers ) throws ServiceException , JSONException { Map < String , String > parameters = getParameters ( headers ) ; String ownerType = getSegment ( path , 1 ) ; if ( ownerType == null ) // fall back to parameter ownerType = parameters . get ( "ownerType" ) ; if ( ownerType == null ) throw new ServiceException ( "Missing path segment: {ownerType}" ) ; String ownerId = getSegment ( path , 2 ) ; if ( ownerId == null ) // fall back to parameter ownerId = parameters . get ( "ownerId" ) ; if ( ownerId == null ) throw new ServiceException ( "Missing path segment: {ownerId}" ) ; JSONObject valuesJson = new JsonObject ( ) ; Map < String , String > values = ServiceLocator . getWorkflowServices ( ) . getValues ( ownerType , ownerId ) ; if ( values != null ) { for ( String name : values . keySet ( ) ) valuesJson . put ( name , values . get ( name ) ) ; } return valuesJson ; }
Retrieve values .