sivaprasad9394
Occasional Collector

Delete Workflow does not delete a page, when it has incoming references, even when the deletion is confirmed by editor ('Really delete' option).??

Jump to solution

Hello Team,

Server version: 2019-06

Delete Workflow does not delete a page, when it has incoming references, even when the deletion is confirmed by editor ('Really delete' option).

How to delete it? Complete log is attached below....


CODE:

private boolean deleteObject(final StoreElement deleteObject) {

        Logging.logInfo(_logPrefix + "delete store element with uid " + ((IDProvider) deleteObject).getUid(), LOGGER);

        boolean deleteResultFlag = false;

        try {

            OperationAgent operationAgent = context.requireSpecialist(OperationAgent.TYPE);

            DeleteOperation del = operationAgent.getOperation(DeleteOperation.TYPE);

            Result deleteResult = del.perform((IDProvider) deleteObject);

            deleteResultFlag = deleteResult.isSuccessful();   ------- This is false // see the attached log file

            if (deleteResultFlag) {

                Logging.logInfo(_logPrefix + "delete store element with uid " + ((IDProvider) deleteObject).getUid()

                        + " Successful", LOGGER);

                deleteObject.refresh();

            } else {

                Logging.logInfo(_logPrefix + "delete store element with uid " + ((IDProvider) deleteObject).getUid()

                        + " Not Successful", LOGGER);

            }

        } catch (Exception e) {

            Logging.logError(_logPrefix + "unhandled exception in deleteObject", e, LOGGER);

        }

        return deleteResultFlag;

    }

LOG and Images Attached for Refrence:-

Attached Screenshot for your reference.

Thanks and Regards,

Siva

Labels (2)
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Hendrik
New Responder

Re: Delete Workflow does not delete a page, when it has incoming references, even when the deletion is confirmed by editor ('Really delete' option).??

Jump to solution

Hi Siva,

I've no idea how your workflow has been implemented, but have you seen that there's a method ignoreIncomingReferences(boolean ignoreIncomingReferences) to tell the DeleteOperation to ignore incoming reference? Maybe adding line del.ignoreIncomingReferences(true)before line Result deleteResult = del.perform((IDProvider) deleteObject); does the trick Smiley Wink

Best, Hendrik

View solution in original post

0 Kudos
2 Replies
Hendrik
New Responder

Re: Delete Workflow does not delete a page, when it has incoming references, even when the deletion is confirmed by editor ('Really delete' option).??

Jump to solution

Hi Siva,

I've no idea how your workflow has been implemented, but have you seen that there's a method ignoreIncomingReferences(boolean ignoreIncomingReferences) to tell the DeleteOperation to ignore incoming reference? Maybe adding line del.ignoreIncomingReferences(true)before line Result deleteResult = del.perform((IDProvider) deleteObject); does the trick Smiley Wink

Best, Hendrik

0 Kudos
sivaprasad9394
Occasional Collector

Re: Delete Workflow does not delete a page, when it has incoming references, even when the deletion is confirmed by editor ('Really delete' option).??

Jump to solution

Hello Holst,

Thank you for your reply and time. Its perfectly working fine.

Thanks.

Regards,

Siva

0 Kudos