Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Set-PWDocumentState enhancement
    • Sign In

    • State Suggested Answer
    • +2 person also asked this people also asked this
    • Replies 21 replies
    • Answers 1 answer
    • Subscribers 67 subscribers
    • Views 6465 views
    • Users 0 members are here

    Set-PWDocumentState enhancement

    Peter Willmen
    Offline Peter Willmen over 5 years ago

    Would it be possible to add an 'Admin Override' option to the 'Set-PWDocumentState' command in PW PowerShell?. This option should only be useable by members of the Administrator group or by using a '-AdminOverride' option

    When this function is used on an object managed under the Workflow Rules Engine (WRE) it returns a 58268 error ("Manual change state not allowed. Please use Workflow customization rules to change document state")

    Access to this additional option is required for system Administrators to fix problems with WRE where on occasion the rule action times-out and the file is left in the wrong state. This can be caused by a number of things such as large/corrupt files or even a slow network connection.

    I know this can be achieved by editing the database entries but I need a managed function that can be configured to achieve the result in a consistent and controlled manner.

    • Sign in to reply
    • Cancel

    Top Replies

    • PaulDuffy12
      Offline PaulDuffy12 Wed, Nov 29 2017 5:24 AM in reply to Brian Flaherty +2
      That's fine in a sterile environment, but when a supplier is screaming because their submission is delayed and Early warnings and compensation events are set to be initiated against your organisation it…
    • Glenn Ryan
      Offline Glenn Ryan Tue, Apr 7 2020 7:48 AM in reply to Jim Irvine +2 suggested
      Jim Set-PWDocumentState will change a document's state (even versions) to whatever state you give it. I've used it to change a file stuck in CADQA state back to WIP,l for example. Cheers G
    • Peter Willmen
      Offline Peter Willmen Wed, Nov 29 2017 4:56 AM in reply to Brian Flaherty +1
      The fact is that the WRE does fail at times and also there is a requirement to move files through the workflow programmatically outside of Projectwise Client (the benefits of PowerShell). As long as…
    Parents
    • Jim Irvine
      0 Offline Jim Irvine Tue, Apr 7 2020 6:08 AM

      Hi Peter/all.

      With COVID-19 and home working, we are seeing more occurrences of workflow failing/timing out, which leaves the file in the wrong workflow state, (versions are sometimes wrong, or initials missing as well).

      I don't see any change to the Set-PWDocumentState command in terms of an 'Admin over-ride'.  Is there any quicker way I am missing to get the State manually changed/reverted when using WRE or is it still a manual hand-cranked fix every time?

      As we dont have easy write access to the Datasource DB, we are having to edit the WRE spreadsheet every time, to allow the file to be fixed, and then put the WRE rules back again, which is time consuming and adds risk.

      Any advice appreciated.

      Thanks.

      Jim

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Jim Irvine
      0 Offline Jim Irvine Tue, Apr 7 2020 6:08 AM

      Hi Peter/all.

      With COVID-19 and home working, we are seeing more occurrences of workflow failing/timing out, which leaves the file in the wrong workflow state, (versions are sometimes wrong, or initials missing as well).

      I don't see any change to the Set-PWDocumentState command in terms of an 'Admin over-ride'.  Is there any quicker way I am missing to get the State manually changed/reverted when using WRE or is it still a manual hand-cranked fix every time?

      As we dont have easy write access to the Datasource DB, we are having to edit the WRE spreadsheet every time, to allow the file to be fixed, and then put the WRE rules back again, which is time consuming and adds risk.

      Any advice appreciated.

      Thanks.

      Jim

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Glenn Ryan
      +1 Offline Glenn Ryan Tue, Apr 7 2020 7:48 AM in reply to Jim Irvine

      Jim

      Set-PWDocumentState will change a document's state (even versions) to whatever state you give it. I've used it to change a file stuck in CADQA state back to WIP,l for example.

      Cheers

      G

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Jim Irvine
      0 Offline Jim Irvine Tue, Apr 7 2020 8:45 AM in reply to Glenn Ryan

      Thanks Glenn. Appreciate the quick response.

      I guess Peter's original behaviour observation has been superseded then. I didn't notice anything in subsequent release notes that suggested Set-PWDocumentState would now work with files using WRE. It even let me change state without logging in using -LoadWRE switch just now.

      This will help the business.

      Cheers,

      Jim

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Glenn Ryan
      0 Offline Glenn Ryan Tue, Apr 7 2020 8:48 AM in reply to Jim Irvine

      Glad to help. As I posted above, the LoadWRE switch seems to be completely ignored.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Jim Irvine
      0 Offline Jim Irvine Tue, Apr 7 2020 8:50 AM in reply to Glenn Ryan

      Yeah I read that. At least it recognised our WRE States even when not loaded. Appreciate it didn't help your test back then.

      Cheers :)

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Mr.Fact
      0 Offline Mr.Fact Thu, Jun 10 2021 6:46 PM in reply to Jim Irvine

      I've started to get the same issue on code that previously worked. I can do it in PWise thru WRE with the same account.

      Error:

      WARNING: Failed to change state to 'Shared' for ..... Error: 58268

      Script:

      Get-PWDocumentsBySearch -FileName ($FileName + ".nwd") -FolderPath $PWloc -JustThisFolder | Set-PWDocumentState -State "Shared" -SkipIntermediateStates -IgnoreStatus

      Only real difference recently is we upgraded PWDI to 3.299

      Installed the most recent PW_DAB with no improvement.

      Any help appreciated.

      • 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