MulesoftのNetSuite Connectorを使用して、返された検索ペイロードから値を取得する方法を理解しようとしています。MuleSoft NetSuite Connector Search
このコネクタを使用するときはいつでも、出力はList<Map<String, Object>>
です。このタイプの出力のため、DataWeaveを使用して返される値をマップする方法があるかどうかはわかりません。
このリストのコンポーネントを実際に取得し、Datawaveを使用して別のものにマップする方法はありますか?
例では、検索結果レコードのinternalIdを#[payload.hasNext() ? 'Employee Found: ' + payload.next().get('internalId') : 'Employee Not Found']
を使用して取得していますが、値を取得できます。
NetSuite Connectorの「レコードを取得」機能でinternalIdを使用しようとしている別のケースでは、internalIdパラメータpayload.next().get('internalId')
を次のように入力してエラーを取得しようとします。
<netsuite:get-record config-ref="NetSuite_Login_Auth" internalId="#[payload.next().get('internalId')]" type="EMPLOYEE" doc:name="NetSuite"/>
ERROR:
Message : Failed to invoke getRecord. Payload
: [email protected] Payload Type : org.mule.streaming.ConsumerIterator Element : /streamMigrateAccountToCustomer/processors/10/0/1/0/1/searchEmployeeByEntityId/subprocessors/3/1/0 @ sfdc-netsuite-api Element XML : -------------------------------------------------------------------------------- Root Exception stack trace: java.util.NoSuchElementException at org.mule.streaming.AbstractConsumer.consume(AbstractConsumer.java:70) at org.mule.streaming.ConsumerIterator.next(ConsumerIterator.java:60) at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)