添加依赖

Description 说明

object trigger.adddependencies(object/array triggerDependencies)

This method allows to create new trigger dependencies. 此方法允许创建新的触发器依赖关系。

Parameters 参数

(object/array) Trigger dependencies to create. (object/array)需要创建的触发器依赖。 Each trigger dependency has the following parameters: 每一个触发器依赖具有以下参数:

Parameter 参数 Tpe 类型 Desription 说明
triggerid
(required 必须)
string 字符串 IDof the dependent trigger. 依赖触发器的ID。
dependsOnTriggerid
(required 必须)
string 字符串 IDof the trigger that the trigger depends on. 依赖触发的触发器ID。

Return values 返回值

(object) Returns an object containing the IDs of the dependent triggers under the triggerids property. (object)返回一个对象,该对象包含在triggerids属性中依赖触发器的ID。

Examples 范例

Add a trigger dependency 添加触发器依赖

Make trigger “14092” dependent on trigger “13565.” 触发器”14092”依赖于触发器”13565”。

Request 请求:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "trigger.adddependencies",
  4. "params": {
  5. "triggerid": "14092",
  6. "dependsOnTriggerid": "13565"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response 响应:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "triggerids": [
  5. "14092"
  6. ]
  7. },
  8. "id": 1
  9. }

See also 参考

Source 源码

CTrigger::addDependencies() in frontends/php/include/classes/api/services/CTrigger.php. CTrigger::addDependencies()方法可在frontends/php/include/classes/api/services/CTrigger.php中参考。