首页  

temporal workflow 列表 关键代码     所属分类 temporal 浏览量 474
temporal/service/frontend/workflowHandler.go

ListOpenWorkflowExecutions
ListClosedWorkflowExecutions
ListWorkflowExecutions

temporal/common/persistence/visibility/manager/visibility_manager.go
ListOpenWorkflowExecutions
ListClosedWorkflowExecutions
ListWorkflowExecutions

temporal/common/persistence/visibility/visibility_manager_impl.go


type (
	// visibilityManagerImpl is responsible for:
	//  - convert request (serialized some fields),
	//  - call underlying store (standard or advanced),
	//  - convert response.
	visibilityManagerImpl struct {
		store  store.VisibilityStore
		logger log.Logger
	}
)


func (p *visibilityManagerImpl) ListOpenWorkflowExecutions(request *manager.ListWorkflowExecutionsRequest) (*manager.ListWorkflowExecutionsResponse, error) {
	response, err := p.store.ListOpenWorkflowExecutions(request)
	if err != nil {
		return nil, err
	}
	return p.convertInternalListResponse(response)
}

func (p *visibilityManagerImpl) ListClosedWorkflowExecutions(request *manager.ListWorkflowExecutionsRequest) (*manager.ListWorkflowExecutionsResponse, error) {
	response, err := p.store.ListClosedWorkflowExecutions(request)
	if err != nil {
		return nil, err
	}

	return p.convertInternalListResponse(response)
}

func (p *visibilityManagerImpl) ListWorkflowExecutions(request *manager.ListWorkflowExecutionsRequestV2) (*manager.ListWorkflowExecutionsResponse, error) {
	response, err := p.store.ListWorkflowExecutions(request)
	if err != nil {
		return nil, err
	}

	return p.convertInternalListResponse(response)
}



temporal/common/persistence/visibility/store/standard/sql/visibility_store.go



temporal/common/persistence/sql/sqlplugin/postgresql/visibility.go


executions_visibility
namespace_id, workflow_id, run_id, start_time, execution_time, workflow_type_name, status, memo, encoding

templateOpenFieldNames = `workflow_id, run_id, start_time, execution_time, workflow_type_name, status, memo, encoding`

templateOpenSelect     = `SELECT ` + templateOpenFieldNames + ` FROM executions_visibility WHERE status = 1 `

templateClosedSelect = `SELECT ` + templateOpenFieldNames + `, close_time, history_length FROM executions_visibility WHERE status != 1 `

templateGetOpenWorkflowExecutions = templateOpenSelect + templateConditions1

templateGetClosedWorkflowExecutions = templateClosedSelect + templateConditionsClosedWorkflow1
	
	
templateConditions1 = ` AND namespace_id = $1
		 AND start_time >= $2
		 AND start_time <= $3
		 AND ((run_id > $4 and start_time = $5) OR (start_time < $6))
         ORDER BY start_time DESC, run_id
         LIMIT $7`


templateConditionsClosedWorkflow1 = ` AND namespace_id = $1
		 AND close_time >= $2
		 AND close_time <= $3
		 AND ((run_id > $4 and close_time = $5) OR (close_time < $6))
         ORDER BY close_time DESC, run_id
         LIMIT $7`

上一篇     下一篇
ssh端口转发

PostgreSQL DBA 常用SQL

temporal namespace 创建和更新关键代码

go 单引号 双引号 反引号

GO json 序列化与反序列化

protobuf3二进制数据转java对象