Compare commits
2 Commits
master
...
feature/sc
| Author | SHA1 | Date | |
|---|---|---|---|
| 511c31a522 | |||
| 406d0d5954 |
@ -142,6 +142,11 @@
|
||||
<groupId>cn.axzo</groupId>
|
||||
<artifactId>riven-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.aviator</groupId>
|
||||
<artifactId>aviator</artifactId>
|
||||
<version>5.4.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package cn.axzo.workflow.server;
|
||||
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
import com.googlecode.aviator.AviatorEvaluatorInstance;
|
||||
import com.googlecode.aviator.EvalMode;
|
||||
import com.googlecode.aviator.Options;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2024-11-28 10:06
|
||||
*/
|
||||
public class Main {
|
||||
public static void main(String[] args) throws Exception {
|
||||
AviatorEvaluatorInstance engine = AviatorEvaluator.newInstance(EvalMode.ASM);
|
||||
engine.setOption(Options.TRACE_EVAL, false);
|
||||
|
||||
Object execute = engine.execute("943+782+887+1043+801+1042+812+882+1300+1900+3720+3415-16000");
|
||||
System.out.println(execute);
|
||||
}
|
||||
}
|
||||
10
workflow-engine-server/src/main/resources/examples/basic.av
Normal file
10
workflow-engine-server/src/main/resources/examples/basic.av
Normal file
@ -0,0 +1,10 @@
|
||||
let a = 99;
|
||||
let b = 0xFF;
|
||||
let c = -99;
|
||||
|
||||
println(a + b);
|
||||
println(a / b);
|
||||
println(a - b + c);
|
||||
println(a + b * c);
|
||||
println(a - (b - c));
|
||||
println(a / b * b + a % b);
|
||||
@ -0,0 +1 @@
|
||||
println("hello,AviatorScript!");
|
||||
18
workflow-engine-server/src/main/resources/examples/use.av
Normal file
18
workflow-engine-server/src/main/resources/examples/use.av
Normal file
@ -0,0 +1,18 @@
|
||||
## examples/use.av
|
||||
|
||||
use java.util.*;
|
||||
|
||||
let list = new ArrayList(10);
|
||||
|
||||
seq.add(list, 1);
|
||||
seq.add(list, 2);
|
||||
|
||||
p("list[0]=#{list[0]}");
|
||||
p("list[1]=#{list[1]}");
|
||||
|
||||
let set = new HashSet();
|
||||
seq.add(set, "a");
|
||||
seq.add(set, "a");
|
||||
|
||||
p("set type is: " + type(set));
|
||||
p("set is: #{set}");
|
||||
Loading…
Reference in New Issue
Block a user