use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class EventPropertyReader method getTimerSettings.
public TimerSettingsValue getTimerSettings(TimerEventDefinition eventDefinition) {
TimerSettingsValue timerSettingsValue = new TimerSettings().getValue();
toFormalExpression(eventDefinition.getTimeCycle()).ifPresent(timeCycle -> {
timerSettingsValue.setTimeCycle(timeCycle.getBody());
timerSettingsValue.setTimeCycleLanguage(timeCycle.getLanguage());
});
toFormalExpression(eventDefinition.getTimeDate()).ifPresent(timeDate -> {
timerSettingsValue.setTimeDate(timeDate.getBody());
});
toFormalExpression(eventDefinition.getTimeDuration()).ifPresent(timeDateDuration -> {
timerSettingsValue.setTimeDuration(timeDateDuration.getBody());
});
return timerSettingsValue;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class TimerSettingsValueValidatorTest method gwtSetUp.
@Override
protected void gwtSetUp() throws Exception {
super.gwtSetUp();
validator = new TimerSettingsValueValidator();
value = new TimerSettingsValue();
context = new ConstraintValidatorContext() {
@Override
public void disableDefaultConstraintViolation() {
}
@Override
public String getDefaultConstraintMessageTemplate() {
return null;
}
@Override
public ConstraintViolationBuilder buildConstraintViolationWithTemplate(String message) {
errorMessages.add(message);
return new ConstraintViolationBuilder() {
@Override
public NodeBuilderDefinedContext addNode(String name) {
return null;
}
@Override
public ConstraintValidatorContext addConstraintViolation() {
return context;
}
};
}
};
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class EventPropertyWriter method addTimer.
public void addTimer(TimerSettings timerSettings) {
TimerEventDefinition eventDefinition = bpmn2.createTimerEventDefinition();
TimerSettingsValue timerSettingsValue = timerSettings.getValue();
String date = timerSettingsValue.getTimeDate();
if (date != null) {
FormalExpression timeDate = bpmn2.createFormalExpression();
timeDate.setBody(date);
eventDefinition.setTimeDate(timeDate);
}
String duration = timerSettingsValue.getTimeDuration();
if (duration != null) {
FormalExpression timeDuration = bpmn2.createFormalExpression();
timeDuration.setBody(duration);
eventDefinition.setTimeDuration(timeDuration);
}
String cycle = timerSettingsValue.getTimeCycle();
String cycleLanguage = timerSettingsValue.getTimeCycleLanguage();
if (cycle != null && cycleLanguage != null) {
FormalExpression timeCycleExpression = bpmn2.createFormalExpression();
timeCycleExpression.setBody(cycle);
timeCycleExpression.setLanguage(cycleLanguage);
eventDefinition.setTimeCycle(timeCycleExpression);
}
addEventDefinition(eventDefinition);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class TimerSettingsFieldEditorPresenter method onTimeDateChange.
protected void onTimeDateChange() {
TimerSettingsValue oldValue = value;
value = copy(oldValue, true);
value.setTimeDate(view.getTimeDate());
value.setTimeDuration(null);
value.setTimeCycle(null);
value.setTimeCycleLanguage(null);
notifyChange(oldValue, value);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue in project kie-wb-common by kiegroup.
the class TimerSettingsFieldEditorPresenter method onMultipleTimerValuesChange.
protected void onMultipleTimerValuesChange() {
TimerSettingsValue oldValue = value;
value = copy(oldValue, true);
value.setTimeCycleLanguage(view.getTimeCycleLanguage());
value.setTimeCycle(view.getTimeCycle());
value.setTimeDuration(null);
value.setTimeDate(null);
notifyChange(oldValue, value);
}
Aggregations