Search code examples
ibm-integration-bus

Compute Node computes data from previous flow


This is how my flow looks like:

File Input -> File Read -> Compute -> Mapping -> Compute -> File Output

From file read node I save data to ${LocalEnvironment}. Also tried ${Environment}. And this is what happens behind Compute Node:

  1. Send file A - data inside environment of A is computed (edit after answer -> is not computed, flow stops unexpectedly).
  2. Send file B - data inside environment of A is computed.
  3. Send file C - data inside environment of B is computed.
  4. Send file D - data inside environment of C is computed.

How this offset is even possible? ${LocalEnvironment} should be reset at the beggining of the flow.

EDIT:

Never use Environment variable. Local variables should be stored inside $LocalEnvironment/Variables.

Explanation

Got that. And even now I think my Variables aren't being cleared. File Read still produces $LocalEnvironment/Variables/BLOB/BLOB from previous run.

EDIT2:* Node settings: File Input:

Input directory: C:\Users\User1\Documents\In
File pattern: *
Action on successful processing: move to mqsiarchive
Message domain: XMLNS (I know it should be XMLNSC but it works)
Use XMLNSC compact parser...: check

File read:

Input directory: C:\Users\User1\Documents\In\mqsiarchive
File name or pattern: *
Action: Delete
Request directory property location: $LocalEnvironment/Destination/File/Directory
Request filename property location: $LocalEnvironment/Destination/File/Name
Offset property location: $LocalEnvironment/Destination/File/Offset
Length property location: $LocalEnvironment/Destination/File/Length
Result data location: $ResultRoot
Output data location: $OutputLocalEnvironment/Variables
Copy local environment: check
Record selection expression: true()

Compute nodes:

Compute mode: LocalEnvironment and Message

File output (this one doesn't matter much since problem occurs even without it):

Output directory: C:\Users\User1\Documents\Out
Filename or pattern: test.txt
Stage in mqsitransit...: check
Data location: $Body
Request directory property location: $LocalEnvironment/Destination/File/Directory
Request filename property location: $LocalEnvironment/Destination/File/Name

Properties that I didn't mention: default


Solution

  • I think it works like this:

    • In the 1. transaction the File Read node has nothing to read because archive directory is empty. Therefore the message A from File Input is processed.

    • In the 2. transaction the File Read nodes finds message A from 1. transaction. Therefore message B just gets archived and message A from File Read node gets processed (again).