This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Workflow start from Lifecycle state

blackhawk - Monday, April 29, 2013 5:18 AM:

Hi all,

I'm having an ItemType with the  simple Lifecycle Preliminary -> In Review -> Released -> Obsolete. I'm trying to set up a release workflow that starts when the Item is promoted to "In Review", but I'm getting a "AddItem_Implementation_AddAccessDenied" Error.

Has anyone experienced this problem before?



Eric Domke - Monday, May 6, 2013 9:07 PM:

Is the workflow listed as one of the allowed workflows on the item type?  If not, it should be.



blackhawk - Tuesday, May 7, 2013 4:15 AM:

Yes the Workflow is an allowed one. I guess the permission is making trouble somehow. Once the Item has reached "In Review" state the only Identity having update permission granted is "Aras PLM"



Eric Domke - Tuesday, May 7, 2013 8:06 AM:

The permissions you describe could be a problem, but it sounds unlikely.  Are there any server events running on the transition into the state, or anything that would be initiated on activation of the first workflow activity?



blackhawk - Wednesday, May 8, 2013 8:07 AM:

I ran a few test and came to the conclusion that the permission is causing the problem. Since I do not want to have anyone able to edit Items it the "in review" state and the system is acting under the current users identity, its impossible to add a workflow process to an item which is in "in review".

One way to fix this could be writing a Method that changes the permission. This way the workflow could be started before the update rights are revoked, and the workflows first activitiy would be to change the permission.

Any other ideas how to work around this issue?



Eric Domke - Wednesday, May 8, 2013 8:39 AM:

The easiest/cleanest way to do this would probably be to create a server method that runs on the pre of each transition into the In Review state which would instantiate the workflow (e.g. through the IOM methods such as Item.instantiateWorkflow).  If you run a method on the post of the transition, you will need to escalate permissions using code such as

    ' Grant 'Aras PLM' permissions

    Dim plmIdentity As Aras.Server.Security.Identity = Aras.Server.Security.Identity.GetByName("Aras PLM")

    Dim PermissionWasSet As Boolean = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity)

    Try

      ' Instantiate the workflow

    Finally

      If PermissionWasSet Then Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity)

    End Try



blackhawk - Wednesday, May 8, 2013 10:15 AM:

I managed to solve the problem with the pre Transition solution. But I had to use the Aras.IOM.Item.startWorkflow() method after instantiation. There's a hint in the API that startWorkflow() is going to be removed from the IOM in future releases. Is there a replacement yet?



Eric Domke - Wednesday, May 8, 2013 12:15 PM:

Not that I am aware of, but the method is equivalent to Item.apply("startWorkflow").