The items are not from the same database

Options

In workflow, we have a EventScript which is simply there to initiate another series of workflow instances based on the attributes of the WF you are creating.

After upgrading from CS16.2.4 to 22.3 (16.2.21.2017), this event script has stopped working. Having debugged it and stepped through into the Core modules, we have eventually found the root cause occuring when it calls DAPI.CopyNode, and returns the message "The items are not from the same database".

We only have one database, and just a single connection to it from content server. Therefore, this message does not make any sense to us.

This is the bit of code from the function in LLNode.NodeCopy

if it helps, the dataids, volumes and names of the Node and PArent Node are:

node=

pID: 56822897, pVOLUMEID: 38714339, pNAME: Version-179

(it is the workflow attachments volume)

dstParentNode=

pID: 71415069, pVOLUMEID: -2313, pNAME: Temp Map - 20 07 23 170438 - 2466971 - 1350706117

so it appears to be copying the workflow attachments volume into the new workflow instance temp map object.

thanks and regards

Guy.

Tagged:

Comments

  • Trying to understand it without the code involved.

    • User-Initiated something and the Event Script got hit is the Script on entry or exit?
    • Does the event script get executed too soon as the main WF itself has not been committed in the database? or is the step on which this is attached actually a step that is executed after the workflow has been initiated?

  • The event script is on an item handler step, but the step itself does nothing other than have the event script.

    The event script is set to execute when the "Step Is Done".

    Not sure I understand the second question.

    1. fill out attributes and initiate workflow1
    2. it moves to the item handler step, finishes work on the step, then fires the event script
    3. ultimately you get a pop up saying there was an error, and no workflows are initiated

    The aim of the script is to initiate one or more instances of workflow 2 based on your attributes of workflow 1.

    it is when it does newNode = DAPI.CopyNode that it returns this message that I don't understand the cause of.

    It's an Oracle DB, but doesn't seem to be an Oracle error message. And it used to work in CS16.2. I found some very old support tickets with this error, but none of them explain what the message means!

  • Call it a little bit of conjecture without clear proof of something but see in your flow if this works

    • In Step 2 Remove the Event Script.
    • Immediately following the IH adds a <Initiator> step and see if it gets assigned to you and attach the event script on Exit of that. If the theory can be believed you as the tester would get an assignment and you would hit "Send On"
    • Are we still not happy?

    Ok, I tend to stay away from "auto done" steps like IH, etc because more often than not people Choreograph a bunch of steps in IH and it gets really hard to debug since everything runs in a transaction and the event script has errored nothing that you want that step to do or the WF happens. BTW I had at one time created a Form and what it was doing was pretty much similar to what you said spawning workflows and it used to work.

  • dluo
    Options

    I recently ran into the same issue with NodeMove instead of NodeCopy. It turns out the contexts for node and destparentnode are different.

    In my case, the node is retrieved from workflow attachment using Admin context via a utility function which was implemented long time ago, while the destparentnode is from current user's context.

    Thus, we observed that only Admin user can call NodeMove correctly, all other users failed to run this code. Update the utility function to user context resolved it.