Re: Class and Methods to find job ID and job Name in a service

2023-04-18 Thread Jacques Le Roux

                    not coming, of course

Le 18/04/2023 à 15:39, Jacques Le Roux a écrit :

As you can see at 
https://lists.apache.org/thread/pqmq1x95hlbqwhhzygsvdq2ocwqo10p0 images are 
most of the time coming to this ML

HTH 


Re: Class and Methods to find job ID and job Name in a service

2023-04-18 Thread Jacques Le Roux

Hi Mahi,

As you can see at 
https://lists.apache.org/thread/pqmq1x95hlbqwhhzygsvdq2ocwqo10p0 images are 
most of the time coming to this ML

HTH

Jacques

Le 18/04/2023 à 12:23, Mahi maheshwari a écrit :

Hello Community,

Is there a way to find and access the job Id and job name inside a Java service?
I have a service "SendEmailService" written in Java for mail notification, for 
this, I have created the job in jobSandBox.
whenever the "SendEmailService" service is called by the scheduler then inside this service, I want to know the job name associated with that 
service for the calling service.

I'm attaching the image below, please take a look at the attachment for 
reference.

*_for example: _*
SendEmailService(HttpServletRequest request, HttpServletResponse response){
     code to get a job id and job name
}

Regards,
Maheshwari.

Re: Class and Methods to find job ID and job Name in a service

2023-04-18 Thread Michael Brohl

As an addition a few remarks:

OFBiz already has services ready to use for asynchronous mail delivery 
(see services_email.xml in framework/common/servicedef).


The example code for SendEmailService does not represent a valid service 
method signature. It seems to be an event method which is not the same 
thing. Events cannot be scheduled as a job, whereas services can.


Best regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 18.04.23 um 14:42 schrieb Aditya Sharma:

Hello Mahi,

Though I could not understand your use case completely, I suspect you are
looking for RuntimeData. Instead of identifying the job and deciding, you
should prepare distinct runtime data for different jobs. RuntimeData will
be passed to the service during job execution, based upon which you could
decide further actions.

Refer to this job data:
https://github.com/apache/ofbiz-framework/blob/49bcc245007b685ff3dc423b143acf9ae22b4a5b/applications/manufacturing/data/ManufacturingScheduledServices.xml#L39


PS. Attachments are filtered out on lists, so you could store the image on
platforms like google drive, dropbox, etc, and share the link here.

HTH

Thanks and Regards,
Aditya Sharma

On Tue, Apr 18, 2023 at 3:53 PM Mahi maheshwari 
wrote:


Hello Community,

Is there a way to find and access the job Id and job name inside a Java
service?
I have a service "SendEmailService" written in Java for mail notification,
for this, I have created the job in jobSandBox.
whenever the "SendEmailService" service is called by the scheduler then
inside this service, I want to know the job name associated with that
service for the calling service.
I'm attaching the image below, please take a look at the attachment for
reference.

*for example: *
SendEmailService(HttpServletRequest request, HttpServletResponse response){
  code to get a job id and job name
}

Regards,
Maheshwari.



Re: Class and Methods to find job ID and job Name in a service

2023-04-18 Thread Aditya Sharma
Hello Mahi,

Though I could not understand your use case completely, I suspect you are
looking for RuntimeData. Instead of identifying the job and deciding, you
should prepare distinct runtime data for different jobs. RuntimeData will
be passed to the service during job execution, based upon which you could
decide further actions.

Refer to this job data:
https://github.com/apache/ofbiz-framework/blob/49bcc245007b685ff3dc423b143acf9ae22b4a5b/applications/manufacturing/data/ManufacturingScheduledServices.xml#L39


PS. Attachments are filtered out on lists, so you could store the image on
platforms like google drive, dropbox, etc, and share the link here.

HTH

Thanks and Regards,
Aditya Sharma

On Tue, Apr 18, 2023 at 3:53 PM Mahi maheshwari 
wrote:

> Hello Community,
>
> Is there a way to find and access the job Id and job name inside a Java
> service?
> I have a service "SendEmailService" written in Java for mail notification,
> for this, I have created the job in jobSandBox.
> whenever the "SendEmailService" service is called by the scheduler then
> inside this service, I want to know the job name associated with that
> service for the calling service.
> I'm attaching the image below, please take a look at the attachment for
> reference.
>
> *for example: *
> SendEmailService(HttpServletRequest request, HttpServletResponse response){
>  code to get a job id and job name
> }
>
> Regards,
> Maheshwari.
>


Class and Methods to find job ID and job Name in a service

2023-04-18 Thread Mahi maheshwari
Hello Community,

Is there a way to find and access the job Id and job name inside a Java
service?
I have a service "SendEmailService" written in Java for mail notification,
for this, I have created the job in jobSandBox.
whenever the "SendEmailService" service is called by the scheduler then
inside this service, I want to know the job name associated with that
service for the calling service.
I'm attaching the image below, please take a look at the attachment for
reference.

*for example: *
SendEmailService(HttpServletRequest request, HttpServletResponse response){
 code to get a job id and job name
}

Regards,
Maheshwari.