Class: TranTcc

TranTcc()

TranTcc 对外支持的 Tcc 的相关服务

Constructor

new TranTcc()

Source:

Methods

(async, static) createInstance(projectKey, processKey, messageId, payload) → {object}

TranTcc.createInstance 创建一个事务实例

Parameters:
Name Type Description
projectKey string

项目的key

processKey string

进程的key

messageId string

事务的唯一id

payload object

任务相关的参数

Source:
Returns:

事务实例

Type
object

(async, static) groupActionsExec(actions, payload, messageId, projectId, proccessId) → {Array.<object>}

TranTcc.groupActionsExec 执行一些 Action 的集合并获取结果

Parameters:
Name Type Description
actions Array.<object>

集合 [{currentAttemptTime: 当前尝试次数, id: actionId}]

payload Object

请求载体

messageId string

消息id/事务唯一标识

projectId number

项目id

proccessId number

流程程id

Source:
Returns:

处理结果集 [{id, success, currentAttemptTime }] 处理结果

Type
Array.<object>

(async, static) singleActionExec(actionId, payload, messageId, projectId, proccessId, currentAttemptTime) → {Object}

TranTcc.singleActionExec 执行某个独立的action

Parameters:
Name Type Default Description
actionId number

action id

payload json

载体

messageId string

消息id

projectId number 0

项目id

proccessId number 0

过程id

currentAttemptTime number 0

当前执行次数

Source:
Returns:

actionLogInstance actionLog的实例

Type
Object

(async, static) try2NextStep(tranId) → {Object}

TranTcc.try2NextStep 尝试进入下一个步骤, 当前步骤的所有状态满足特定条件

Parameters:
Name Type Description
tranId number

事务的实例id

Source:
Returns:

事务实例

Type
Object