cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Add reusable workflow to list on site creation

Hi,

On the SharePoint root I created a site collection reuseable workflow. The workflow should be triggered when a new item of content type news page is created in the pages library. The workflow works, but I want to associate the workflow to the pages library when new site is created (as each site contains a pages library where editors can add news pages).

I already have a Visual Studio project including a web template. In the web template there is a feature ID activating the Nintex Workflow feature. I only need to bind the workflow to the pages library, but I can't find how to do that...

Anyone able to help me?

Thanks in advance,

Dennis

Labels: (1)
0 Kudos
Reply
5 Replies
FredrikAndresen
Nintex Newbie

Re: Add reusable workflow to list on site creation

Its not exactly what you looking for, but we have the same requirement, and solved it using the
Nintex webservice: 

Site/_vti_bin/nintexworkflow/workflow.asmx

Soap xml:

<?xml version="1.0"
encoding="utf-8"?>

<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body>

<PublishFromNWFXml
xmlns="http://nintex.com">

<workflowFile>{WorkflowVariable:WFXML}</workflowFile>

<listName>{WorkflowVariable:CurrentList}</listName>

<workflowName>{ItemProperty:Title},{WorkflowVariable:CurrentListClean}</workflowName>

<saveIfCannotPublish>false</saveIfCannotPublish>

</PublishFromNWFXml>

</soap:Body>

</soap:Envelope>

Reply
aohara
Nintex Newbie

Re: Add reusable workflow to list on site creation

Hi Dennis,

If your content type is a site content type created at the site collection level and you have already added your reusable workflow to the site content type, it sounds like you just need to add your content type to the pages library of the newly created site. I'm not a developer so I can't tell you how to do that in your visual studio project.

If you were creating the site using a Nintex workflow, you could use the 'Call web service' action to call the 'Lists.asmx' service and use the 'ApplyContentTypeToList' method to add the content type to the pages library after the site is created. You would then need to configure the Web service message in the SOAP editor like so:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/">

  <soap:Header>

  </soap:Header>

  <soap:Body>

    <m:ApplyContentTypeToList>

      <m:webUrl>{WorkflowVariable:varEventSiteUrl}</m:webUrl>      <m:contentTypeId>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D0055D399BCB5414848919F42AC0090490D</m:contentTypeId>

      <m:listName>Pages</m:listName>

    </m:ApplyContentTypeToList>

  </soap:Body>

</soap:Envelope>

Obviously you would need to fill in your own webUrl and contentTypeId. You can find the contentTypeId of your content type by following the instructions in this post: How to find the ID for associated content type when adding a page layout?

You may be able to call the 'Lists.asmx' web service in your code.

I hope this helps.

Regards,

Andrea

Reply
Not applicable

Re: Add reusable workflow to list on site creation

You could build your woekflow publishing workflow with Nintex workflow.asmx webservices. After site reation you could publish workflow on tha site pages list.

0 Kudos
Reply
Not applicable

Re: Add reusable workflow to list on site creation

Hi, Dennis van Espelo​! If one of the responses above is working out for you, please select an answer correct. Thank you!

0 Kudos
Reply
Automation Master
Automation Master

Re: Add reusable workflow to list on site creation

‌ were you able to associate the workflow with your pages library?

0 Kudos
Reply