Hi everyone
i m struggling with the process modeling when i need to write multiple rows in a DB ,
i have a CDT of "Documents" which i put as an array in my form and a CDT of "creditRequest" which contains an array of the Documents CDT.
i need to put both of them in seperate databases , the first one is the documents which i want to store and then after to store the creditrequest which will contain the documents.
now when i debugging my process i can see that my documents don't have an ID after that it s passing the "write to db",
and then after i have problem with the creditrequest ,
how i need to do for write the multiple documents that i want to write in the db and then write them in the next Db of Creditrequest ???
Discussion posts and replies are publicly visible
Hi, create two process variables, one for documents cdt and another for credit request cdt and using script task get the data for these two variables then using write to datastore entity or multiple datastore entities, you can write these data easily.
i used two process variables one for the documents cdt and the other for credit request cdt as you said . i wrote the data to document entity first and then wrote in the credit request entity .
after insertion of my data to the db. of documents, I can see that he did the relation between each document and the credit request db as i wanted , but i noticed in the debugger that for the process variable document it didn't wrote the ID for each one , but in my db each one got one .
because after when im looking to the id in the creditrequest entity i cant see the id
you know what is the problem ?
hi yaynivb,that is because you are lookin here into the DB table of the nested CDT.(check your stored values of the credit request)But you try to store it a second time.What is the purpose of it?
Did you save the documents process variable after writing to db?
this is what i have in creditrequest ,
i need to store the documents in db and the creditrequest also they have different databases
this how i defined the datatype
Could you please show snaps for both write to datastore entity node configuration?
Hi folks,i wouldnt fokus here specifically on the storing issue.There is more than one thing not really proper.1.) Like nested cdt in nested cdt2.) Storing logic itselfCan you show the output tab of your first "write to datastore" (i think its credit request)?
which one ? of the documents data store ?
here we go. i can recommend the follow approach:Please use "stored values" and select the process variable you used before as "value" you like to store on the "Input" tab. pv!creditRequest.-> then use a scrip task (output tab) and extract the data you like to have in another pv
can you show me please how you do thart ?