public static FlowSpec . Builder builder ( URI catalogURI , Properties flowProps ) { String name = flowProps . getProperty ( ConfigurationKeys . FLOW_NAME_KEY ) ; String group = flowProps . getProperty ( ConfigurationKeys . FLOW_GROUP_KEY , "default" ) ; try { URI flowURI = new URI ( catalogURI . getScheme ( ) , catalogURI . getAuthority ( ) , "/" + group + "/" + name , null ) ; FlowSpec . Builder builder = new FlowSpec . Builder ( flowURI ) . withConfigAsProperties ( flowProps ) ; String descr = flowProps . getProperty ( ConfigurationKeys . FLOW_DESCRIPTION_KEY , null ) ; if ( null != descr ) { builder = builder . withDescription ( descr ) ; } return builder ; } catch ( URISyntaxException e ) { throw new RuntimeException ( "Unable to create a FlowSpec URI: " + e , e ) ; } }
Creates a builder for the FlowSpec based on values in a flow properties config .