工作流脚本
当流程中的所有类型的实例,状态转变为完成后执行的脚本。
关于脚本的一般说明详见脚本指南
流程脚本中的变量
- request
请求对象:
public ObjDatastore
public Object status(String asPath,String asOperation,Long aId)
设置实体数据的状态,包括所有的数据服务的操作
public int setFieldValue(String asPath,Long aRecId, String asFieldCode, Object aValue)
设置字段的值,包括数据服务和字段值主题域
public Object getFieldValue(String asPath,Long aRecId, String asFieldCode)
获得字段值。 包括数据服务和字段值。
public Long userId()
当前用户的id
public String userCode()
当前用户的代码
public String userName()
当前用户的名字
public Long employeeId()
当前用户的在系统中的人员id
public String employeeName()
当前用户的在系统中的人员名字
public String userProperty(String asPropertyCode)
当前用户的在系统中的人员属性
public void sendMail(String asTo,String asSubject,String asContent)
发送邮件,asTo邮件地址,asSubject 主题,asContent邮件内容。 邮件由系统服务邮箱发出
public ObjWxTemplateMsg createWxMsg(String asTemplateId)
从创建微信模板消息
public int sendWxMsg(String asAppId, ObjWxTemplateMsg aMsg)
发送微信模板消息
public int sendWxMsgWorkgroup(String asAppId, Long aWorkgroupID, ObjWxTemplateMsg aMsg)
发送微信模板消息到工作组
public int sendWxMsgUser(String asAppId, Object aUserId, ObjWxTemplateMsg aMsg)
发送微信模板消息到系统用户
举例:
var lMsg = request.createWxMsg('FbmCzNo3vmV3GZ-U4gu-VdF_md8H6sBePxY_ZMM0G9Q');
lMsg.addProp('first','首先说明')
lMsg.addProp('keyword1','key1')
lMsg.addProp('keyword2','key2')
lMsg.addProp('keyword3','key3')
lMsg.addProp('keyword4','key4')
lMsg.addProp('keyword5','key5')
lMsg.addProp('remark','备注说明这里是')
request.sendWxMsgUser("wx57e64f27146325ed",request.userId(),lMsg); //当前用户发送
request.sendWxMsgUser("wx57e64f27146325ed",inst.users(),lMsg); //所有用户发送
public ObjDatastore getStoreById(String asPath,String asAlias,Long aRecId) throws ASException
public ObjDatastore getStoreByIdList(String asPath,String asAlias,List<Object> aIds) throws ASException
根据id查询数据集
public void updateStore(String asPath,ObjDatastore aStore) throws ASException
更新数据集
- ObjDatastore
Object fv(int recno,String fieldname)
Object fv(ObjRow,String )
获取值
void fvSet(int ,String,Object)
void fvSet(ObjRow,String,Object)
/更新值
- flow
流程实例对象
- Long tranid() 当前业务的主键
- ObjParamIds tranids(); 当前业务的主键的对象形式
- ObjDatastore mainstore(); 当前业务的主数据集
- inst
当前执行脚本的组件或转移对象。
- String status() 当前对象的状态
- List<Long> users() 只有任务和消息存在,任务和消息中的所有用户,包括工作组,动态用户和固定用户
- event
事件对象
- Object paramValue(String asParamCode) 获得事件参数值
- ObjDatastore store();事件实体的主数据集,只有自定义的事件有该属性
- Object fieldValue(String asFieldCode) 获得事件来源实体的主数据集的字段值
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files