Relationship between Activity chaining and document() function

Hi,

I encountered an abnormal behaviour and I a trying to find the root cause of the issue. I am trying to get the details of the document stored in a process variable using document() function in my script task. The document function throws an error saying "The document doesn't exist or has been deleted" when I enable activity chaining before script task, but when I disable activity chaining the process works fine. I assume the issue is with the security privileges of the uploaded document, but I was the one who uploaded the document and my account has the admin privileges.

Any Thoughts?

regards,

Abhishek Gaddam  

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi Abhishek,

    Activity chaining is used for two purposes, one for faster process, other for same person to view second screen(UI). I think you need to see how data is capturing in monitoring view. Are you uploading from UI first screen, having same access as document storage folder. Map properly inputs to process variables. As soon as you upload you will get document ID, store in rule input, so that it will reach process variable after submit. Later modify your script task assignment as run as whoever designed the process. Now check properly your script task -> if you are calculating in inputs, then the values will be in activity class parameter for output node of script task. 

    I think this will help you to find root cause. 

Reply
  • 0
    Certified Senior Developer

    Hi Abhishek,

    Activity chaining is used for two purposes, one for faster process, other for same person to view second screen(UI). I think you need to see how data is capturing in monitoring view. Are you uploading from UI first screen, having same access as document storage folder. Map properly inputs to process variables. As soon as you upload you will get document ID, store in rule input, so that it will reach process variable after submit. Later modify your script task assignment as run as whoever designed the process. Now check properly your script task -> if you are calculating in inputs, then the values will be in activity class parameter for output node of script task. 

    I think this will help you to find root cause. 

Children
  • Hi Sushma Thank you for the reply :) appreciate your effort. However, In my case, I was able to store the document and document ID in the process variables. The problem was to get the metadata of the document using document() function which doesn't work when I activity chain. Activity chaining is used to override the assignment of the next smart service which is activity chained ( Not limited to only user input task). My Question would be although I am a user with admin privileges I was not able to use the document() function in the script task when I activity chain but when I don't do it it works fine. Run as whoever designed the process also doesn't work because I was the designer and it was throwing an error when I run it.

  • Are you familiar with the contents of the Notes section on the following documentation pages:?

    I may be mistaken, but this could be related to how appian switches over from a temporary file to a permanent one.

    But it sounds like you already have the permanent doc Id, so I’m not sure...