feat: add evidence-backed BPM field mapping workflow

This commit is contained in:
abaishu0730 committed 2026-10-20 09:06:28 +08:00
1 parent 2e9ea8136c
commit 24dbbb74c3
40 files changed
+661 -87

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
'use strict';
const BUSINESS_FIELDS=['orderNo','brief','appDate','customer','productLine','quantity','changeReason','changeContent','totalAmount'];
const METADATA_FIELDS=['processName','processVersion','nodeName','receivedAt','serialNum'];
function sourcesFor(adapter){return adapter?.sources||Object.fromEntries(Object.entries(adapter?.fields||{}).map(([key,path])=>[key,{type:'form',path}]));}
function readSource(source,sample){
if(source?.type==='form')return {path:source.path,value:Object.hasOwn(sample.fields||{},source.path)?sample.fields[source.path]:null};
if(source?.type==='metadata'&&METADATA_FIELDS.includes(source.key))return {path:'待办 · '+source.key,value:sample[source.key]};
return {path:'',value:null};
}
module.exports={BUSINESS_FIELDS,METADATA_FIELDS,sourcesFor,readSource};