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)
)
}
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.