TangCheng
2025-02-28 d787e447e95c7b897c2cc9c0e832f8d2e5084934
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.smtaiserver.smtaiserver.javaai.jsonflow.core;
 
import com.smtaiserver.smtaiserver.javaai.SMTJavaAIError;
import com.smtservlet.util.Json;
 
public abstract class SMTJsonFlowNode 
{
    protected SMTJsonFlowManager         _manager;
    private String                        _id;
    private String                        _title;
    
    public abstract SMTJavaAIError executeFlowNode(SMTJsonFlowExecArg execArg) throws Exception;
    
    public SMTJsonFlowNodeExec createFlowNodeExec()
    {
        SMTJsonFlowNodeExec exec = new SMTJsonFlowNodeExec();
        exec.intiInstance(this);
        
        return exec;
    }
    
    public boolean isStartNode()
    {
        return false;
    }
    
    public boolean isSuspendNode()
    {
        return false;
    }
    
    public void initInstane(SMTJsonFlowManager manager, Json jsonNode) throws Exception
    {
        _manager = manager;
        _id = jsonNode.getJson("id").asString();
        Json jsonData = jsonNode.safeGetJson("data");
        if(jsonData != null)
        {
            _title = jsonData.safeGetStr("title", _id);
        }
    }
    
    public void initEdge(SMTJsonFlowNode tagNode, Json jsonEdge)
    {
        
    }
    
    public void afterInstance() throws Exception
    {
    }
    
    public String getId()
    {
        return _id;
    }
    
    public String getTitle()
    {
        return _title;
    }
}