Shiv,

Your XQuery code had some issues. See attached corrected pipeline and
action module code. Also try to change log level from "debug" to "fine" to
see more logs.


Regards,
Indy

On Wed, Sep 14, 2016 at 11:09 AM, Indrajeet Verma <indrajeet.ve...@gmail.com
> wrote:

> Hey Shiv,
>
> It's working fine to me with json documents as well. If you can send your
> complete pipeline, I may try to point out issue.
>
> You may try to set log level "fine" and can see more granular level logs.
> You might catch the issues your own.
>
> Also you may try adding logs in the xqy module 
> /MarkLogic/cpf/actions/mimetype-condition.xqy
> and see what content type/mime type is being logged.
>
> let $_ := xdmp:log("====content-type=====" || $doc-content-type)
> let $_ := xdmp:log($mime-type-patterns)
>
> Which version of ML are you using?
>
> Regards,
> Indy
>
> On Wed, Sep 14, 2016 at 12:04 AM, Shiv Shankar <shiv.shivshan...@gmail.com
> > wrote:
>
>> Hi,
>> As part of Pipeline definition in Content Processing Framework, I need to
>> handle JSON documents. I added below lines in the Pipeline file. But it is
>> unable to call action module. Please advise.'
>>
>> Note: added add-something to module. and the given tutorial is working
>>  for XML content.
>>
>> <execute>
>>
>> <condition>
>>
>> <module>/MarkLogic/cpf/actions/mimetype-condition.xqy</module>
>>
>> <options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy">
>>
>> <mime-type>application/json</mime-type>
>>
>> </options>
>>
>> </condition>
>>
>> <action>
>>
>> <module>do-something.xqy</module>
>>
>> </action>
>>
>> </execute>
>>
>>
>>
>> _______________________________________________
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
<pipeline xmlns="http://marklogic.com/cpf/pipelines";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://marklogic.com/cpf/pipelines pipelines.xsd">
    <pipeline-name>Add-last-date</pipeline-name>
    <pipeline-description> This pipeline add a new property in document with last-modified </pipeline-description>
    <success-action>
        <module>/MarkLogic/cpf/actions/success-action.xqy</module>
    </success-action>
    <failure-action>
        <module>/MarkLogic/cpf/actions/failure-action.xqy</module>
    </failure-action>
    <state-transition>
        <annotation> when a document inserted or updated add a new property in document with
            last-modified </annotation>
        <state>http://marklogic.com/states/initial</state>
        <on-success>http://marklogic.com/states/done</on-success>
        <on-failure>http://marklogic.com/states/error</on-failure>
        <priority>9200</priority>
        <execute>
            <condition>
                <module>/MarkLogic/cpf/actions/mimetype-condition.xqy</module>
                <options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy">
                    <mime-type>application/json</mime-type>
                </options>
            </condition>
            <action>
                <module>add-attributes.xqy</module>
            </action>
        </execute>
    </state-transition>
    <!-- States converted and error not handled here -->
</pipeline>

Attachment: add-attributes.xqy
Description: Binary data

_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to