dear all
I was really happy to finally test collections but on the latest docker 2.12.2 I am getting that message
R/T Error occurred at: get data from OCL
R/T 24: collections.remove('global-almanach-dhis2', { createdAfter: '202401' });
R/T ^
R/T Run complete with status: crash
ReferenceError: ReferenceError: collections is not defined
Any idea why the collection adaptor is not loaded ?
here is my job where I want to pull from OCL (working) to create a collection,
fn(state => {
state.configuration.baseUrl = state.configuration.hostUrl;
console.log(state.configuration.baseUrl);
return state;
});
get(
"orgs/SwissTPH/sources/ALM-DHIS2/HEAD/mappings",
{
limit: 200
},
(state) => {
state.recievedMappingsList = state.data
state.mappingsList = state.mappingsList || [];
return state
}
);
fn((state) => {
console.log(state.recievedMappingsList[0].from_concept_url.slice(1));
// Remove existing collection entries
collections.remove('global-almanach-dhis2', { createdAfter: '202401' });
// load new entry after getting the datatype from the dhis2 concept
each(state.recievedMappingsList, (state) => {
return get(state.data.from_concept_url.slice(1), (state) => {
const type = state.data.datatype || 'unknown'; // Fallback if datatype is undefined
// Append to mappingsList
collections.set('global-almanach-dhis2', {
map_type: item.map_type,
dhis2_uid: item.from_concept_code,
name: item.to_concept_code.replace(/[. -]/g, "_"),
datatype: type,
});
return state;
});
})
return state
})