protected Map < String , String > createBindings ( List < Variable > childVars , int index , Microservice service , boolean passDocumentContent ) throws ActivityException { Map < String , String > parameters = new HashMap <> ( ) ; for ( int i = 0 ; i < childVars . size ( ) ; i ++ ) { Variable childVar = childVars . get ( i ) ; if ( childVar . isInput ( ) ) { String subflowVarName = childVar . getName ( ) ; Object value = service . getBindings ( ) . get ( subflowVarName ) ; if ( value != null ) { String stringValue = String . valueOf ( value ) ; if ( passDocumentContent ) { if ( VariableTranslator . isDocumentReferenceVariable ( getPackage ( ) , childVar . getType ( ) ) && stringValue . startsWith ( "DOCUMENT:" ) ) { stringValue = getDocumentContent ( new DocumentReference ( stringValue ) ) ; } } parameters . put ( subflowVarName , stringValue ) ; } } } String processName = getSubflow ( service ) . getName ( ) ; if ( processName . startsWith ( "$" ) && parameters . get ( processName ) == null ) { // template variable will populate process name parameters . put ( processName , service . getName ( ) ) ; } if ( parameters . get ( "i" ) == null ) parameters . put ( "i" , String . valueOf ( index ) ) ; return parameters ; }
Returns variable bindings to be passed into subprocess .