You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by g....@telecgt.it on 2014/04/09 17:40:54 UTC

How to copy a parameter from simple methods and send to context for a following service

Hi,
I’ve a service group, so there is something like: 

<service name="xxxxx" engine="group" transaction-timeout="300">
        <group>
            <invoke name="A" result-to-context="true"/>
            <invoke name="B" result-to-context="true"/>
</service>


A is a service like : 


<service name="A" engine="simple" 
            location="component://content/script/org/ofbiz/content/data/xxServices.xml" invoke="ASimple"
        auth="false" >
        <description>PROVA</description>
        <attribute name="uploadedFile" type="java.nio.ByteBuffer" mode="INOUT" optional="true"/>
        <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" mode="OUT" optional="false"/>      
    </service>

<simple-method method-name="ASimple" >   
************               <!—Here is where i want to make a  copy of my uploadedFile into uploadeFileOut. –>     *****************
             <field-to-result field="parameters.uploadedFile" result-name="uploadedFileOut"/> 
    </simple-method>


B is a service like:

<service name="B" engine="simple"
            location="component://content/script/org/ofbiz/content/data/xxServices.xml" invoke="BSimple">
        <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" mode="IN" optional="false"/> 
    </service>

Now before that BSimple is invocated, the Service ‘B’ broke out. It says that it’s necessary the attribute "uploadedFileOut" for input( IN ). I thought that during the esecution of simple method ‘ASimple’, i would copy the uploadedFile into an attribute ‘uploadedFileOut’ but it doesn’t.
Any explanation?

Thanks 



Re: How to copy a parameter from simple methods and send to context for a following service

Posted by g....@telecgt.it.
Hi Jacques, i've resolved the issued in a different way, but shortly...
mine implementation of Bsimple had to use 'uploadedFileOut' in a different 
way of 'uploadedFile'.

But, i didn't know how to copy in a simple method a 'IN' parameter, in an 
'OUT' parameter.

Is it the right way??

<service name="A" engine="simple"
             location="component://content/script/org/ofbiz/content/data/xxServices.xml" 
invoke="ASimple"          auth="false" >
         <description>PROVA</description>
        <attribute name="uploadedFile" type="java.nio.ByteBuffer" 
mode="INOUT" optional="true"/>
          <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" 
mode="OUT" optional="false"/>
      </service>

<simple-method method-name="ASimple" >
************               <!—Here is where i want to make a  copy of my 
uploadedFile into uploadeFileOut. –>     *****************
               <field-to-result field="parameters.uploadedFile" 
result-name="uploadedFileOut"/>
      </simple-method>






-----Original Message----- 
From: Jacques Le Roux
Sent: Saturday, April 12, 2014 2:25 PM
To: user@ofbiz.apache.org
Subject: Re: How to copy a parameter from simple methods and send to context 
for a following service

What is your implementation of service B ?

Jacques

Le 09/04/2014 17:40, g.fitini@telecgt.it a écrit :
> Hi,
> I’ve a service group, so there is something like:
>
> <service name="xxxxx" engine="group" transaction-timeout="300">
>          <group>
>              <invoke name="A" result-to-context="true"/>
>              <invoke name="B" result-to-context="true"/>
> </service>
>
>
> A is a service like :
>
>
> <service name="A" engine="simple"
> 
> location="component://content/script/org/ofbiz/content/data/xxServices.xml" 
> invoke="ASimple"
>          auth="false" >
>          <description>PROVA</description>
>          <attribute name="uploadedFile" type="java.nio.ByteBuffer" 
> mode="INOUT" optional="true"/>
>          <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" 
> mode="OUT" optional="false"/>
>      </service>
>
> <simple-method method-name="ASimple" >
> ************               <!—Here is where i want to make a  copy of my 
> uploadedFile into uploadeFileOut. –>     *****************
>               <field-to-result field="parameters.uploadedFile" 
> result-name="uploadedFileOut"/>
>      </simple-method>
>
>
> B is a service like:
>
> <service name="B" engine="simple"
> 
> location="component://content/script/org/ofbiz/content/data/xxServices.xml" 
> invoke="BSimple">
>          <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" 
> mode="IN" optional="false"/>
>      </service>
>
> Now before that BSimple is invocated, the Service ‘B’ broke out. It says 
> that it’s necessary the attribute "uploadedFileOut" for input( IN ). I 
> thought that during the esecution of simple method ‘ASimple’, i would copy 
> the uploadedFile into an attribute ‘uploadedFileOut’ but it doesn’t.
> Any explanation?
>
> Thanks
>
>
>

--  


Re: How to copy a parameter from simple methods and send to context for a following service

Posted by Jacques Le Roux <ja...@les7arts.com>.
What is your implementation of service B ?

Jacques

Le 09/04/2014 17:40, g.fitini@telecgt.it a écrit :
> Hi,
> I’ve a service group, so there is something like:
>
> <service name="xxxxx" engine="group" transaction-timeout="300">
>          <group>
>              <invoke name="A" result-to-context="true"/>
>              <invoke name="B" result-to-context="true"/>
> </service>
>
>
> A is a service like :
>
>
> <service name="A" engine="simple"
>              location="component://content/script/org/ofbiz/content/data/xxServices.xml" invoke="ASimple"
>          auth="false" >
>          <description>PROVA</description>
>          <attribute name="uploadedFile" type="java.nio.ByteBuffer" mode="INOUT" optional="true"/>
>          <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" mode="OUT" optional="false"/>
>      </service>
>
> <simple-method method-name="ASimple" >
> ************               <!—Here is where i want to make a  copy of my uploadedFile into uploadeFileOut. –>     *****************
>               <field-to-result field="parameters.uploadedFile" result-name="uploadedFileOut"/>
>      </simple-method>
>
>
> B is a service like:
>
> <service name="B" engine="simple"
>              location="component://content/script/org/ofbiz/content/data/xxServices.xml" invoke="BSimple">
>          <attribute name="uploadedFileOut" type="java.nio.ByteBuffer" mode="IN" optional="false"/>
>      </service>
>
> Now before that BSimple is invocated, the Service ‘B’ broke out. It says that it’s necessary the attribute "uploadedFileOut" for input( IN ). I thought that during the esecution of simple method ‘ASimple’, i would copy the uploadedFile into an attribute ‘uploadedFileOut’ but it doesn’t.
> Any explanation?
>
> Thanks
>
>
>

--