Xquery engine support

114 views
Skip to first unread message

venkataraju...@gmail.com

unread,
Feb 4, 2016, 3:48:10 AM2/4/16
to camunda BPM users
Hi,
Am working on AVOS to Camunda migration project and want to reuse the existing Xqueries which were used extenstively in the current project. But am getting a lot of issues, so even tried with basex implementation, but nothing worked as need to deployed war in jboss, where its getting issues. Can any one of you please let me know which is the best way to use and any sample? Thanks

Christian Lipphardt

unread,
Feb 4, 2016, 5:37:04 AM2/4/16
to camunda BPM users, venkataraju...@gmail.com
Hi,

Maybe you could utilize the XQuery template engine wrapper[2] based on Saxon. It is a Camunda Engine plugin and can be included.
You can read up on the usage of template engines in context of Camunda BPM at [2].

It would be helpful to get more information on the use case. I don't know ActiveVOS and the role of XQueries in it. Are they used to transform and steer the data flow or what are they used for?

Cheers,
Christian

venkataraju...@gmail.com

unread,
Feb 5, 2016, 4:22:34 AM2/5/16
to camunda BPM users, venkataraju...@gmail.com
Hi Christian,
Many thanks for response and links. Have gone through the links earlier seems it mostly xquery usage in java. My requirement is 1. we have a couple of .xq files which are doing a specific functionality in AVOS, which needs to be migrated as they were to Camunda. 2. So, as part of process(some service tasks) in camunda, that .xq files should be mapped to some script activity. 3, The data passing from previous service task, should be passed to these .xq files and should get response. 4. so, am mapping these .xq files as input parameter in script task functionality. But they are not working. Even tried with BASEX implementation, but getting errors...

part of .bpmn file:
<bpmn2:businessRuleTask id="BusinessRuleTask_2" camunda:class="org.camunda.bpm.att.order.process.ValidateOrderDelegate" name="Validate Order">
<bpmn2:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="inputValidateOrder">
<camunda:script scriptFormat="xquery-basex" resource="HelloWorld.xq"/>
</camunda:inputParameter>
</camunda:inputOutput>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
</bpmn2:businessRuleTask>

part of pom.xml
<dependency>
<groupId>org.camunda.template-engines</groupId>
<artifactId>camunda-template-engines-xquery-saxon</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.7.0-1</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon-jdom</artifactId>
<version>8.7</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
...
<dependency>
<groupId>org.basex</groupId>
<artifactId>basex</artifactId>
<version>7.3.1</version>
</dependency>
<dependency>
<groupId>org.basex</groupId>
<artifactId>basex</artifactId>
<version>7.6</version>
</dependency>
<dependency>
<groupId>org.basex</groupId>
<artifactId>basex-api</artifactId>
<version>7.6</version>
</dependency>

<dependency>
<groupId>org.basex</groupId>
<artifactId>basex</artifactId>
<version>8.3</version>
<scope>provided</scope>
</dependency>

...
<repositories>
<repository>
<id>camunda-bpm-nexus</id>
<name>camunda-bpm-nexus</name>
<url>https://app.camunda.com/nexus/content/groups/public</url>
</repository>
<repository>
<id>basex</id>
<name>BaseX Maven Repository</name>
<url>http://files.basex.org/maven</url>
</repository>
<repository>
<id>xqj</id>
<name>XQJ Maven Repository</name>
<url>http://xqj.net/maven</url>
</repository>
</repositories>

Thanks,
Venkataraju Nandam

venkataraju...@gmail.com

unread,
Feb 5, 2016, 6:45:43 AM2/5/16
to camunda BPM users

Hi

, getting errors for diff iterations, but am able to execute the same in other XQuery tools and server. Seems some configuration/jars missing to support xq in jboss in my local.

Ex1.xq

xquery version "3.0" encoding "utf-8";

import module namespace m= 'http://basex.org/modules/Hello' at 'Ex2.xq';

m:hello("Universe")

(: https://docs.marklogic.com/guide/app-dev/import_modules :)

(: http://docs.basex.org/wiki/Repository  :)

 

Ex2.xq

xquery version "3.0" encoding "utf-8";

module namespace m = 'http://basex.org/modules/Hello';

declare function m:hello($world) {

  'Hello ' || $world

};

 

If I use the given above Ex1.xq  Ex2.xq files as they are, am getting this error.

[XPST0003] Empty query & [XQST0033] Duplicate declaration of prefix 'svdnx'

 

If I remove name space(import module 'http://basex.org/modules/Hello' at 'HelloWorld2.xq';), getting the below error

Stopped at ., 1/1:[XPST0003] Empty query.

Stopped at ., 3/1: [XPST0081] No namespace delared for 'm:hello'.

 

If I use Ex2.xq file directly, getting the below error

[XPST0003] Library modules cannot be evaluated.

 

If I use Ex2.xq file directly and removing namespace, getting the below error

Stopped at ., 3/18: [XQST0034] Duplicate declaration of function 'local:hello'

 

If I use Ex2.xq file directly and removing local, getting the below error

[XQST0045] Function 'hello' is in reserved namespace.

 

Thanks & Regards,

VenkataRaju Nandam

Technology Architect, ECSADM

Mobile:+91-9941316666/ +91-8712166699

 

VENKATARAJU NANDAM

unread,
Feb 8, 2016, 2:36:16 AM2/8/16
to camunda-...@googlegroups.com
Sorry, am getting the error in jboss server log as ".

[XPST0003] Empty query & [XQST0033] Duplicate declaration of prefix 'm'" for the given below examples.


Ex1.xq

xquery version "3.0" encoding "utf-8";

import module namespace m= 'http://basex.org/modules/Hello' at 'Ex2.xq';

m:hello("Universe")

 

Ex2.xq

xquery version "3.0" encoding "utf-8";

module namespace m = 'http://basex.org/modules/Hello';

declare function m:hello($world) {

  'Hello ' || $world

};



Am using Ex1.xq file as input for 

    <bpmn2:businessRuleTask id="BusinessRuleTask_2" camunda:class="org.camunda.bpm.att.order.process.ValidateOrderDelegate" name="Validate Order">

      <bpmn2:extensionElements>

        <camunda:inputOutput>

          <camunda:inputParameter name="inputValidateOrder">

            <camunda:script scriptFormat="xquery-basex" resource="Ex1.xq"/>

          </camunda:inputParameter>

        </camunda:inputOutput>

      </bpmn2:extensionElements>

      <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>

      <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>

    </bpmn2:businessRuleTask>

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/RwgoB89WeYw/unsubscribe.
To unsubscribe from this group and all its topics, 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/333da2ed-c73b-4c4b-ace8-a7246791ca85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages