简体   繁体   中英

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.

您可以将代码从ASPX页面重构为共享的类库DLL,然后创建自定义工作流活动

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM