2017-04-03 12 views
0

an Excel file (xlsx)からデータを読み込み、ファイルコネクタを使用して、データをweaveでapplication/javaに変換しています。テキストセルから数値を取得できません。

メッセージ:テキストセル(数値例外)から数値を取得できません。 ペイロード:[email protected]

ここ
<dw:input-payload mimeType="application/xlsx"> 
</dw:input-payload> 

がdataweaveです:

%dw 1.0 
%output application/java 
--- 

payload."Sheet1" map ((sheet1 , indexOfSheet1) -> { 
    id: sheet1.id 
}) 

セルの書式が一般的に変更された場合は、例外がなくなっています。どのように私は会計タイプの細胞でExcelのためにこれを働かせることができますか?

+0

がお願いしています1.0 %出力アプリケーション/ javaの --- ペイロードDW例外に – Yevgeniy

+0

%の原因となるExcelの文書とdataweaveを提供 "シート1" マップ((シート1、indexOfSheet1) - > { \t IDが:。 をsheet1.id })https://drive.google.com/open?id=0B2VwKPUfZyE0NUJvYzZZNmNIdkk – user94538

答えて

0

スタジオバージョン6.2.3およびMuleランタイム3.8.1 EEで最初にローカルのスタジオで同じシナリオを作成しましたが、いくつかの問題がありました。 3.8.3 EEにランタイムを更新しました。すべての問題が解消されました&すべて正常に動作しているようです。バージョンの問題があるかどうかを確認し、最近データウェイブに追加されたサポートを引き続きサポートします。ここで

https://forums.mulesoft.com/questions/42650/ms-excelxls-on-dataweave.html

私のためにここでは、コンソールから

   <?xml version="1.0" encoding="UTF-8"?> 
    <mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
     xmlns:spring="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
    http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
    http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd"> 
     <flow name="xslxreaderFlow"> 
      <file:inbound-endpoint path="C:\files\input" responseTimeout="10000" doc:name="File"/> 
      <dw:transform-message doc:name="Transform Message" metadata:id="aa47f058-609d-4d96-9646-a52accacaf9f"> 
       <dw:input-payload doc:sample="sample_data\excel_1.xlsx" mimeType="application/xlsx"/> 
       <dw:set-payload><![CDATA[%dw 1.0 
    %output application/java 
    --- 

    payload."Sheet1" map ((sheet1 , indexOfSheet1) -> { 
     id: sheet1.ID, 
     amount:sheet1.Amount 
    })]]></dw:set-payload> 
      </dw:transform-message> 
      <logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/> 
     </flow> 
    </mule> 

出力結果

INFO 2017-04-04 16:46:57,940 [[test].connector.file.mule.default.receiver.01] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: C:\files\input\Book1.xlsx 
INFO 2017-04-04 16:47:00,719 [[test].xslxreaderFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: [{id=123456, amount=5000.75}, {id=234567, amount=45367.34}] 

を働いた流れは、あなたのファイルのログメッセージ

INFO 2017-04-06 09:37:38,650 [[test].connector.file.mule.default.receiver.01] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: C:\files\input\file1.xlsx 
INFO 2017-04-06 09:37:38,792 [[test].xslxreaderFlow.stage1.03] org.mule.api.processor.LoggerMessageProcessor: [{id=1234, amount=500.5}, {id=456, amount=700.25}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}, {id=, amount=}] 
+0

入力ソースと同じExcelを使用しましたか?私は3.8.3 EEランタイムバージョンです。私のフローは正常にファイルを読み取ることができますが、私が添付したファイルは正常に読み取ることはできません。これは、金額項目のデータタイプのためです。書式セルをクリックすると、それが課金であることがわかります。私がGeneralに変更すれば、すべて正常に動作します。 Excelの入力ソースに会計フォーマットのフィールドがある場合は、どうすればこの機能が得られますか? – user94538

+0

私はGoogleドライブからダウンロードしてあなたのファイルを走らせて、うまくいっているようですが、空のセルも作り出しています。私は私の答えにログメッセージを追加しました。 – ssanrao

+0

もちろん、フローはファイルを読み取っていて、autoDeleteをfalseに設定していないので、ピックアップ後に削除されます。ファイル名のパターンはオプションのパラメータです。フローに追加した後も通常どおり実行されます。質問があれば教えてください。 – ssanrao

関連する問題