条件流转

This commit is contained in:
caoqianming 2021-09-30 16:22:11 +08:00
parent 050d4e5bda
commit 016f316641
1 changed files with 1 additions and 7 deletions

View File

@ -95,12 +95,6 @@ class WfService(object):
""" """
获取下个节点状态 获取下个节点状态
""" """
# if ticket: # 如果是新建工单
# source_state = ticket.state
# else:
# source_state = cls.get_workflow_start_state(workflow)
# if transition.source_state != source_state:
# raise APIException('流转错误')
source_state = ticket.state source_state = ticket.state
destination_state = transition.destination_state destination_state = transition.destination_state
ticket_all_value = cls.get_ticket_all_field_value(ticket) ticket_all_value = cls.get_ticket_all_field_value(ticket)
@ -110,7 +104,7 @@ class WfService(object):
expression = i['expression'].format(**ticket_all_value) expression = i['expression'].format(**ticket_all_value)
import datetime, time # 用于支持条件表达式中对时间的操作 import datetime, time # 用于支持条件表达式中对时间的操作
if eval(expression): if eval(expression):
destination_state = State.objects.get(i['expression'].get('target')) destination_state = State.objects.get(i['expression'].get('target_state'))
return destination_state return destination_state
@classmethod @classmethod