mirror of
https://github.com/rulego/gflow-engine.git
synced 2026-12-05 08:00:59 +00:00
80 lines
2.8 KiB
Go
80 lines
2.8 KiB
Go
/*
|
||
* Copyright 2025 The RuleGo Authors.
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/
|
||
|
||
package components
|
||
|
||
// 驳回策略取值,userTask 与 aiAgent 共用同一套词表。
|
||
const (
|
||
// RejectStrategyTerminate 终止流程实例(默认策略)
|
||
RejectStrategyTerminate = "terminate"
|
||
// RejectStrategyToStarter 跳回开始节点
|
||
RejectStrategyToStarter = "toStarter"
|
||
// RejectStrategyToPrev 跳到上一个 userTask 节点(userTask)
|
||
RejectStrategyToPrev = "toPrev"
|
||
// RejectStrategyToNode 跳到 reject.target 指定的节点(userTask)
|
||
RejectStrategyToNode = "toNode"
|
||
)
|
||
|
||
// isValidUserTaskRejectStrategy 判断 userTask 驳回策略是否已知取值(空串合法,等价默认 terminate)。
|
||
func isValidUserTaskRejectStrategy(s string) bool {
|
||
switch s {
|
||
case "", RejectStrategyTerminate, RejectStrategyToStarter, RejectStrategyToPrev, RejectStrategyToNode:
|
||
return true
|
||
}
|
||
return false
|
||
}
|
||
|
||
// isValidRejectStrategy 判断驳回策略是否为共用词表的已知取值(空串合法,等价默认 terminate)。
|
||
func isValidRejectStrategy(s string) bool {
|
||
switch s {
|
||
case "", RejectStrategyTerminate, RejectStrategyToStarter:
|
||
return true
|
||
}
|
||
return false
|
||
}
|
||
|
||
// isValidAIAgentUnresolved 判断 aiAgent 未裁决策略是否已知取值(空串合法,等价默认 human)。
|
||
func isValidAIAgentUnresolved(s string) bool {
|
||
switch s {
|
||
case "", UnresolvedStrategyHuman, UnresolvedStrategyPass, UnresolvedStrategyReject:
|
||
return true
|
||
}
|
||
return false
|
||
}
|
||
|
||
// 任务候选实体类型改用 types/enums EntityType*(wf_task_assignee.entity_type)。
|
||
|
||
// userTask 超时处理动作,由宿主逾期巡检执行。
|
||
const (
|
||
// TimeoutActionRemind 到期提醒办理人(缺省动作,仅提醒不代办)
|
||
TimeoutActionRemind = "remind"
|
||
// TimeoutActionAutoApprove 到期自动通过(以 system 身份记录审批意见并推进流程)
|
||
TimeoutActionAutoApprove = "autoApprove"
|
||
// TimeoutActionAutoReject 到期自动拒绝
|
||
TimeoutActionAutoReject = "autoReject"
|
||
)
|
||
|
||
// RelationReject 自定义出边关系:业务驳回(与系统错误 types.Failure 分离)。
|
||
const RelationReject = "Reject"
|
||
|
||
// 审计日志状态(aiAgent/automationCall 等节点的执行审计字段取值)。
|
||
const (
|
||
// AuditStatusSuccess 执行成功
|
||
AuditStatusSuccess = "success"
|
||
// AuditStatusFailed 执行失败
|
||
AuditStatusFailed = "failed"
|
||
)
|