Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » Question on Stardust Modelling and interaction with DB
Question on Stardust Modelling and interaction with DB [message #1712451] Sun, 25 October 2015 05:48 Go to next message
Rakesh Raveendran is currently offline Rakesh RaveendranFriend
Messages: 5
Registered: October 2015
Junior Member
Hi,

I have a Use Case to read some data from CSV and insert data if the data is not present and update it if a record exists for the existing row.

I got the Following sample which helped me to start understanding how to read from CSV using Camel and Insert but what I noticed is it just keeps on inserting record but not update it if value already present.
https://wiki.eclipse.org/CSV_parsing_and_inserting_the_records_in_database_using_Stardust_camel_features

Can you please guide me how to modify the model to do update if the record is already present with the same key value and insert if no record is present?

Thanks,
Rakesh
Re: Question on Stardust Modelling and interaction with DB [message #1712556 is a reply to message #1712451] Mon, 26 October 2015 11:47 Go to previous messageGo to next message
Rajkumar Dangi is currently offline Rajkumar DangiFriend
Messages: 51
Registered: November 2014
Location: Pune, India
Member
I did not try this but i think it is possible in following ways:

1. Your table structure should define one column as a primary key.
2. When SQL application will try to insert the records with duplicate key it will get some SQLException.
3. Add and error event(Boundary error event) to catch that exception and in exception flow try to fire update query.
Your process should look something similar to below(this is just a dummy scratch)

index.php/fa/23733/0/

You can refer below documentation how to add "Error Boundary Event"

http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.stardust.docs.analyst%2Fhtml%2Fhandbooks%2Fmodelling_analyst%2Fpep-events.htm&resultof=%22boundary%22%20%22boundari%22%20%22event%22%20

See section Error Boundary Event - Implementation

Thanks
Rajkumar
Re: Question on Stardust Modelling and interaction with DB [message #1712557 is a reply to message #1712451] Mon, 26 October 2015 11:55 Go to previous message
Rajkumar Dangi is currently offline Rajkumar DangiFriend
Messages: 51
Registered: November 2014
Location: Pune, India
Member
No Message Body

[Updated on: Tue, 27 October 2015 05:58]

Report message to a moderator

Previous Topic:Stardust installed, but it is not showing up?
Next Topic:Problems to deploy the ACME Workflow Model from the Support Example tutorial
Goto Forum:
  


Current Time: Tue Apr 23 13:03:59 GMT 2024

Powered by FUDForum. Page generated in 0.03075 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top