## 类的使用
kd.bos.entity.botp.WriteBackRuleElement

- 使用WriteBackRuleElement的程序包
  程序包 | 说明
  --- | ---
  kd.bos.entity.botp |
  kd.bos.entity.botp.plugin.args |
  kd.bos.entity.botp.runtime |
  kd.bos.servicehelper.botp |

- - ### kd.bos.entity.botp中WriteBackRuleElement的使用

    返回WriteBackRuleElement的kd.bos.entity.botp中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static WriteBackRuleElement` | WriteBackRuleElementSerializer.`deserializeFromString(java.lang.String jsonString, java.lang.Object baseRule)` 反序列化

    参数类型为WriteBackRuleElement的kd.bos.entity.botp中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static java.lang.String` | WriteBackRuleElementSerializer.`serializeToString(WriteBackRuleElement ruleElement, java.lang.Object baseRule)` 序列化为 JSON

  - ### kd.bos.entity.botp.plugin.args中WriteBackRuleElement的使用

    返回WriteBackRuleElement的kd.bos.entity.botp.plugin.args中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `WriteBackRuleElement` | BeforeExecWriteBackRuleEventArgs.`getRule()` 当前准备执行的反写规则
    `WriteBackRuleElement` | BeforeExcessCheckEventArgs.`getRule()` 反写规则
    `WriteBackRuleElement` | AfterExcessCheckEventArgs.`getRule()` 反写规则
    `WriteBackRuleElement` | AfterCommitAmountEventArgs.`getRule()` 反写规则
    `WriteBackRuleElement` | AfterCalcWriteValueEventArgs.`getRule()` 反写规则

    返回变量类型为WriteBackRuleElement的类型的kd.bos.entity.botp.plugin.args中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `java.util.List<WriteBackRuleElement>` | BeforeReadSourceBillEventArgs.`getRules()` 反写上游源单的全部反写规则

    参数类型为WriteBackRuleElement的kd.bos.entity.botp.plugin.args中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | BeforeExecWriteBackRuleEventArgs.`setContext(WriteBackRuleElement rule, WriteBackFormula ruleItem)` 调整当前反写规则、反写条目

    参数类型为WriteBackRuleElement的kd.bos.entity.botp.plugin.args中的构造器
    构造器和说明
    `AfterCalcWriteValueEventArgs(EntityType entity, kd.bos.dataentity.entity.DynamicObject activeRow, WriteBackRuleElement rule, WriteBackFormula ruleItem, java.math.BigDecimal val, java.lang.Object cVal)`
    `AfterCommitAmountEventArgs(WriteBackRuleElement rule, WriteBackFormula ruleItem, BillEntityType srcSubMainType, EntityType srcEntity, kd.bos.dataentity.entity.DynamicObject srcActiveRow, java.lang.String srcFieldKey, java.math.BigDecimal currVal, java.math.BigDecimal realVal, java.lang.Object currCVal, EntityType targetEntity, kd.bos.dataentity.entity.DynamicObject targetActiveRow)`
    `AfterExcessCheckEventArgs(WriteBackRuleElement rule, BillEntityType srcSubMainType, EntityType srcEntity, kd.bos.dataentity.entity.DynamicObject srcActiveRow, EntityType targetEntity, kd.bos.dataentity.entity.DynamicObject targetActiveRow)`
    `BeforeExcessCheckEventArgs(WriteBackRuleElement rule, BillEntityType srcSubMainType, EntityType srcEntity, kd.bos.dataentity.entity.DynamicObject srcActiveRow, EntityType targetEntity, kd.bos.dataentity.entity.DynamicObject targetActiveRow)`

    类型变量类型为WriteBackRuleElement的kd.bos.entity.botp.plugin.args中的构造器参数
    构造器和说明
    `BeforeReadSourceBillEventArgs(BillEntityType srcMainType, java.util.List<WriteBackRuleElement> rules)`

  - ### kd.bos.entity.botp.runtime中WriteBackRuleElement的使用

    返回WriteBackRuleElement的kd.bos.entity.botp.runtime中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `WriteBackRuleElement` | CRBizRuleContext.`getWritebackRule()` 反写规则，可能为null，在执行反写时有值

    参数类型为WriteBackRuleElement的kd.bos.entity.botp.runtime中的构造器
    构造器和说明
    `CRBizRuleContext(BillEntityType mainType, WriteBackRuleElement writebackRule, CRBizRuleElement bizRule)`

  - ### kd.bos.servicehelper.botp中WriteBackRuleElement的使用

    返回WriteBackRuleElement的kd.bos.servicehelper.botp中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static WriteBackRuleElement` | WriteBackMetaServiceHelper.`loadWriteBackRule(java.lang.String ruleId)`
    `static WriteBackRuleElement` | WriteBackMetaServiceHelper.`loadWriteBackRuleVersion(long verId)`

    返回变量类型为WriteBackRuleElement的类型的kd.bos.servicehelper.botp中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static java.util.List<WriteBackRuleElement>` | WriteBackMetaServiceHelper.`loadWriteBackRules(java.lang.String targetEntityNumber)`

    参数类型为WriteBackRuleElement的kd.bos.servicehelper.botp中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static java.lang.Long` | WriteBackMetaServiceHelper.`saveWriteBackRuleVersion(WriteBackRuleElement ruleElement)`