# # jobtype importPersonGroup definition file # # this job type assigns one person per input dataset row with a group # group name is taken from parameter "grpid" # starting year of assignment is taken from parameter "vonjahr" # starting month of assignment is taken from parameter "vonmonat" # ending year and month from parameters "bisjahr" and "bismonat" # this job type assumes an input dataset with person attributes, enhanced by # "rolle" - role the person shall take in the group, must exist in CCROLE # "oe" - OE the person represents in the group, must exist in CCOE # "vorname","familienname","email" - person attributes. # if the person already exists it must have exactly these attributes # # @init.qexpression proc: { if (!this.query.parameters) { this.errcoll.collect(null,"Error in Job description: no parameters",this.query); break proc; } if (!this.query.parameters.grpid) { this.errcoll.collect(null,"Error in Job description: no grpid parameter",this.query.parameters); break proc; } aux.default_param(this.query.parameters,"vonjahr",new Date().getFullYear()); aux.default_param(this.query.parameters,"vonmonat",new Date().getMonth()+1); aux.default_param(this.query.parameters,"bisjahr",0); aux.default_param(this.query.parameters,"bismonat",0); this.needed_irec_attributes = ['vorname','familienname','email','rolle','oe']; this.nameutils = require("./nameutils.js")(logger,this.dataname,prefs); this.protocol = new Array(); this.protocol.push([this.fname, this.dataname,"PROCESSING_STARTED","",""]); this.result = new aux.Result('dbresult'); this.result.setResultAttribute("resultname","PROTOCOL"); this.result.addMetaDataName("Activity"); this.result.addMetaDataName("Param_1"); this.result.addMetaDataName("Param_2"); this.result.addMetaDataName("Param_3"); this.result.addMetaDataName("Param_4"); this.result.rows = this.protocol; for (let pn in this.query.parameters) { this.protocol.push(["","BATCH","PARAMETERS",pn,this.query.parameters[pn]]); } } @setup.qexpression proc: { this.protocol.push(["","","SETUP_DONE","",""]); } # # now the processing steps executed for each record # # # 0: check if all required data fields are there and prepare CCUS checking # qexpression proc: { for (let ni=0; ni