locked
Sharepoint Workflow powershell deployment RRS feed

  • Question

  • I'm working on a worklfow (SPDesigner workflow) with 2010 workflow engine, and I need to publish that workflow to several sites. I can successfully deploy the changes to another site, by replacing the XOML file and creating a new workflow association. 

    My problem now is that I updated the workflow to have an additional input parameter, so the workflow initiation form (infopath) needs to be re-built. If I deploy the workflow on the other sites, the workflow get's updated, but not the initiation form...

    On sharepoint designer, to rebuild the form we just need to delete the infopath form and then publish the workflow again, the initiation form get's generated automatically. But do the same programatically, it's not working.

    I tried already create a new association on the list, using the SPList.WorkflowAssociations... but the XSN file is not generated...

    any idea? thanks
    Thursday, August 10, 2017 1:46 PM

Answers

  • Hi Bruno,

    As I understand, XSN  is a InfoPath form generated in SharePoint Designer automatically. There is no PowerShell or API to generate them.

    If you want to include additional fields, open xsn file using InfoPath and add fields for the form in InfoPath Designer,and save them back to workflow, it will do the job.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, August 18, 2017 2:40 AM

All replies

  • Hi,

    We can firstly save workflow as template in SharePoint Designer, then it will generate a wsp file in Site Asserts: library:

    Then deploy directly with this WSP file like SharePoint solution feature for the workflow, here is a similiar thread for your reference:

    https://sharepoint.stackexchange.com/questions/131714/deploy-spd-workflow-using-powershell

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, August 11, 2017 10:13 AM
  • Hi Jerry, thanks for the feedback, but this is not what I'm trying to achieve... The workflow is already deployed in the other sites, so I only need to rebuild the xsn form to include the additional inputs for the workflow. on SPDesigner, if we remove the XSN and publish the workflow, the new XSN is automatically generated, but not if I publish it through powershell... the new form that is being generated on SPDesigner, is it generated by SPdesigner? or is SPDesigner calling a webmethod to generate it server side? if so, what is the method? thanks
    Wednesday, August 16, 2017 3:09 PM
  • Hi Bruno,

    As I understand, XSN  is a InfoPath form generated in SharePoint Designer automatically. There is no PowerShell or API to generate them.

    If you want to include additional fields, open xsn file using InfoPath and add fields for the form in InfoPath Designer,and save them back to workflow, it will do the job.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, August 18, 2017 2:40 AM
  • Hi Jerry,

    That was the answer I was looking for... a confirmation that there's no API or method that generates it automatically.

    In this case, open each InfoPath individually is not feasible as there are too many sites. is there a way to batch update them via code?

    thanks

    Friday, August 25, 2017 9:18 AM
  • Hi,

    SharePoint API can only batch add fields to a list not InfoPath form, if this InfoPath form is associated with a list, then directly add additional field in list:

    http://burnignorance.com/sharepoint-tips-and-hacks/add-columns-fields-programmatically-to-a-sharepoint-list/

    Otherwise, there is no Program API to InfoPath form.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, August 25, 2017 9:36 AM