IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2011-09-29T14:17:38Z by wilmor324
wilmor324
wilmor324
2 Posts

Pinned topic How can I save the time that a job last ran?

‏2011-09-28T15:48:06Z |
Hi,

I was initially trying to use a salesforce "Poll Updated Objects" activity which handles persisting the last job execution automatically; however, it seems that the poll activity exceptions aren't handled by the Catch All. So I decided to try just combining a "Schedule Job" activity with an "Get Updated Objects" activity. (The "Get Updated Objects" activity exceptions do get handled by the Catch All). So now I just need to be able to save the time that the job last completed so that I can read this value as the "getModifiedSince" date when the job runs the next time. So basically I'm trying to mimic the functionality of a "Poll Updated Objects" activity by combining a "Schedule Job" and "Get Updated Objects". Is there a built in way that I can persist a value and then read it again? I think that if I use a variable, it will lose its value when the orchestration completes.
Updated on 2011-09-29T14:17:38Z at 2011-09-29T14:17:38Z by wilmor324
  • sharpme
    sharpme
    1 Post

    Re: How can I save the time that a job last ran?

    ‏2011-09-28T19:32:38Z  
    I would recommend creating a custom object in Salesforce that stores a single Date/Time value for the last successful run. In Cast Iron Studio, design your orchestration to use the Salesforce.com activity "Get Server Timestamp" as the first activity after your starter activity to get the current server time. At the end of your orchestration upon success, you can use a Salesforce.com "Update Objects" activity and map this timestamp variable to your custom object. This will allow you to persist the time across multiple runs as well as will keepthe time consistent with Salesforce's server clock.
  • wilmor324
    wilmor324
    2 Posts

    Re: How can I save the time that a job last ran?

    ‏2011-09-29T14:17:38Z  
    • sharpme
    • ‏2011-09-28T19:32:38Z
    I would recommend creating a custom object in Salesforce that stores a single Date/Time value for the last successful run. In Cast Iron Studio, design your orchestration to use the Salesforce.com activity "Get Server Timestamp" as the first activity after your starter activity to get the current server time. At the end of your orchestration upon success, you can use a Salesforce.com "Update Objects" activity and map this timestamp variable to your custom object. This will allow you to persist the time across multiple runs as well as will keepthe time consistent with Salesforce's server clock.
    Thanks. Very useful information.