Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Set-PWDocumentState : Workflow rules not being executed
    • Sign In

    • State Verified Answer
    • Replies 8 replies
    • Answers 1 answer
    • Subscribers 66 subscribers
    • Views 1695 views
    • Users 0 members are here
    • set-pwdocumentstate
    • new-pwdocumentversion

    Set-PWDocumentState : Workflow rules not being executed

    AEC_PW_Interface
    Offline AEC_PW_Interface over 2 years ago

    Hello,

    Looking for some help to understand why our Set-PWDocumentState commands do not trigger the WRE when we do state changes.

    Our scripts boils down to :

    • New-PWLogin -DatasourceName "name" -LoadWRE -UserName "user"  -Password $Password                                                                
    • $doc = Get-PWDocumentsByGUIDs -DocumentGUIDs GUI                                                                             
    • Set-PWDocumentState -InputDocuments $doc -State "Next state in the workflow"  

    We also see the same kind of issue with New-PWDocumentVersion, just like the Set-PWDocumentState, we notice that the workflow rules have not been executed after execution.

    Looking on the forums, we also saw the suggestion to use Invoke-WSGWorkflowCommand but that command gives the following:

    Error: Manual change state not allowed. Please use Workflow customization rules to change document state.

    Anyone has any pointers on how to investigate why the workflow isnt being triggered ?

    Thanks !

    • Sign in to reply
    • Cancel

    Top Replies

    • AEC_PW_Interface
      Offline AEC_PW_Interface Tue, Jul 27 2021 3:19 PM +1
      Ok, thanks everyone ! I will try again with the PWPS_WSG even though it dint work earlier but honestly I think we will just reimplement the workflow rules inside the script. If PWPS_WSG ends up working…
    • AEC_PW_Interface
      Offline AEC_PW_Interface Fri, Oct 8 2021 11:20 PM in reply to AEC_PW_Interface +1 verified
      Just to confirm that it ended up working with Invoke-WSGWorkflowCommand Our script boiled down to the below : New-PWLogin -DatasourceName $datasource -UserName $username -Password $SecurePassword…
    • Chris Andrew
      Offline Chris Andrew Sat, Oct 9 2021 2:37 AM in reply to AEC_PW_Interface +1 suggested
      Pwps_dab was updated recently to include a hidden -Force command on Set-PWDocumentState This now works with Server Side WRE set.
    • Chris Andrew
      0 Offline Chris Andrew Fri, Jul 23 2021 5:04 AM

      Have you got Server Side WRE turned on? We see this issue with that.

      Regards

      Chris


      AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead

      Associate Director – Digital

      OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12

      Civil 3D 2023 | Dynamo | Navisworks Manage

      PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio

      Speckle | BIMVision | Revizto | Solibri

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • AEC_PW_Interface
      0 Offline AEC_PW_Interface Fri, Jul 23 2021 8:30 AM in reply to Chris Andrew

      Hello Chris,

      Yes, we have server side WRE turned on in our PW. Is there a way to trigger it from powershell ?

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Chris Andrew
      0 Offline Chris Andrew Fri, Jul 23 2021 8:35 AM in reply to AEC_PW_Interface

      Not that I have found.

      Regards

      Chris


      AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead

      Associate Director – Digital

      OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12

      Civil 3D 2023 | Dynamo | Navisworks Manage

      PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio

      Speckle | BIMVision | Revizto | Solibri

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Ian Davidson
      0 Offline Ian Davidson Fri, Jul 23 2021 10:26 AM

      I have found the same. I was under the impression that the Set-PWDocumentState command doesn't trigger the WRE and so you would need to use other cmdlets alongside this to replicate the actions that are configured in WRE within your script.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert McMillan
      0 Online Robert McMillan Sun, Jul 25 2021 7:41 PM

      See the thread below as well. Possible workaround to invoke the WRE commands via Web Services Gateway (WSG) and PWPS_WSG PowerShell module.
      Set-PWDocumentState enhancement

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    >

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies