Start a new topic
Answered

Connect Virto Commerce to an External Database

Hi,

We are a software development company specializing in ERP systems. We were looking at using virto commerce as a front end web shop with our product and hence to achieve the same we wanted to connect the web shop directly to our database, instead of the actual virto-commerce database so as to allow real time updating of the product availability status. 

How can this be achieved?

Looking at the architecture it seems this is possible using web services?  Can you let us know how this can be done or a feasible alternative?


hoping to hearing from you, 

best regards,

Avdhey Tiwari


Best Answer

The most appropriate code to add web service call will be in the order workflow.


More specifically you will need to modify ShoppingCartCheckoutWorkflow.xaml file. If you open that workflow in design view, you will see 3 activities executed in the sequence: 


You can either modify existing workflow activity "AdjustInventoryActivity" and add code that calls external web service to modify the stock or create a new activity and add it to the workflow (here is document describing creating new activities: http://docs.virtocommerce.com/display/vc1devguide/Creating+workflow+activities.


If you are running in azure, then you might also want to look at the following link: http://docs.virtocommerce.com/display/vc1devguide/Calling+external+web+service+when+order+is+placed+online which describes how to handle scenarios when backend web service is not always guaranteed to be online.


Hope this helps,


Sasha.








Hello Avdhey,


there are different ways of integrating. I would advise against running frontend directly from the ERP database, as those typically are not designed to be 100% available. The typical process is to use some kind of service to sync data between Commerce DB and ERP DB. For batch process one of the best options is to use SSIS (SQL Server Integration Services). The data will be almost real time.


The second approach can be a combination of both, you can check the real inventory at the checkout, by adding custom CheckInventory activity that calls the ERP web service to check availability of the item and update the availability at the end of the workflow.


If you want we can schedule a call where I can provide more detailed guidance on this issue.


Hope this helps!


Hi Sasha,

We were abstaining from going down the SSIS route. 

I am interested in the web service idea, Can you please let me know a suitable point in the workflow where the web service can be invoked - ideally to update the product availability after an order has been placed.

Additionally can you please supplement the same with a suitable example? pseudo code will suffice.


Thank You,

Avdhey

Answer

The most appropriate code to add web service call will be in the order workflow.


More specifically you will need to modify ShoppingCartCheckoutWorkflow.xaml file. If you open that workflow in design view, you will see 3 activities executed in the sequence: 


You can either modify existing workflow activity "AdjustInventoryActivity" and add code that calls external web service to modify the stock or create a new activity and add it to the workflow (here is document describing creating new activities: http://docs.virtocommerce.com/display/vc1devguide/Creating+workflow+activities.


If you are running in azure, then you might also want to look at the following link: http://docs.virtocommerce.com/display/vc1devguide/Calling+external+web+service+when+order+is+placed+online which describes how to handle scenarios when backend web service is not always guaranteed to be online.


Hope this helps,


Sasha.







Login or Signup to post a comment