@java.lang.SuppressWarnings("unused") public interface ServiceCallJob extends ServiceCall, java.util.concurrent.Future
An interface for ad-hoc (explicit) run of configured service jobs (in the moqui.service.job.ServiceJob entity). This interface has minimal options as most should be configured using ServiceJob entity fields.
Type Params | Return Type | Name and description |
---|---|---|
|
public ServiceCallJob |
localOnly(boolean local) Set to true to run local even if a distributed executor service is configured (defaults to false) |
|
public ServiceCallJob |
parameter(java.lang.String name, java.lang.Object value) Single name, value pairs to put in the context (in parameters) passed to the service. |
|
public ServiceCallJob |
parameters(java.util.Map<java.lang.String, java.lang.Object> context) Map of name, value pairs that make up the context (in parameters) passed to the service. |
|
public java.lang.String |
run() Run a service job. |
Methods inherited from class | Name |
---|---|
interface ServiceCall |
getCurrentParameters, getServiceName |
interface java.util.concurrent.Future |
java.util.concurrent.Future#isDone(), java.util.concurrent.Future#get(), java.util.concurrent.Future#get(long, java.util.concurrent.TimeUnit), java.util.concurrent.Future#cancel(boolean), java.util.concurrent.Future#isCancelled() |
Set to true to run local even if a distributed executor service is configured (defaults to false)
Single name, value pairs to put in the context (in parameters) passed to the service.
Map of name, value pairs that make up the context (in parameters) passed to the service.
Run a service job. The job will always run asynchronously. To get the results of the service call without looking at the ServiceJobRun.results field keep a reference to this object and use the methods on the java.util.concurrent.Future interface. If the ServiceJob.topic field has a value a notification will be sent to the current user and all users configured using ServiceJobUser records. The NotificationMessage.message field will be the results of this service call.