Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "dynamic" triggers #667

Open
ezhulenev opened this issue Oct 29, 2015 · 0 comments
Open

Add support for "dynamic" triggers #667

ezhulenev opened this issue Oct 29, 2015 · 0 comments

Comments

@ezhulenev
Copy link

It would be great to be able to pass a function to "trigger" property, that will be called with slotId. Similar to what is available for oozieExternalService properties.

function deliverAbTrigger(slotId) {
  var scheduledTime = slotId.getScheduledTime();

  // If slot time after 8 AM: depend on same day DELIVER workflow
  // If slot time before 8 AM: depend on previous day DELIVER workflow
  var hour = scheduledTime.getHour();
  var deliverWorkflowShift = (hour >= 8) ? 8 - hour : -1 * hour - (24 - 8);

  // Define trigger based on slot scheduled time
  return offsetTrigger(
    deliverWorkflowShift,
    successTrigger(ID + "-" + DELIVER)
  )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant