I am new to Infopath and Workflows. I have a task given for workflow as below. Please help me out what would be the workflow needed(Sequential or state machine) and also how to achieve this. If any code given is more appreciated.
Below is the requirement:
1) "Test" Form library created in sharepoint 2010.
2) "Add document" to the form library is a infopath form filled and submitted(can be n number of forms)
3) Infopath form has few fields(like ManagerId and ManagerName) and has 2 buttons(Save and Submit)
"Save" --- only save the infopath form in the library- NO action taken(no workflow attached)
When click on submit, workflows needs to start.
4) Workflow process: Whenever new infopath form filled and submitted:-
1) Sets the workflow task field in library as "Submitted for Authorization".
2) Sets the "Is Submitted" field in library as "No".
3) Creates a temporary form library("Sample") and Copy all the Infoth path forms published to Form libray("Test") (where workflow task field = "Submitted for Authorization"])
4) capture ManagerId and ManagerName from the infopath form
5) Sends an email to the Manager(Manager is based on the ManagerId and ManagerName)- stating to authorize the form.
There is few lines to mail description(need to write). Also the mail contains a sharepoint site link to newly created Form Library "Sample" where all the forms are waiting for Authorization.
6) Manager clicks on the link, checks all the infopath form and approves.
7) Once forms are approved change the workflow task field to "Authorized" and "Is Submitted" field to "Yes" in both form libraries(Test and Sample)
8) Need to update the database table same time for the Is submiited flag as same.
9) Delete all the forms from the "Sample" form libray where task = Authorized.
Thanks in Advance