I have defined a workflow that copies an item revision to my Target item revision with a specific relation.
(Using Create Relation Handler)
But next time if i run this workflow, it copies new revision to the target item revision. But my requirement is to cut the old revision/relation and have only the newly added (latest) revision as target. How can i achieve this?
Can i undo the previous workflow process if there are any before i run the new workflow process?
I do not find any handlers to do this.
"EPM-create-relation" handler does not create new revisions, It just establishes the relation between your targets/references basing on what you define as the primary type and secondary type
I see that you are trying to execute the WF second time not on the same set of primary/Secondary but on different set of revision's.
can you give some more info like does the revisions are same or different revisions
Thats right. It just creates the relation.
Here is the real Case:
I have Document Item revision & Design Item revision. There is auto relation between Document Item Revision & Design Item Revision but not the other way around (Document contains design in a pseudofolder but design doesn't hold the documents but can only be viewed using Impact analysis).
So we are running the workflow on the document revision to copy the Document item revision to the associated Design Item Revision with a custom relation.
But at times we have different Document item revision referencing same design item revision.(Doc Rev A - Design Rev A; Doc Rev B - Design Rev A)
This means running the workflow on the document item revision B will simply copy this revision B of document revision on to design revision in addition to Revision A. This is logical.
But the expectation from the customer is that the Design revision should hold only latest document revision B. All older revisions (A) must be removed.
From what you explained, you are trying to achieve a behaviour similar to representation for relation.
I would create a separate reverse relation and extend(extension code) grm create from forward relation (doc Rev to design Rev) to compute and populate the reverse relation. This way don't have to depend on the workflow.
alternatively, you could also plan for a runtime property on design Rev to show the associated doc Rev ( through customisation)
Thanks Harish. We thought about these solutions and business was bit reluctant to use any customization.
So i created a workflow process that does everything except this remove relation stuff.
I have seen a custom handler from Siemens that does this job. But currently not part of OOTB.