scope of parameters in the context

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

scope of parameters in the context

Vince Clark
I have a custom simple method that loops thru a result set of orders in a legacy system and imports them into OFBiz. With each order I am first calling the storeOrder service, then quickShipEntireOrder.

quickShipEntireOrder generates shipments, which triggers the generation of invoices. I would like to set a parameter in my simple method that is visible in the invoice generation code.



Vince Clark
www.globalera.com
[hidden email]
(303) 493-6723 office
(303) 523-4843 cell

Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Adrian Crum
You will need to change the service definition of the service being
called, to accept the additional parameter. Then call the service with
the additional parameter.

-Adrian

Vince Clark wrote:

> I have a custom simple method that loops thru a result set of orders in a legacy system and imports them into OFBiz. With each order I am first calling the storeOrder service, then quickShipEntireOrder.
>
> quickShipEntireOrder generates shipments, which triggers the generation of invoices. I would like to set a parameter in my simple method that is visible in the invoice generation code.
>
>
>
> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Vince Clark
In reply to this post by Vince Clark
I did that. I added an IN parameter to the quickShipEntireOrder definition, then added the new value to the in-map before calling the service. The value doesn't seem to be making it all the way to invoice generation.

Vince Clark
www.globalera.com
[hidden email]
(303) 493-6723 office
(303) 523-4843 cell


----- Original Message -----
From: "Adrian Crum" <[hidden email]>
To: [hidden email]
Sent: Thursday, August 13, 2009 8:33:13 AM GMT -07:00 US/Canada Mountain
Subject: Re: scope of parameters in the context

You will need to change the service definition of the service being
called, to accept the additional parameter. Then call the service with
the additional parameter.

-Adrian

Vince Clark wrote:

> I have a custom simple method that loops thru a result set of orders in a legacy system and imports them into OFBiz. With each order I am first calling the storeOrder service, then quickShipEntireOrder.
>
> quickShipEntireOrder generates shipments, which triggers the generation of invoices. I would like to set a parameter in my simple method that is visible in the invoice generation code.
>
>
>
> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Scott Gray-2
Hi Vince

It's not that simple I'm afraid, each service runs in it's own context  
and you'd need to manually pass the parameter down through the chain  
of services that quick ship triggers.  You'd be better off modifying  
the invoice separately once it's been created.

Regards
Scott

On 14/08/2009, at 2:46 AM, Vince Clark wrote:

> I did that. I added an IN parameter to the quickShipEntireOrder  
> definition, then added the new value to the in-map before calling  
> the service. The value doesn't seem to be making it all the way to  
> invoice generation.
>
> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
> ----- Original Message -----
> From: "Adrian Crum" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, August 13, 2009 8:33:13 AM GMT -07:00 US/Canada  
> Mountain
> Subject: Re: scope of parameters in the context
>
> You will need to change the service definition of the service being
> called, to accept the additional parameter. Then call the service with
> the additional parameter.
>
> -Adrian
>
> Vince Clark wrote:
>> I have a custom simple method that loops thru a result set of  
>> orders in a legacy system and imports them into OFBiz. With each  
>> order I am first calling the storeOrder service, then  
>> quickShipEntireOrder.
>>
>> quickShipEntireOrder generates shipments, which triggers the  
>> generation of invoices. I would like to set a parameter in my  
>> simple method that is visible in the invoice generation code.
>>
>>
>>
>> Vince Clark
>> www.globalera.com
>> [hidden email]
>> (303) 493-6723 office
>> (303) 523-4843 cell
>>
>>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Vince Clark
That is what I was afraid of. I can't modify the invoice because we are letting it post immediately. I have taken another path. I'm storing the value I need on the order record and then retrieving it in the invoice generation code.

This code is in InvoiceServices.java. Interestingly enough, there is a comment in createInvoiceForOrder that suggests an improvement to the code to allow an invoice date to be passed in rather than defaulting to nowTimestamp().

Vince Clark
www.globalera.com
[hidden email]
(303) 493-6723 office
(303) 523-4843 cell


----- Original Message -----
From: "Scott Gray" <[hidden email]>
To: [hidden email]
Sent: Thursday, August 13, 2009 9:15:01 AM GMT -07:00 US/Canada Mountain
Subject: Re: scope of parameters in the context

Hi Vince

It's not that simple I'm afraid, each service runs in it's own context  
and you'd need to manually pass the parameter down through the chain  
of services that quick ship triggers.  You'd be better off modifying  
the invoice separately once it's been created.

Regards
Scott

On 14/08/2009, at 2:46 AM, Vince Clark wrote:

> I did that. I added an IN parameter to the quickShipEntireOrder  
> definition, then added the new value to the in-map before calling  
> the service. The value doesn't seem to be making it all the way to  
> invoice generation.
>
> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
> ----- Original Message -----
> From: "Adrian Crum" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, August 13, 2009 8:33:13 AM GMT -07:00 US/Canada  
> Mountain
> Subject: Re: scope of parameters in the context
>
> You will need to change the service definition of the service being
> called, to accept the additional parameter. Then call the service with
> the additional parameter.
>
> -Adrian
>
> Vince Clark wrote:
>> I have a custom simple method that loops thru a result set of  
>> orders in a legacy system and imports them into OFBiz. With each  
>> order I am first calling the storeOrder service, then  
>> quickShipEntireOrder.
>>
>> quickShipEntireOrder generates shipments, which triggers the  
>> generation of invoices. I would like to set a parameter in my  
>> simple method that is visible in the invoice generation code.
>>
>>
>>
>> Vince Clark
>> www.globalera.com
>> [hidden email]
>> (303) 493-6723 office
>> (303) 523-4843 cell
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Jacopo Cappellato-4
On Aug 13, 2009, at 5:41 PM, Vince Clark wrote:

> That is what I was afraid of. I can't modify the invoice because we  
> are letting it post immediately. I have taken another path. I'm  
> storing the value I need on the order record and then retrieving it  
> in the invoice generation code.
>
> This code is in InvoiceServices.java. Interestingly enough, there is  
> a comment in createInvoiceForOrder that suggests an improvement to  
> the code to allow an invoice date to be passed in rather than  
> defaulting to nowTimestamp().
>

I think I will be able to implement the code today and commit a fix  
for this.

Jacopo


> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
> ----- Original Message -----
> From: "Scott Gray" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, August 13, 2009 9:15:01 AM GMT -07:00 US/Canada  
> Mountain
> Subject: Re: scope of parameters in the context
>
> Hi Vince
>
> It's not that simple I'm afraid, each service runs in it's own context
> and you'd need to manually pass the parameter down through the chain
> of services that quick ship triggers.  You'd be better off modifying
> the invoice separately once it's been created.
>
> Regards
> Scott
>
> On 14/08/2009, at 2:46 AM, Vince Clark wrote:
>
>> I did that. I added an IN parameter to the quickShipEntireOrder
>> definition, then added the new value to the in-map before calling
>> the service. The value doesn't seem to be making it all the way to
>> invoice generation.
>>
>> Vince Clark
>> www.globalera.com
>> [hidden email]
>> (303) 493-6723 office
>> (303) 523-4843 cell
>>
>>
>> ----- Original Message -----
>> From: "Adrian Crum" <[hidden email]>
>> To: [hidden email]
>> Sent: Thursday, August 13, 2009 8:33:13 AM GMT -07:00 US/Canada
>> Mountain
>> Subject: Re: scope of parameters in the context
>>
>> You will need to change the service definition of the service being
>> called, to accept the additional parameter. Then call the service  
>> with
>> the additional parameter.
>>
>> -Adrian
>>
>> Vince Clark wrote:
>>> I have a custom simple method that loops thru a result set of
>>> orders in a legacy system and imports them into OFBiz. With each
>>> order I am first calling the storeOrder service, then
>>> quickShipEntireOrder.
>>>
>>> quickShipEntireOrder generates shipments, which triggers the
>>> generation of invoices. I would like to set a parameter in my
>>> simple method that is visible in the invoice generation code.
>>>
>>>
>>>
>>> Vince Clark
>>> www.globalera.com
>>> [hidden email]
>>> (303) 493-6723 office
>>> (303) 523-4843 cell
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: scope of parameters in the context

Vince Clark
Jacopo - don't do this unless there are other good reasons for it. I found another solution.



Vince Clark
www.globalera.com
[hidden email]
(303) 493-6723 office
(303) 523-4843 cell


----- Original Message -----
From: "Jacopo Cappellato" <[hidden email]>
To: [hidden email]
Sent: Thursday, August 13, 2009 11:19:35 AM GMT -07:00 US/Canada Mountain
Subject: Re: scope of parameters in the context

On Aug 13, 2009, at 5:41 PM, Vince Clark wrote:

> That is what I was afraid of. I can't modify the invoice because we  
> are letting it post immediately. I have taken another path. I'm  
> storing the value I need on the order record and then retrieving it  
> in the invoice generation code.
>
> This code is in InvoiceServices.java. Interestingly enough, there is  
> a comment in createInvoiceForOrder that suggests an improvement to  
> the code to allow an invoice date to be passed in rather than  
> defaulting to nowTimestamp().
>

I think I will be able to implement the code today and commit a fix  
for this.

Jacopo


> Vince Clark
> www.globalera.com
> [hidden email]
> (303) 493-6723 office
> (303) 523-4843 cell
>
>
> ----- Original Message -----
> From: "Scott Gray" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, August 13, 2009 9:15:01 AM GMT -07:00 US/Canada  
> Mountain
> Subject: Re: scope of parameters in the context
>
> Hi Vince
>
> It's not that simple I'm afraid, each service runs in it's own context
> and you'd need to manually pass the parameter down through the chain
> of services that quick ship triggers.  You'd be better off modifying
> the invoice separately once it's been created.
>
> Regards
> Scott
>
> On 14/08/2009, at 2:46 AM, Vince Clark wrote:
>
>> I did that. I added an IN parameter to the quickShipEntireOrder
>> definition, then added the new value to the in-map before calling
>> the service. The value doesn't seem to be making it all the way to
>> invoice generation.
>>
>> Vince Clark
>> www.globalera.com
>> [hidden email]
>> (303) 493-6723 office
>> (303) 523-4843 cell
>>
>>
>> ----- Original Message -----
>> From: "Adrian Crum" <[hidden email]>
>> To: [hidden email]
>> Sent: Thursday, August 13, 2009 8:33:13 AM GMT -07:00 US/Canada
>> Mountain
>> Subject: Re: scope of parameters in the context
>>
>> You will need to change the service definition of the service being
>> called, to accept the additional parameter. Then call the service  
>> with
>> the additional parameter.
>>
>> -Adrian
>>
>> Vince Clark wrote:
>>> I have a custom simple method that loops thru a result set of
>>> orders in a legacy system and imports them into OFBiz. With each
>>> order I am first calling the storeOrder service, then
>>> quickShipEntireOrder.
>>>
>>> quickShipEntireOrder generates shipments, which triggers the
>>> generation of invoices. I would like to set a parameter in my
>>> simple method that is visible in the invoice generation code.
>>>
>>>
>>>
>>> Vince Clark
>>> www.globalera.com
>>> [hidden email]
>>> (303) 493-6723 office
>>> (303) 523-4843 cell
>>>
>>>
>