Skip to content

Commit

Permalink
Issue 13208 unable upload files (#13224)
Browse files Browse the repository at this point in the history
* #11609 : Updating DB scripts. Adding upgrade task to create intermediate table and other minor changes.

* #11609 added first draft for add/edit workflow action

* #11609 almost code done for save/edit workflow actions associated to the scheme

* #11609 the add action and action to step are done

* #11609 Added the delete steps and dependencies/minor fixes for transactions, etc

* #11609 delete action from step done in the ui/ajax and endpoint

* #11609 Added the deletes for the UI

* #12960 changes for reorder done

* #13104 Added the new field requires lock options that supports locked, unlocked and both choices

* #12960 added the scripts changes for all dbs

* #12960 added changes for the workflow, action and step new relationships

* #12960 notes and fixes

* #12960 fixing the IT test

* #12960 code review feedback

* #11691 added changes for the new endpoint for getting content type schemes

* #12960 added changes for h2 and mysql

* #12960 added the changes for the show_on column

* #12960 adding changes for the showOn

* #12960 changes for show on functionality

* resolving the error of the missing schemeid

* solving issue with content resource test

* Fixing the Task04305UpdateWorkflowActionTable

* Reverting to master configuration

* #12960 fixing postgres and oracle UT

* #11609 fixes for 11609

* #11609 configuration rollback

* #11609 fixes by code review

* #13208 now when there is a wrong workflow task associated to the step, it is deleted
  • Loading branch information
jdotcms authored and jgambarios committed Dec 19, 2017
1 parent 4552600 commit 8c91cce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dotCMS/src/main/enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,25 @@ public WorkflowStep findStep(String id) throws DotDataException {
}

public List<WorkflowStep> findStepsByContentlet(Contentlet contentlet) throws DotDataException {
List<WorkflowStep> steps = new ArrayList<>();
List<WorkflowStep> currentSteps = cache.getSteps(contentlet);
final List<WorkflowScheme> schemes = this.findSchemesForStruct(contentlet.getContentTypeId());
List<WorkflowStep> steps = new ArrayList<>();
List<WorkflowStep> currentSteps = cache.getSteps(contentlet);
final List<WorkflowScheme> schemes = this.findSchemesForStruct(contentlet.getContentTypeId());
String workflowTaskId = null;
List<Map<String, Object>> dbResults = null;

if (currentSteps == null) {
WorkflowStep step = null;
try {
final DotConnect db = new DotConnect();
db.setSQL(sql.SELECT_STEP_BY_CONTENTLET);
db.addParam(contentlet.getIdentifier());
step = (WorkflowStep) this.convertListToObjects(db.loadObjectResults(), WorkflowStep.class).get(0);

dbResults = db.loadObjectResults();
step = (WorkflowStep) this.convertListToObjects
(dbResults, WorkflowStep.class).get(0);
steps.add(step);

workflowTaskId = (String)dbResults.get(0).get("workflowid");
} catch (final Exception e) {
Logger.debug(this.getClass(), e.getMessage());
}
Expand All @@ -593,19 +600,16 @@ public List<WorkflowStep> findStepsByContentlet(Contentlet contentlet) throws Do
throw new DotDataException("Unable to find workflow step for content id:" + contentlet.getIdentifier());
}
}


}else {
} else {
steps.addAll(currentSteps);
}
// if the existing task belongs to another workflow schema, then blank
// the workflow task status
// if the existing task belongs to another workflow schema, then remove it
if (steps.size() == 1 && !existSchemeIdOnSchemesList(steps.get(0).getSchemeId(),schemes)) {
final DotConnect db = new DotConnect();
db.setSQL(sql.RESET_CONTENTLET_STEPS);
db.addParam(StringPool.BLANK);
db.addParam(contentlet.getIdentifier());
db.loadResult();

if (null != workflowTaskId) {
this.deleteWorkflowTask(this.findWorkFlowTaskById(workflowTaskId));
}

steps = new ArrayList<>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ static protected WorkflowSQL getInstance() {
protected static String INSERT_STEP= "insert into workflow_step (id, name, scheme_id,my_order,resolved,escalation_enable,escalation_action,escalation_time) values (?, ?, ?, ?, ?, ?, ?, ?) ";
protected static String UPDATE_STEP= "update workflow_step set name=?, scheme_id=?, my_order=?, resolved = ?, escalation_enable = ?, escalation_action=?, escalation_time = ? where id = ?";
protected static String DELETE_STEP= "delete from workflow_step where id = ?";
protected static String SELECT_STEP_BY_CONTENTLET= "select workflow_step.* from workflow_step join workflow_task on workflow_task.status = workflow_step.id where workflow_task.webasset= ?";
protected static String SELECT_STEP_BY_CONTENTLET= "select workflow_task.id as workflowid, workflow_step.* from workflow_step join workflow_task on workflow_task.status = workflow_step.id where workflow_task.webasset= ?";
protected static String RESET_CONTENTLET_STEPS= "update workflow_task set status = ? where webasset= ?";
protected static String DELETE_CONTENTLET_STEPS= "delete from workflow_task where status = ? and webasset= ?";
protected static String SELECT_COUNT_CONTENTLES_BY_STEP= "select count(workflow_task.id) as count from workflow_task join workflow_step on workflow_task.status=workflow_step.id where workflow_step.id=?";

protected static String SELECT_ACTION_CLASSES_BY_ACTION= "select * from workflow_action_class where action_id = ? order by my_order";
Expand Down

0 comments on commit 8c91cce

Please sign in to comment.