Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Groovy code doesn't work properly  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have several flowfiles in success queue in which I have parameter count and I have to transfer only counter amount of flowfiles, every time the counter value is different so any time I will have to get it from flowfile (all flowfiles from this success queue have this attribute), I have tried this logic below (I mean my code) and several modifications of it but I can't fulfill this task. Could you tell me what's wrong with this code?

import java.nio.charset.StandardCharsets
import groovy.lang.*

def flowFile = session.get();
if (!flowFile)
int numb = (flowFile.getAttribute("count") as Double).round()
def filename = flowFile.getAttribute("filename")

def flowfileList = session.get(numb-1)

if (flowfileList.size() == numb-1) {
} else {
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!