com.netgrif.application.engine.workflow.domain.triggers.DelayTimeTrigger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.workflow.domain.triggers;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeParseException;
/**
* Time trigger that will execute task after specified delay (e.g. 'after 3h 10m') in ISO-8601 format.
*
* @see ISO-8601
*/
public class DelayTimeTrigger extends TimeTrigger {
/**
* Creates new DelayTimeTrigger from specified string in ISO-8601 duration format PnDTnHnMn.nS
*
* @param timeString delay string in format PnDTnHnMn.nS
* @throws DateTimeParseException if the string cannot be parsed into duration
* @see ISO-8601
*/
public DelayTimeTrigger(String timeString) throws DateTimeParseException {
super(timeString);
Duration delayFromNow = Duration.parse(timeString);
startDate = LocalDateTime.now().plus(delayFromNow);
}
@Override
public DelayTimeTrigger clone() {
return new DelayTimeTrigger(timeString);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy