@@ -93,54 +93,41 @@ class TransmissionBuilder {
9393 // logger.log(`pipenodes = ${JSON.stringify(pipenodes)}`)
9494 for ( const node of pipenodes ) {
9595
96- const np = rdf . grapoi ( { dataset : transmissionsDataset , term : node } )
96+ const np = rdf . grapoi ( { dataset : transmissionsDataset , term : node } )
9797 const processorType = np . out ( ns . rdf . type ) . term
98- logger . log ( `processorType = ${ JSON . stringify ( processorType ) } ` )
99-
100- logger . log ( 'is a Trans' )
101- const isTransmissionReference = processorType . equals ( ns . trn . Transmission ) // doesn't cover multi, see isTransmissionReference() below
102-
103-
104- if ( ! isTransmissionReference && ! transmission . get ( node . value ) ) {
105- // const np = rdf.grapoi({ dataset: transmissionsDataset, term: node })
106- // const processorType = np.out(ns.rdf.type).term
98+ const isTransmissionReference = processorType . equals ( ns . trn . Transmission ) // doesn't cover multi, see isTransmissionReference() below
10799
100+ if ( isTransmissionReference ) {
101+ const nestedTransmission = await this . constructTransmission (
102+ transmissionsDataset ,
103+ node ,
104+ configDataset
105+ )
106+ transmission . register ( node . value , nestedTransmission )
107+ } else if ( ! transmission . get ( node . value ) ) {
108+ // Regular processor handling
108109 const settingsNode = np . out ( ns . trn . settings ) . term
109- // const settingsNodeName = settingsNode ? settingsNode.value : undefined
110110
111111 logger . debug ( `Creating processor:
112112 Node: :${ ns . shortName ( node ?. value ) }
113113 Type: :${ ns . shortName ( processorType ?. value ) }
114114 SettingsNode: :${ ns . shortName ( settingsNode ?. value ) }
115115 ` )
116- // Config: \n${processorsConfig}
117- // Check if node is a nested transmission transmissionsDataset
118- // if (processorType && this.isTransmissionReference(processorType)) {
119- // if (processorType && this.isTransmissionReference(transmissionsDataset, node)) { //// processorType
120- if ( processorType && isTransmissionReference ) {
121- const nestedTransmission = await this . constructTransmission (
122- transmissionsDataset ,
123- processorType , // is used?
124- configDataset
125- )
126- transmission . register ( node . value , nestedTransmission )
127- } else {
128- // Regular processor handling
129- const processorBase = await this . createProcessor ( processorType , configDataset )
130- processorBase . id = node . value
131- processorBase . type = processorType
132- if ( settingsNode ) {
133- processorBase . settingsNode = settingsNode
134- }
135-
136- // Set the app reference on the processor
137- processorBase . app = transmission . app
138-
139- // Connect to the transmission's whiteboard
140- processorBase . whiteboard = transmission . whiteboard // feels redundant...
141- processorBase . x = `X`
142- const processorInstance = transmission . register ( node . value , processorBase )
116+
117+ const processorBase = await this . createProcessor ( processorType , configDataset )
118+ processorBase . id = node . value
119+ processorBase . type = processorType
120+ if ( settingsNode ) {
121+ processorBase . settingsNode = settingsNode
143122 }
123+
124+ // Set the app reference on the processor
125+ processorBase . app = transmission . app
126+
127+ // Connect to the transmission's whiteboard
128+ processorBase . whiteboard = transmission . whiteboard // feels redundant...
129+ processorBase . x = `X`
130+ const processorInstance = transmission . register ( node . value , processorBase )
144131 }
145132 }
146133 }
0 commit comments