Win a copy of Head First Android this week in the Android forum!

sally tkhilaishvili

+ Follow
since Feb 05, 2017
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sally tkhilaishvili

down vote
I want to get real name of file from one previous flowfile and then match how many flowfile with this name exists in certain directory , here is my code but it trows exception which tells that startup failed because unexpected char 0XFFFF, here is my code what should i change?

how should i connect certain hadoop directory?
if my configuration details are placed in xml how can i connect to hdfs directory?

import import java.nio.charset.StandardCharsets

4 years ago
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 {
4 years ago
Yes  i did , but  it  doesn't  help  then  i  change nodePrint    by  def newXml=  groovy.xml.XmlUtil.serialize( xml ) and   it  worked   perfectly
4 years ago
I want to get xml content then update it and send it back to it's original place, but evry time i run my code it seems that extra characters are added ('\r' and '\n') with this updated data and as a result it increases file size , how can i remove this characters?  When  i try to  update  my  xml   at   first  time  it  changes  xml  tag  values  but  on  the  other  attempts it  neither  trows  exception nor updates  data,  is  it  because  that  this  '\n'  are changing  position  xml tag  values?  :
[code=groovy]def xml = new XmlParser().parseText(content)
           for(int i=0;i<value.size();i++) {
               date = value.get(i).substring(0, 10);
               xml.Mr.ross.details.findAll( { p ->
                  p.runAs[0].text() == "true" &&  date.toString()== p.start[0].text();
               }).each({ p ->
                   p.start[0].value =addDays( p.start[0].text())
                   p.runAs[0].value ="true"

For example xml data looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><service>
                                                                     this is  patch                                                

4 years ago