-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5441: [Backport 0.23] Dump feel-scala from 1.11.0 to 1.12.2 r=saig0 a=saig0 ## Description Backport of #5392 ## Related issues closes #5140 closes #4212 Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
- Loading branch information
Showing
5 changed files
with
121 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
expression-language/src/main/java/io/zeebe/el/impl/ZeebeFeelEngineClock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.0. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.0. | ||
*/ | ||
package io.zeebe.el.impl; | ||
|
||
import io.zeebe.util.sched.clock.ActorClock; | ||
import java.time.Instant; | ||
import java.time.ZoneId; | ||
import java.time.ZonedDateTime; | ||
import org.camunda.feel.FeelEngineClock; | ||
|
||
public final class ZeebeFeelEngineClock implements FeelEngineClock { | ||
|
||
private final ActorClock clock; | ||
|
||
public ZeebeFeelEngineClock(final ActorClock clock) { | ||
this.clock = clock; | ||
} | ||
|
||
@Override | ||
public ZonedDateTime getCurrentTime() { | ||
|
||
final long currentMillis = clock.getTimeMillis(); | ||
final var instant = Instant.ofEpochMilli(currentMillis); | ||
final var zone = ZoneId.systemDefault(); | ||
|
||
return instant.atZone(zone); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters