Hey guys.
Another Spin question I could not quickly figure out via the docs or examples.
I want to use Groovy to:
- create a new process variable
- use xPath to get
- but have a Java Object as process variable it is derived from
That works perfectly as expression:
$XML(application).xPath('/creditorApplication/bankIdentifierCode').element().textContent();
But XML() is not usable in Groovy – I can only use S – but then the Java Object is used and not transformed into XML. But
S(application).xPath('/creditorApplication/bankIdentifierCode').element().textContent();
gives:
Caused by: java.lang.IllegalArgumentException: SPIN-01001 Unsupported input of type 'com.camunda.demo.webinar.dataconnect.CreditorApplication'
at org.camunda.spin.impl.logging.SpinCoreLogger.unsupportedInputParameter(SpinCoreLogger.java:39)
at org.camunda.spin.impl.SpinFactoryImpl.createSpin(SpinFactoryImpl.java:56)
at org.camunda.spin.Spin.S(Spin.java:64)
How can I achieve this?
Thanks
Bernd
Hi Christian.
I did try
S(application, xml())
as indicated in the docs – but xml() is not available in Groovy as well. Daniel gave me the hint to use “application/xml” as String – and this works:
S(application, 'application/xml').xPath(…
Maybe that should be added as hint in the docs accordingly?
Thanks and cheers
Bernd
Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Christian Lipphardt
Gesendet: Dienstag, 6. Januar 2015 14:53
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Spin: How to transform from Java Object into XML in Groovy
Hi Bernd,
Did you try using S(application, xml()) ?
It should be exactly the same as XML(application). See Spin documentation[1].
Otherwise you could use the powerful XML features of Groovy directly [2|.
[1]: http://docs.camunda.org/latest/api-references/spin/#handling-xml-reading-xml
[2]: http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper
On 06.01.15 14:38, Bernd Rücker (camunda) wrote:
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/e3445f13.000014c0.00000044%40ca-ruecker.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/54ABE8D4.70800%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.
import static org.camunda.spin.DataFormats.*;