Bug 1328838 - Pre-processing Example
Summary: Pre-processing Example
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: doc-Smooks_Guide
Version: 5.3.1
Hardware: x86_64
OS: Windows
unspecified
urgent
Target Milestone: ---
: ---
Assignee: David Le Sage
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 11:56 UTC by Muthu
Modified: 2017-11-10 04:33 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Instance Name: Not Defined Build: CSProcessor Builder Version 1.7 Build Name: 9506, Smooks User Guide-5-5.3.1 Build Date: 06-02-2013 10:31:47
Last Closed: 2017-11-10 04:33:46 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Eclipse Project 1 0 None None None 2016-04-20 11:56:45 UTC

Description Muthu 2016-04-20 11:56:46 UTC
Description of problem:

I need to have a bean to decode string value.Before decoding it needs to replace the apostrophie contents.The variable firstname is a string

How to preform this action.
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
      xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd"
      xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd">

<jb:bean beanId="insuredPersonName"
            class="com.cognizant.insurance.general.domain.party.partyname.PersonName"
            createOnElement="Insured BasicDetails">
            <jb:value property="title" data="Insured BasicDetails salutation" />
            <jb:value property="givenName" data="Insured BasicDetails firstName" decoder="String">
            <jb:decodeParam name="valuePreprocess">
            value=value.replace("'","&#39;")
                                              </jb:decodeParam>
                          </jb:value>
            <jb:value property="surname" data="Insured BasicDetails lastName" />
            <jb:wiring property="transTrackingId" beanIdRef="transTrackingID" />
      </jb:bean>
</smooks-resource-list>
The above Code Throws below error:-

Caused by: org.milyn.SmooksException: Failed to filter source.
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
	at org.milyn.Smooks._filter(Smooks.java:526)
	at org.milyn.Smooks.filterSource(Smooks.java:482)
	at com.cognizant.insurance.general.core.smooks.LifeEngageSmooksHolder.parseJson(LifeEngageSmooksHolder.java:138)
	... 91 more
Caused by: org.milyn.SmooksException: Error in 'org.milyn.smooks.scripting.groovy.SmooksVisitor_27015246_7' while processing the visitAfter event.
	at org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:573)
	at org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:559)
	at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:396)
	at org.milyn.delivery.sax.SAXHandler.endElement(SAXHandler.java:204)
	at org.milyn.delivery.SmooksContentHandler.endElement(SmooksContentHandler.java:96)
	at org.milyn.json.JSONReader.endElement(JSONReader.java:389)
	at org.milyn.json.JSONReader.endElement(JSONReader.java:385)
	at org.milyn.json.JSONReader.parse(JSONReader.java:299)
	at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
	at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
	... 95 more
Caused by: java.lang.IllegalArgumentException: null 'bean' arg in method call.
	at org.milyn.assertion.AssertArgument.isNotNull(AssertArgument.java:42)


Note You need to log in before you can comment on or make changes to this bug.