Check if record is in a workflow (Java API)
Hello
I am writing a short Java application that deletes records in MDM. But I get an error message when the record I try to delete is in a workflow. So, since this record is in a workflow, I do NOT want to delete it. Is it an easy way to check if a record is in a workflow (I do not check out records in the workflow)?
Regards, Anders
Tags:
Former Member replied
Hi Anders,
You can first fetch all the Worflows for that particular user using RetrieveWorkflowTasksCommand.
Then iterate through the retrieved workflowTask object.
And by using the objWFTask.getJob().getRecords()[0] compare the RecordID of the Record that
are deleting with this RecordID. If it exists ur record is part of some another workflow.
Hope this helps you.
Thanks
Namrata