Apex Class ์์ฑ
๐ธ ์์ ์ฝ๋
global class DataSourceInventory implements SBLS.DataSourceService.Fetchable {
global SBLS.DataSourceService.Result execute(SBLS.DataSourceService.Parameter params) {
// ๋ฆฌ์คํธ์ ๊ฒ์๋ ๋ ์ฝ๋
List<SObject> records = params.gets();
// ์ธ๋ถ API๋ฅผ ํธ์ถํ์ฌ ๋ฐ์ดํฐ์์ค ๊ฐ ๊ฐ์ ธ์ค๊ธฐ (์: ์ฌ๊ณ ์ ๋ณด)
// ํค: ์ ํ ์ฝ๋, ๊ฐ: ์ฌ๊ณ ์๋
Map<String, Integer> inventoryData = new Map<String, Integer>();
inventoryData.put('Product001', 10);
inventoryData.put('Product002', 20);
// ๊ฒฐ๊ณผ ๊ฐ์ฒด ์์ฑ
SBLS.DataSourceService.Result result = new SBLS.DataSourceService.Result();
// ๋ฆฌ์คํธ ๊ฐ์ฒด์ ๋ฐ์ดํฐ์์ค ๋งคํ
for (String productCode : inventoryData.keySet()) {
SBLS.DataSourceService.Action action = new SBLS.DataSourceService.Action();
action.setKeyValue(productCode); // ๋ฆฌ์คํธ ๋ ์ฝ๋์ ๋งคํํ Key ๊ฐ ์ค์
action.putSourceToTargetField(
inventoryData.get(productCode), // ๋ฐ์ดํฐ์์ค ๊ฐ: ์ฌ๊ณ ์ ๋ณด
'SBLS_Virtual1' // ๋ฆฌ์คํธ ๊ฐ์ ์ด API๋ช
);
result.addAction(action); // Action ์ถ๊ฐ
}
return result; // ๊ฒฐ๊ณผ ๋ฐํ
}
}๐ธ SBLS.DataSourceService.Parameter
์์ ์ฝ๋
Method
๐ธ SBLS.DataSourceService.Result
์์ ์ฝ๋
Method
๋งค๊ฐ๋ณ์
์ ํ
๊ฐ
๐ธ SBLS.DataSourceService.Action
์์ ์ฝ๋
Method
๋งค๊ฐ๋ณ์
์ ํ
๊ฐ
๋งค๊ฐ๋ณ์
์ ํ
๊ฐ
Last updated