The CLI (v2, beta) up-and-running challenge/documentation

Hello Daniel,

So remember when we say when your write jobs locally you actually manage what goes in and out of state manually?
Well whatever the final state of the first job that you have in your project, you need to copy the data you need to your second job
So for example
If you have an array of patients data return to the final state of your first job ( const patientsInfomation= […some data])
Go to your output.json and find the patientsInfomation data then on your dhis2 state.json file add patientsInfomation

So at the beginning of your dhi2 job, you can pluck that data from the state and do whatever manipulation you need to do
Eg:
fn(state=> {
const {patientsInfomation} = state
// then perform any transformation you need to do to produce the desired output
})

I hope this helps, let me know if you need some assistance. Haftamu have completed the assignment
You could get some insights on how he approached the mapping spec and produce the desired output

Best,
Mtuchi

Hello mtuchi ,
oh, done! thanx again Mr. mtuchi. but, what I expect and spend a lot time in this job is that when we execute the first job then automatically return to output.json and also put to second job state.json and finally execute the second job. so, it is very simply and clear when we put manually the returned data.

Yeah correct the biggest difference between writing jobs locally versus platform app is, locally you have to manually define your state, in other words, you are responsible for building your state and giving it the right data you need for your jobs operations, while on the platform app state gets passed from upstream jobs to downstream jobs, so there is no need for copying and pasting state

You can learn more about the difference between platform apps and writing jobs locally from the slides we shared during the training