use of org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.TimerSettingsTypeSerializer in project kie-wb-common by kiegroup.
the class TimerSettingsTypeSerializerTest method setUp.
@Before
public void setUp() {
timerSettings = new TimerSettingsValue(TIME_DATE, TIME_DURATION, TIME_CYCLE, TIME_CYCLE_LANGUAGE);
serializer = new TimerSettingsTypeSerializer();
}
use of org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.TimerSettingsTypeSerializer in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method setTimerEventProperties.
private void setTimerEventProperties(TimerEventDefinition timerEventDef, Map<String, Object> properties) {
final TimerSettingsValue timerSettings = new TimerSettingsValue();
if (timerEventDef.getTimeDate() != null) {
timerSettings.setTimeDate(((FormalExpression) timerEventDef.getTimeDate()).getBody());
}
if (timerEventDef.getTimeDuration() != null) {
timerSettings.setTimeDuration(((FormalExpression) timerEventDef.getTimeDuration()).getBody());
}
if (timerEventDef.getTimeCycle() != null) {
timerSettings.setTimeCycle(((FormalExpression) timerEventDef.getTimeCycle()).getBody());
if (((FormalExpression) timerEventDef.getTimeCycle()).getLanguage() != null) {
timerSettings.setTimeCycleLanguage(((FormalExpression) timerEventDef.getTimeCycle()).getLanguage());
}
}
properties.put(TIMERSETTINGS, new TimerSettingsTypeSerializer().serialize(timerSettings));
}
Aggregations