-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from vlocityinc/beta
Beta
- Loading branch information
Showing
11 changed files
with
213 additions
and
33 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
DataPackMetadata/latest/DRMatchingKey/OrchestrationScenarioFix__c.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"fullName": "%vlocity_namespace%__DRMatchingKey__mdt.OrchestrationScenario", | ||
"label": "OrchestrationScenarioFix", | ||
"values": [ | ||
{ | ||
"field": "%vlocity_namespace%__MatchingKeyFields__c", | ||
"value": "%vlocity_namespace%__GlobalKey__c" | ||
}, | ||
{ | ||
"field": "%vlocity_namespace%__MatchingKeyObject__c", | ||
"value": "%vlocity_namespace%__OrchestrationScenario__c" | ||
}, | ||
{ | ||
"field": "%vlocity_namespace%__ObjectAPIName__c", | ||
"value": "%vlocity_namespace%__OrchestrationScenario__c" | ||
}, | ||
{ | ||
"field": "%vlocity_namespace%__ReturnKeyField__c", | ||
"value": "Id" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
var Product2 = module.exports = function(vlocity) { | ||
this.vlocity = vlocity; | ||
}; | ||
|
||
Product2.prototype.childrenExport = async function(inputMap) { | ||
try { | ||
var jobInfo = inputMap.jobInfo; | ||
var childrenDataPacks = inputMap.childrenDataPacks; | ||
|
||
var dataPackType = childrenDataPacks[0].VlocityDataPackType; | ||
|
||
let queryString = `Select Id from Product2 WHERE `; | ||
let whereClause = ''; | ||
|
||
for (var dataPack of childrenDataPacks) { | ||
|
||
if (whereClause) { | ||
whereClause += ' OR '; | ||
} | ||
|
||
whereClause += `(${this.vlocity.namespacePrefix}GlobalGroupKey__c = '${dataPack.VlocityDataPackData.Id}')`; | ||
} | ||
|
||
let result = await this.vlocity.queryservice.query(queryString + whereClause); | ||
VlocityUtils.verbose('Children Query', queryString + whereClause, 'Results', result.records.length); | ||
for (var record of result.records) { | ||
let recordAdded = this.vlocity.datapacksjob.addRecordToExport(jobInfo, { VlocityDataPackType: dataPackType, manifestOnly: true }, record); | ||
|
||
if (recordAdded) { | ||
VlocityUtils.verbose('Added from Children Query', dataPackType, record.Id); | ||
} | ||
} | ||
|
||
for (var dataPack of childrenDataPacks) { | ||
jobInfo.currentStatus[dataPack.VlocityDataPackKey] = 'Ignored'; | ||
if (jobInfo.alreadyExportedKeys.indexOf(dataPack.VlocityDataPackKey) == -1) { | ||
jobInfo.alreadyExportedKeys.push(dataPack.VlocityDataPackKey); | ||
} | ||
} | ||
|
||
return true; | ||
} catch (e) { | ||
VlocityUtils.error('Children Export Error', e); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.