running aspx (or custom code) from Sharepoint Workflow
What I want - To have a workflow export the latest record of a list to a CSV file.
What I have -
1) an ASPX page that exports the latest record of a list to a CSV file via writestream. Functions correctly 开发者_高级运维when run via browser.
2) a workflow that fires when a new item appears in said list. I can add any of the standard steps to it, but I don't see an "other" option
What I need - info on how to get the workflow to either run the aspx page, or if there's some other way code can/should be run via a workflow, info on that.
I can provide details, code samples, but it's more the structure of what to do I need, as opposed to specific points of the coding.
Thankee.
You could refactor the code from the ASPX page into a shared class library DLL and then create a custom workflow activity.
Have you looked into Event Receivers? They act sometimes as triggers would on a database.
It sounds to me like you want to intercept an item_inserting event and write it out to a file to shuffle off to some system.
An Event Receiver would get this for you easily since it seems to be a one step process. I tend to stay away from a Workflow unless human interaction is required or if it needs any other workflow-specific capabilities (long running, serializable, resumable, etc.
You could decouple this by taking your code from your aspx page that dumps a csv and putting it into a service facade layer. You can then put an event receiver on your list which can call the WCF service to do the work for you. It might be a good idea to do that in case you find other areas down the road that require a similar strategy.
Hope this helps.
精彩评论