【问题标题】:scheduling java methods to run on specific time in ofbiz using使用调度java方法在ofbiz中的特定时间运行
【发布时间】:2019-04-11 21:15:13
【问题描述】:

是否可以在 ofbiz 中安排方法在特定时间运行?喜欢数据库中的工作?

我一直在阅读 ofbiz 中的服务,我发现了 JobSandbox 实体,并且 ofbiz 提供了一个非常有用的 GUI 来设置我假设使用 JobSandbox 实体的作业的运行。

我只是想看看是否有参考或手册可以让我通过代码设置服务?

【问题讨论】:

    标签: jobs ofbiz


    【解决方案1】:

    是的,通过代码调度服务非常简单,请查看这个小sn-p:

    long startTime = new java.util.Date().getTime(); 
     int frequency = RecurrenceRule.DAILY; 
     int interval = 1; 
     int count = 20; 
     LocalDispatcher dispatcher=dctx.getDispatcher(); 
     dispatcher.schedule("myService",_context, startTime, frequency, 
    interval, count); 
             }catch (GenericServiceException e){ 
     Debug.logError("Error trying to Schedule My Service: " 
    + e.getMessage()); 
            } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-27
      • 2019-12-26
      • 2011-10-06
      • 1970-01-01
      • 2017-12-13
      • 2014-07-08
      • 1970-01-01
      相关资源
      最近更新 更多