mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
[DS-968] XML configurable workflow
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6532 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -175,11 +175,13 @@ public class XmlWorkflowManager {
|
||||
public static WorkflowActionConfig processOutcome(Context c, EPerson user, Workflow workflow, Step currentStep, WorkflowActionConfig currentActionConfig, ActionResult currentOutcome, XmlWorkflowItem wfi, boolean enteredNewStep) throws IOException, WorkflowConfigurationException, AuthorizeException, SQLException, WorkflowException {
|
||||
if(currentOutcome.getType() == ActionResult.TYPE.TYPE_PAGE || currentOutcome.getType() == ActionResult.TYPE.TYPE_ERROR){
|
||||
//Our outcome is a page or an error, so return our current action
|
||||
c.restoreAuthSystemState();
|
||||
return currentActionConfig;
|
||||
}else
|
||||
if(currentOutcome.getType() == ActionResult.TYPE.TYPE_CANCEL || currentOutcome.getType() == ActionResult.TYPE.TYPE_SUBMISSION_PAGE){
|
||||
//We either pressed the cancel button or got an order to return to the submission page, so don't return an action
|
||||
//By not returning an action we ensure ourselfs that we go back to the submission page
|
||||
c.restoreAuthSystemState();
|
||||
return null;
|
||||
}else
|
||||
if (currentOutcome.getType() == ActionResult.TYPE.TYPE_OUTCOME) {
|
||||
@@ -196,19 +198,29 @@ public class XmlWorkflowManager {
|
||||
return nextActionConfig;
|
||||
} else if( nextActionConfig.requiresUI() && enteredNewStep){
|
||||
//We have entered a new step and have encountered a UI, return null since the current user doesn't have anything to do with this
|
||||
c.restoreAuthSystemState();
|
||||
return null;
|
||||
} else {
|
||||
ActionResult newOutcome = nextActionConfig.getProcessingAction().execute(c, wfi, currentStep, null);
|
||||
return processOutcome(c, user, workflow, currentStep, nextActionConfig, newOutcome, wfi, enteredNewStep);
|
||||
}
|
||||
}else
|
||||
if(enteredNewStep){
|
||||
// If the user finished his/her step, we keep processing until there is a UI step action or no step at all
|
||||
Step nextStep = workflow.getNextStep(c, wfi, currentStep, currentOutcome.getResult());
|
||||
c.turnOffAuthorisationSystem();
|
||||
return processNextStep(c, user, workflow, currentOutcome, wfi, nextStep);
|
||||
} else {
|
||||
//
|
||||
ClaimedTask task = ClaimedTask.findByWorkflowIdAndEPerson(c, wfi.getID(), user.getID());
|
||||
|
||||
//Check if we have a task for this action (might not be the case with automatic steps)
|
||||
//First add it to our list of finished users, since no more actions remain
|
||||
WorkflowRequirementsManager.addFinishedUser(c, wfi, user);
|
||||
c.turnOffAuthorisationSystem();
|
||||
//Check if our requirements have been met
|
||||
if((currentStep.isFinished(c, wfi) && currentOutcome.getResult() == ActionResult.OUTCOME_COMPLETE) || currentOutcome.getResult() != ActionResult.OUTCOME_COMPLETE){
|
||||
//Clear all the metadata that might be saved by this step
|
||||
//Delete all the table rows containing the users who performed this task
|
||||
WorkflowRequirementsManager.clearInProgressUsers(c, wfi);
|
||||
//Remove all the tasks
|
||||
XmlWorkflowManager.deleteAllTasks(c, wfi);
|
||||
@@ -216,6 +228,23 @@ public class XmlWorkflowManager {
|
||||
|
||||
Step nextStep = workflow.getNextStep(c, wfi, currentStep, currentOutcome.getResult());
|
||||
|
||||
return processNextStep(c, user, workflow, currentOutcome, wfi, nextStep);
|
||||
}else{
|
||||
//We are done with our actions so go to the submissions page but remove action ClaimedAction first
|
||||
deleteClaimedTask(c, wfi, task);
|
||||
c.restoreAuthSystemState();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.error(LogManager.getHeader(c, "Invalid step outcome", "Workflow item id: " + wfi.getID()));
|
||||
throw new WorkflowException("Invalid step outcome");
|
||||
}
|
||||
|
||||
private static WorkflowActionConfig processNextStep(Context c, EPerson user, Workflow workflow, ActionResult currentOutcome, XmlWorkflowItem wfi, Step nextStep) throws SQLException, IOException, AuthorizeException, WorkflowException, WorkflowConfigurationException {
|
||||
WorkflowActionConfig nextActionConfig;
|
||||
if(nextStep!=null){
|
||||
nextActionConfig = nextStep.getUserSelectionMethod();
|
||||
nextActionConfig.getProcessingAction().activate(c, wfi);
|
||||
@@ -239,19 +268,6 @@ public class XmlWorkflowManager {
|
||||
c.restoreAuthSystemState();
|
||||
return null;
|
||||
}
|
||||
}else{
|
||||
//We are done with our actions so go to the submissions page but remove action ClaimedAction first
|
||||
ClaimedTask task = ClaimedTask.findByWorkflowIdAndEPerson(c, wfi.getID(), user.getID());
|
||||
deleteClaimedTask(c, wfi, task);
|
||||
c.restoreAuthSystemState();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.error(LogManager.getHeader(c, "Invalid step outcome", "Workflow item id: " + wfi.getID()));
|
||||
throw new WorkflowException("Invalid step outcome");
|
||||
}
|
||||
|
||||
|
||||
@@ -593,6 +609,10 @@ public class XmlWorkflowManager {
|
||||
|
||||
// Add to item as a DC field
|
||||
myitem.addMetadata(MetadataSchema.DC_SCHEMA, "description", "provenance", "en", provDescription);
|
||||
|
||||
//Clear any workflow schema related metadata
|
||||
myitem.clearMetadata(WorkflowRequirementsManager.WORKFLOW_SCHEMA, Item.ANY, Item.ANY, Item.ANY);
|
||||
|
||||
myitem.update();
|
||||
|
||||
//Restore permissions for the submitter
|
||||
|
@@ -82,6 +82,9 @@ public class RestartWorkflow {
|
||||
if (line.hasOption('e')) // eperson
|
||||
{
|
||||
eperson = line.getOptionValue('e');
|
||||
}else{
|
||||
System.out.println("The -e (eperson) option is mandatory !");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// find the EPerson, assign to context
|
||||
|
@@ -59,7 +59,7 @@ public class ScoreEvaluationAction extends ProcessingAction{
|
||||
//Wether or not we have passed, clear our score information
|
||||
wfi.getItem().clearMetadata(WorkflowRequirementsManager.WORKFLOW_SCHEMA, "score", null, Item.ANY);
|
||||
|
||||
String provDescription = getProvenanceStartId() + " Approved for entry into archive with a score of: " + totalScoreCount;
|
||||
String provDescription = getProvenanceStartId() + " Approved for entry into archive with a score of: " + scoreMean;
|
||||
wfi.getItem().addMetadata(MetadataSchema.DC_SCHEMA, "description", "provenance", "en", provDescription);
|
||||
wfi.getItem().update();
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ package org.dspace.xmlworkflow.storedcomponents;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.storage.rdbms.TableRow;
|
||||
@@ -179,46 +180,45 @@ public class XmlWorkflowItem implements InProgressSubmission {
|
||||
if(collectionId != -1){
|
||||
query.append("WHERE collection_id=").append(collectionId);
|
||||
}
|
||||
|
||||
query.append(" LIMIT ").append(pagesize).append(" OFFSET ").append((page - 1) * pagesize);
|
||||
TableRowIterator tri = DatabaseManager.queryTable(c, "xmlwf_workflowitem",
|
||||
query.toString());
|
||||
|
||||
try
|
||||
{
|
||||
// make a list of workflow items
|
||||
while (tri.hasNext())
|
||||
{
|
||||
TableRow row = tri.next();
|
||||
XmlWorkflowItem wi = new XmlWorkflowItem(c, row);
|
||||
wfItems.add(wi);
|
||||
int offset = (page - 1) * pagesize;
|
||||
if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) {
|
||||
// First prepare the query to generate row numbers
|
||||
if (pagesize > 0 || offset > 0) {
|
||||
query.insert(0, "SELECT /*+ FIRST_ROWS(n) */ rec.*, ROWNUM rnum FROM (");
|
||||
query.append(") ");
|
||||
}
|
||||
// Restrict the number of rows returned based on the limit
|
||||
if (pagesize > 0) {
|
||||
query.append("rec WHERE rownum<=? ");
|
||||
// If we also have an offset, then convert the limit into the maximum row number
|
||||
if (offset > 0) {
|
||||
pagesize += offset;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (tri != null)
|
||||
tri.close();
|
||||
// Return only the records after the specified offset (row number)
|
||||
if (offset > 0) {
|
||||
query.insert(0, "SELECT * FROM (");
|
||||
query.append(") WHERE rnum>?");
|
||||
}
|
||||
|
||||
XmlWorkflowItem[] wfArray = new XmlWorkflowItem[wfItems.size()];
|
||||
wfArray = (XmlWorkflowItem[]) wfItems.toArray(wfArray);
|
||||
|
||||
return wfArray;
|
||||
} else {
|
||||
if (pagesize > 0) {
|
||||
query.append(" LIMIT ? ");
|
||||
}
|
||||
|
||||
/**
|
||||
* return all workflowitems in one step
|
||||
*
|
||||
* @param c active context
|
||||
* @return WorkflowItem [] of all workflows in system
|
||||
*/
|
||||
public static XmlWorkflowItem[] findAllInStep(Context c, int page, int pagesize, String step_id) throws SQLException, AuthorizeException, IOException, WorkflowConfigurationException {
|
||||
List wfItems = new ArrayList();
|
||||
TableRowIterator tri = DatabaseManager.queryTable(c, "xmlwf_workflowitem",
|
||||
"SELECT * FROM xmlwf_workflowitem, xmlwf_claimtask, xmlwf_pooltask " +
|
||||
"WHERE (xmlwf_workflowitem.workflowitem_id=xmlwf_claimtask.workflowitem_id AND xmlwf_claimtask="+step_id+") " +
|
||||
"OR (xmlwf_workflowitem.workflowitem_id=xmlwf_pooltask.workflowitem_id AND xmlwf_pooltask="+step_id+") LIMIT "+pagesize+" OFFSET "+ ((page-1)*pagesize));
|
||||
|
||||
if (offset > 0) {
|
||||
query.append(" OFFSET ? ");
|
||||
}
|
||||
}
|
||||
String queryString = query.toString();
|
||||
Object[] paramArr = new Object[]{};
|
||||
if (pagesize > 0 && offset > 0) {
|
||||
paramArr = new Object[]{pagesize, offset};
|
||||
} else if (pagesize > 0) {
|
||||
paramArr = new Object[]{pagesize};
|
||||
} else if (offset > 0) {
|
||||
paramArr = new Object[]{offset};
|
||||
}
|
||||
// Get all the epeople that match the query
|
||||
TableRowIterator tri = DatabaseManager.query(c, queryString, paramArr);
|
||||
try
|
||||
{
|
||||
// make a list of workflow items
|
||||
|
@@ -189,7 +189,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
}
|
||||
}
|
||||
|
||||
Division unfinished = division.addInteractiveDivision("unfinished-submisions", contextPath+"/submit", Division.METHOD_POST);
|
||||
Division unfinished = division.addDivision("unfinished-submisions");
|
||||
unfinished.setHead(T_s_head2);
|
||||
Para p = unfinished.addPara();
|
||||
p.addContent(T_s_info2a);
|
||||
|
@@ -118,19 +118,19 @@
|
||||
<message key="xmlui.XMLWorkflow.default.editstep.claimaction">Accept/Edit/Reject</message>
|
||||
<message key="xmlui.XMLWorkflow.default.editstep.editaction">Accept/Edit/Reject</message>
|
||||
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep">Final Accept/Edit/Reject</message>
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep.claimaction">Final Accept/Edit/Reject</message>
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep.finaleditaction">Final Accept/Edit/Reject</message>
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep">Final Accept/Edit</message>
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep.claimaction">Final Accept/Edit</message>
|
||||
<message key="xmlui.XMLWorkflow.default.finaleditstep.finaleditaction">Final Accept/Edit</message>
|
||||
|
||||
|
||||
<message key="xmlui.XMLWorkflow.default.selectSingleReviewer.selectReviewerStep.claimaction">Assign reviewer step</message>
|
||||
<message key="xmlui.XMLWorkflow.default.selectSingleReviewer.selectReviewerStep.selectrevieweraction">Assign reviewer</message>
|
||||
<message key="xmlui.XMLWorkflow.selectSingleReviewer.selectReviewerStep.claimaction">Assign reviewer step</message>
|
||||
<message key="xmlui.XMLWorkflow.selectSingleReviewer.selectReviewerStep.selectrevieweraction">Assign reviewer</message>
|
||||
|
||||
<message key="xmlui.XMLWorkflow.default.selectSingleReviewer.singleUserReviewStep">Single user review step</message>
|
||||
<message key="xmlui.XMLWorkflow.default.selectSingleReviewer.singleUserReviewStep.singleuserreviewaction">Review submission</message>
|
||||
<message key="xmlui.XMLWorkflow.selectSingleReviewer.singleUserReviewStep">Single user review step</message>
|
||||
<message key="xmlui.XMLWorkflow.selectSingleReviewer.singleUserReviewStep.singleuserreviewaction">Review submission</message>
|
||||
|
||||
<message key="xmlui.XMLWorkflow.default.scoreReview.scoreReviewStep.claimaction">Score review</message>
|
||||
<message key="xmlui.XMLWorkflow.default.scoreReview.scoreReviewStep.scorereviewaction">Score review</message>
|
||||
<message key="xmlui.XMLWorkflow.default.scoreReview.scoreReviewStep">Score review</message>
|
||||
<message key="xmlui.XMLWorkflow.scoreReview.scoreReviewStep.claimaction">Score review</message>
|
||||
<message key="xmlui.XMLWorkflow.scoreReview.scoreReviewStep.scorereviewaction">Score review</message>
|
||||
<message key="xmlui.XMLWorkflow.scoreReview.scoreReviewStep">Score review</message>
|
||||
|
||||
</catalogue>
|
||||
|
@@ -1,24 +1,27 @@
|
||||
-- Convert workflow groups:
|
||||
-- TODO: is 'to_number' ok? do not forget to change role_id values
|
||||
|
||||
INSERT INTO xmlwf_collectionrole (role_id, group_id, collection_id)
|
||||
INSERT INTO xmlwf_collectionrole (collectionrole_id, role_id, group_id, collection_id)
|
||||
SELECT
|
||||
xmlwf_collectionrole_seq.nextval as collectionrole_id,
|
||||
'reviewer' AS role_id,
|
||||
eperson_group_id AS group_id,
|
||||
to_number(replace(replace(name, 'COLLECTION_', ''), '_WORKFLOW_STEP_1', '')) AS collection_id
|
||||
FROM epersongroup
|
||||
WHERE name LIKE 'COLLECTION_%_WORKFLOW_STEP_1';
|
||||
|
||||
INSERT INTO xmlwf_collectionrole (role_id, group_id, collection_id)
|
||||
INSERT INTO xmlwf_collectionrole (collectionrole_id, role_id, group_id, collection_id)
|
||||
SELECT
|
||||
xmlwf_collectionrole_seq.nextval as collectionrole_id,
|
||||
'editor' AS role_id,
|
||||
eperson_group_id AS group_id,
|
||||
to_number(replace(replace(name, 'COLLECTION_', ''), '_WORKFLOW_STEP_2', '')) AS collection_id
|
||||
FROM epersongroup
|
||||
WHERE name LIKE 'COLLECTION_%_WORKFLOW_STEP_2';
|
||||
|
||||
INSERT INTO xmlwf_collectionrole (role_id, group_id, collection_id)
|
||||
INSERT INTO xmlwf_collectionrole (collectionrole_id, role_id, group_id, collection_id)
|
||||
SELECT
|
||||
xmlwf_collectionrole_seq.nextval as collectionrole_id,
|
||||
'finaleditor' AS role_id,
|
||||
eperson_group_id AS group_id,
|
||||
to_number(replace(replace(name, 'COLLECTION_', ''), '_WORKFLOW_STEP_3', '')) AS collection_id
|
||||
@@ -39,8 +42,9 @@ FROM workflowitem;
|
||||
|
||||
|
||||
-- Migrate claimed tasks
|
||||
INSERT INTO xmlwf_claimtask (workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
INSERT INTO xmlwf_claimtask (claimtask_id,workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
SELECT
|
||||
xmlwf_claimtask_seq.nextval AS claimtask_id,
|
||||
workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'reviewstep' AS step_id,
|
||||
@@ -48,8 +52,9 @@ workflow_id AS workflowitem_id,
|
||||
owner AS owner_id
|
||||
FROM workflowitem WHERE owner IS NOT NULL AND state = 2;
|
||||
|
||||
INSERT INTO xmlwf_claimtask (workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
INSERT INTO xmlwf_claimtask (claimtask_id,workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
SELECT
|
||||
xmlwf_claimtask_seq.nextval AS claimtask_id,
|
||||
workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'editstep' AS step_id,
|
||||
@@ -57,8 +62,9 @@ workflow_id AS workflowitem_id,
|
||||
owner AS owner_id
|
||||
FROM workflowitem WHERE owner IS NOT NULL AND state = 4;
|
||||
|
||||
INSERT INTO xmlwf_claimtask (workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
INSERT INTO xmlwf_claimtask (claimtask_id,workflowitem_id, workflow_id, step_id, action_id, owner_id)
|
||||
SELECT
|
||||
xmlwf_claimtask_seq.nextval AS claimtask_id,
|
||||
workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'finaleditstep' AS step_id,
|
||||
@@ -68,8 +74,9 @@ FROM workflowitem WHERE owner IS NOT NULL AND state = 6;
|
||||
|
||||
|
||||
-- Migrate pooled tasks
|
||||
INSERT INTO xmlwf_pooltask (workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
INSERT INTO xmlwf_pooltask (pooltask_id,workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
SELECT
|
||||
xmlwf_pooltask_seq.nextval AS pooltask_id,
|
||||
workflowitem.workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'reviewstep' AS step_id,
|
||||
@@ -78,8 +85,9 @@ xmlwf_collectionrole.group_id AS group_id
|
||||
FROM workflowitem INNER JOIN xmlwf_collectionrole ON workflowitem.collection_id = xmlwf_collectionrole.collection_id
|
||||
WHERE workflowitem.owner IS NULL AND workflowitem.state = 1 AND xmlwf_collectionrole.role_id = 'reviewer';
|
||||
|
||||
INSERT INTO xmlwf_pooltask (workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
INSERT INTO xmlwf_pooltask (pooltask_id,workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
SELECT
|
||||
xmlwf_pooltask_seq.nextval AS pooltask_id,
|
||||
workflowitem.workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'editstep' AS step_id,
|
||||
@@ -88,8 +96,9 @@ xmlwf_collectionrole.group_id AS group_id
|
||||
FROM workflowitem INNER JOIN xmlwf_collectionrole ON workflowitem.collection_id = xmlwf_collectionrole.collection_id
|
||||
WHERE workflowitem.owner IS NULL AND workflowitem.state = 3 AND xmlwf_collectionrole.role_id = 'editor';
|
||||
|
||||
INSERT INTO xmlwf_pooltask (workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
INSERT INTO xmlwf_pooltask (pooltask_id,workflowitem_id, workflow_id, step_id, action_id, group_id)
|
||||
SELECT
|
||||
xmlwf_pooltask_seq.nextval AS pooltask_id,
|
||||
workflowitem.workflow_id AS workflowitem_id,
|
||||
'default' AS workflow_id,
|
||||
'finaleditstep' AS step_id,
|
||||
@@ -98,6 +107,21 @@ xmlwf_collectionrole.group_id AS group_id
|
||||
FROM workflowitem INNER JOIN xmlwf_collectionrole ON workflowitem.collection_id = xmlwf_collectionrole.collection_id
|
||||
WHERE workflowitem.owner IS NULL AND workflowitem.state = 5 AND xmlwf_collectionrole.role_id = 'finaleditor';
|
||||
|
||||
-- Delete resource policies for workflowitems before creating new ones
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 2 AND resource_id IN
|
||||
(SELECT item_id FROM workflowitem);
|
||||
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 1 AND resource_id IN
|
||||
(SELECT item2bundle.bundle_id FROM
|
||||
(workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id));
|
||||
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 0 AND resource_id IN
|
||||
(SELECT bundle2bitstream.bitstream_id FROM
|
||||
((workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id)
|
||||
INNER JOIN bundle2bitstream ON item2bundle.bundle_id = bundle2bitstream.bundle_id);
|
||||
-- Create policies for claimtasks
|
||||
-- public static final int BITSTREAM = 0;
|
||||
-- public static final int BUNDLE = 1;
|
||||
|
@@ -96,6 +96,22 @@ xmlwf_collectionrole.group_id AS group_id
|
||||
FROM workflowitem INNER JOIN xmlwf_collectionrole ON workflowitem.collection_id = xmlwf_collectionrole.collection_id
|
||||
WHERE workflowitem.owner IS NULL AND workflowitem.state = 5 AND xmlwf_collectionrole.role_id = 'finaleditor';
|
||||
|
||||
-- Delete existing workflowitem policies
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 2 AND resource_id IN
|
||||
(SELECT item_id FROM workflowitem);
|
||||
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 1 AND resource_id IN
|
||||
(SELECT item2bundle.bundle_id FROM
|
||||
(workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id));
|
||||
|
||||
DELETE FROM resourcepolicy
|
||||
WHERE resource_type_id = 0 AND resource_id IN
|
||||
(SELECT bundle2bitstream.bitstream_id FROM
|
||||
((workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id)
|
||||
INNER JOIN bundle2bitstream ON item2bundle.bundle_id = bundle2bitstream.bundle_id));
|
||||
|
||||
|
||||
-- Create policies for claimtasks
|
||||
-- public static final int BITSTREAM = 0;
|
||||
@@ -228,12 +244,18 @@ FROM (((xmlwf_workflowitem INNER JOIN item ON xmlwf_workflowitem.item_id = item.
|
||||
INSERT INTO xmlwf_in_progress_user (in_progress_user_id, workflowitem_id, user_id, finished)
|
||||
SELECT
|
||||
getnextid('xmlwf_in_progress_user') AS in_progress_user_id,
|
||||
xmlwf_workflowitem.item_id AS workflowitem_id,
|
||||
xmlwf_workflowitem.workflowitem_id AS workflowitem_id,
|
||||
xmlwf_claimtask.owner_id AS user_id,
|
||||
BOOL(0) as finished
|
||||
FROM
|
||||
(xmlwf_claimtask INNER JOIN xmlwf_workflowitem ON xmlwf_workflowitem.workflowitem_id = xmlwf_claimtask.workflowitem_id);
|
||||
|
||||
|
||||
-- Delete the old tasks and workflowitems
|
||||
-- This is important because otherwise the item can not be deleted
|
||||
DELETE FROM tasklistitem;
|
||||
DELETE FROM workflowitem;
|
||||
|
||||
-- Update the sequences
|
||||
SELECT setval('xmlwf_workflowitem_seq', max(workflowitem_id)) FROM xmlwf_workflowitem;
|
||||
SELECT setval('xmlwf_collectionrole_seq', max(collectionrole_id)) FROM xmlwf_collectionrole;
|
||||
|
Reference in New Issue
Block a user