All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netgrif.application.engine.workflow.domain.triggers.DelayTimeTrigger Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.3.3
Show newest version
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