Search in sources :

Example 1 with TimeDuration

use of org.camunda.bpm.model.bpmn.instance.TimeDuration in project camunda-bpmn-model by camunda.

the class TimeDurationImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TimeDuration.class, BPMN_ELEMENT_TIME_DURATION).namespaceUri(BPMN20_NS).extendsType(Expression.class).instanceProvider(new ModelTypeInstanceProvider<TimeDuration>() {

        public TimeDuration newInstance(ModelTypeInstanceContext instanceContext) {
            return new TimeDurationImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : Expression(org.camunda.bpm.model.bpmn.instance.Expression) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) TimeDuration(org.camunda.bpm.model.bpmn.instance.TimeDuration) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with TimeDuration

use of org.camunda.bpm.model.bpmn.instance.TimeDuration in project camunda-bpmn-model by camunda.

the class AbstractCatchEventBuilder method timerWithDuration.

/**
 * Sets an event definition for the timer with a time duration.
 *
 * @param timerDuration the time duration of the timer
 * @return the builder object
 */
public B timerWithDuration(String timerDuration) {
    TimeDuration timeDuration = createInstance(TimeDuration.class);
    timeDuration.setTextContent(timerDuration);
    TimerEventDefinition timerEventDefinition = createInstance(TimerEventDefinition.class);
    timerEventDefinition.setTimeDuration(timeDuration);
    element.getEventDefinitions().add(timerEventDefinition);
    return myself;
}
Also used : TimeDuration(org.camunda.bpm.model.bpmn.instance.TimeDuration) TimerEventDefinition(org.camunda.bpm.model.bpmn.instance.TimerEventDefinition)

Aggregations

TimeDuration (org.camunda.bpm.model.bpmn.instance.TimeDuration)2 Expression (org.camunda.bpm.model.bpmn.instance.Expression)1 TimerEventDefinition (org.camunda.bpm.model.bpmn.instance.TimerEventDefinition)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1