Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* #13303

* Deleting duplicated task, probably a bad merge
  • Loading branch information
jgambarios authored Feb 12, 2018
1 parent 71558f3 commit a95bd16
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 313 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ public void workflowTask() throws Exception {

// a mandatory scheme to test
WorkflowScheme scheme = new WorkflowScheme();
scheme.setMandatory(true);
scheme.setName("Rest Mandatory Workflow "+salt);
scheme.setDescription("testing rest save content");
scheme.setCreationDate(new Date());
Expand Down Expand Up @@ -617,9 +616,6 @@ public void workflowTask() throws Exception {
APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
PermissionAPI.PERMISSION_USE) }));
APILocator.getWorkflowAPI().saveAction(escalate.getId(), step1.getId(),user);

//Set mandatory workflow default action
scheme.setEntryActionId(saveDraft.getId());
APILocator.getWorkflowAPI().saveScheme(scheme);

// Send for review Step1 -> Step2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ public void delete() throws Exception {
WorkflowScheme newScheme = new WorkflowScheme();
newScheme.setName(schemeName);
newScheme.setArchived(false);
newScheme.setMandatory(false);
workflowAPI.saveScheme(newScheme);

WorkflowScheme ws = workflowAPI.findSchemeByName(schemeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ protected static CreateSchemeStepActionResult createSchemeStepActionActionlet(
scheme.setName(schemeName);
scheme.setArchived(false);
scheme.setDescription("Integration test " + schemeName);
scheme.setMandatory(false);
scheme.setModDate(new Date());
scheme.setCreationDate(new Date());
scheme.setDefaultScheme(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,6 @@ protected static WorkflowScheme addWorkflowScheme(final String schemeName)
scheme.setName(schemeName);
scheme.setDescription("testing workflows " + schemeName);
scheme.setCreationDate(new Date());
scheme.setMandatory(false);
workflowAPI.saveScheme(scheme);
} catch (AlreadyExistException e) {
//scheme already exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,30 +368,12 @@ private void _saveWebAsset(Map<String, Object> contentletFormData,
currentContentlet.setStringProperty("whereToSend", (String) contentletFormData.get("whereToSend"));
currentContentlet.setStringProperty("forcePush", (String) contentletFormData.get("forcePush"));

/*
If it is an existing content we need to checkout in order to set the
values we have in the edit content form.
*/
if(!isNew){

String wfActionId = (String) contentletFormData.get("wfActionId");
if(UtilMethods.isSet(wfActionId)) {

WorkflowAction action = APILocator.getWorkflowAPI().findActionRespectingPermissions(wfActionId, currentContentlet, user);

if(action != null
&& ! action.requiresCheckout() // no modifies the db
&& APILocator.getContentletAPI().canLock(currentContentlet, user)){

if(currentContentlet.isLocked())
APILocator.getContentletAPI().unlock(currentContentlet, user, false);

currentContentlet.setModUser(user.getUserId());
currentContentlet = APILocator.getWorkflowAPI().fireWorkflowNoCheckin(currentContentlet,user).getContentlet();
contentletFormData.put(WebKeys.CONTENTLET_EDIT, currentContentlet);
contentletFormData.put(WebKeys.CONTENTLET_FORM_EDIT, currentContentlet);
SessionMessages.add(request, "message", "Workflow-executed");

return;
}
}

try{
currentContentlet = conAPI.checkout(currentContentlet.getInode(), user, false);
} catch(DotLockException dle) {
Expand Down Expand Up @@ -571,6 +553,7 @@ private void _saveWebAsset(Map<String, Object> contentletFormData,
.generateSystemEvent(generateSystemEvent).build());
} else { // todo: remove this as soon as all actions are workflow actions

currentContentlet.setProperty(Contentlet.DISABLE_WORKFLOW, true);
currentContentlet.setInode(null);
currentContentlet = conAPI.checkin(currentContentlet, contRel,cats,
null, user, false,generateSystemEvent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public void save(HttpServletRequest request, HttpServletResponse response) throw
String schemeId = request.getParameter("schemeId");
String schemeDescription = request.getParameter("schemeDescription");
boolean schemeArchived = (request.getParameter("schemeArchived") != null);
boolean schemeMandatory = (request.getParameter("schemeMandatory") != null);
String schemeEntryAction = request.getParameter("schemeEntryAction");
if(!UtilMethods.isSet(schemeEntryAction)){
schemeEntryAction=null;
}

WorkflowScheme newScheme = new WorkflowScheme();

try {
Expand All @@ -40,8 +36,6 @@ public void save(HttpServletRequest request, HttpServletResponse response) throw
newScheme.setArchived(schemeArchived);
newScheme.setDescription(schemeDescription);
newScheme.setName(schemeName);
newScheme.setMandatory(schemeMandatory);
newScheme.setEntryActionId(schemeEntryAction);

try {
wapi.saveScheme(newScheme);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,6 @@ public void saveScheme(WorkflowScheme scheme) throws DotDataException, AlreadyEx
db.addParam(scheme.getDescription());
db.addParam(scheme.isArchived());
db.addParam(false);
db.addParam(scheme.getEntryActionId());
db.addParam(scheme.isDefaultScheme());
db.addParam(scheme.getModDate());
db.loadResult();
Expand All @@ -1299,7 +1298,6 @@ public void saveScheme(WorkflowScheme scheme) throws DotDataException, AlreadyEx
db.addParam(scheme.getDescription());
db.addParam(scheme.isArchived());
db.addParam(false);
db.addParam(scheme.getEntryActionId());
db.addParam(scheme.getModDate());
db.addParam(scheme.getId());
db.loadResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ static protected WorkflowSQL getInstance() {
protected static String INSERT_SCHEME_FOR_STRUCT= "insert into workflow_scheme_x_structure (id, scheme_id, structure_id) values ( ?, ?, ?)";
protected static String SELECT_SCHEME_BY_STRUCT= "select * from workflow_scheme, workflow_scheme_x_structure where workflow_scheme.id = workflow_scheme_x_structure.scheme_id and workflow_scheme_x_structure.structure_id = ?";

protected static String INSERT_SCHEME= "insert into workflow_scheme (id, name, description, archived, mandatory, entry_action_id, default_scheme, mod_date) values (?,?,?,?,?,?,?,?)";
protected static String INSERT_SCHEME= "insert into workflow_scheme (id, name, description, archived, mandatory, default_scheme, mod_date) values (?,?,?,?,?,?,?)";

protected static String UPDATE_SCHEME= "update workflow_scheme set name = ?,description =?, archived=?,mandatory=?,entry_action_id=?, mod_date=? where id =? ";
protected static String UPDATE_SCHEME= "update workflow_scheme set name = ?, description =?, archived=?, mandatory=?, mod_date=? where id =? ";

protected static String SELECT_STEPS_BY_SCHEME= "select * from workflow_step where scheme_id = ? order by my_order";
protected static String SELECT_ACTIONS_BY_SCHEME= "select * from workflow_action where scheme_id = ? order by name";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ public WorkflowProcessor(Contentlet contentlet, User firingUser) {
scheme = getWorkflowAPI().findScheme(action.getSchemeId());
}

if (!UtilMethods.isSet(workflowActionId) && task.isNew() && null != scheme) {
workflowActionId = scheme.getEntryActionId();
if (UtilMethods.isSet(workflowActionId)) {
action = findAction(contentlet, workflowActionId);
}
}

if (null == action) {
Logger.error(this,"Contentlet Identifier ("+contentlet.getIdentifier()+") should not have a null workflow action");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public void setDefaultScheme(boolean defaultScheme) {
}
String entryActionId;

@Deprecated
public String getEntryActionId() {
return entryActionId;
}

@Deprecated
public void setEntryActionId(String entryActionId) {
this.entryActionId = entryActionId;
}
Expand Down

This file was deleted.

Loading

0 comments on commit a95bd16

Please sign in to comment.