Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to create a workflow that is started by activity in a SQL Server database that is outside of SharePoint?

Using a WebPart to put and modify data in a database isn't a problem. Retrieving that data and displaying it using a WebPart or some other SharePoint object isn't much of a problem either. What I'd love to do is to submit data to a database, then have an approval workflow automatically start that sends emails and creates calendar events based on information submitted to the database. It's not difficult at all to do this with same thing with lists and libraries, but is it possible to do it what databases and database tables and other database objects?

Thank you all in advance for your help and advice!

share|improve this question
add comment

2 Answers

With custom development it is possible to do so, even though it is not recomanded, due to various reasons, such as: handling connections issues, timeouts, long operations, etc. - practically everything requiring user intervention at least, etc.

You would have 2 options:

  1. Either create a custom activity which you would then be able to use even through SharePoint Designer (http://msdn.microsoft.com/de-de/library/hh872790(v=office.14).aspx)
  2. Or directly create your Custom Code activity (http://msdn.microsoft.com/en-us/library/vstudio/ms734415(v=vs.90).aspx) in a visual studio workflow.
share|improve this answer
add comment

SharePoint 2013 has remote event receivers that would allow you to do this through code:

http://code.msdn.microsoft.com/office/SharePoint-2013-Call-a-f5d247db

If you're not on 2013, then you'd have to build a similar mechanism. Perhaps a timer job that polls the external database and programatically starts a workflow when a change is detected?

But if you're looking for an OOB mechanism to trigger a workflow based on a database table change, then you're out of luck. SharePoint workflows are specifically associated with listitems or sites.

share|improve this answer
    
SharePoint 2013 isn't in use here. Only SharePoint Server 2010. Some time in the semi distant past, I did some small experiments with SharePoint External Lists that would display data from an external database. Would it be possible to use a set of External Lists the same way you'd use lists in a WebPart (using C# via Visual Studio), then put workflows on the External Lists? –  RX3R0 May 13 '13 at 19:09
    
No, workflows on external lists are not supported in 2010. –  Mike2500 May 13 '13 at 19:15
    
Is it possible for a workflow to communicate with and/or respond to activity in an external database (or anything else via BCS)? –  RX3R0 May 13 '13 at 19:34
1  
Sure, code based workflows or custom activities could query a database. (though both options would require code. There is no OOB sharepoint designer activity to query a database) Respond to activity? That's the trick: there's no OOB mechanism to hook up to an event in the db. Either 1) write code external to the workflow that monitors the db and programatically calls the workflow, or 2) write code in the workflow that polls the database (and waits a certain amount of time in between polls). –  Mike2500 May 13 '13 at 19:42
    
Those seem to be interesting options. I'll investigate them. Thank you for your advice. –  RX3R0 May 13 '13 at 19:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.