on 09-18-2008 9:16 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Thanks for your replays. The status of the record is set to NOT_LOCKED even if the record is in the workflow. So I had to loop through all active workflows to check if the record I wanted to delet was in on of the active workflow. So, I found a sollution. But, if there are too many active workflows, I get a java-out of memory exception... Have to handle this to...
So, thanks for your answers, my problem is solved.
Regards, Anders
oops got it , so you are not checking the record out.
Try using this one, my guestimate, atleast the record should be locked out if not checked out !
public class RecordLockingResult
extends java.lang.Object
A container class indicating the locking/unlocking result.
Field Summary
static int LOCK_BY_CURRENT_SESSION
static int LOCK_BY_OTHER_SESSION
static int LOCK_FAILURE
static int NOT_LOCK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use this
public static interface Record.CheckoutStatus
Constants for Check-out Status of Record
Field Summary
static int MEMBER
The record is checked out and the user is a member of the checked out record.
static int NON_MEMBER
The record is checked out and the user is not a member of the checked out record.
static int NONE
The record is not check out.
static int ORIGINAL
The record is checked out and this is the original record.
static int OWNER
The record is checked out and the user is the owner of the checked out record.
static int UNDEFINED
Undefined check out status.
http://help.sap.com/javadocs/MDM/SP06/com/sap/mdm/data/Record.CheckoutStatus.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.