Update the actions type from RuleDefinition class in order to be able to use it with other non-rm actions

This commit is contained in:
Rodica Sutu
2018-10-25 11:25:19 +03:00
parent bfd0e588eb
commit 0b4ef36671
2 changed files with 6 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ public class RuleDefinition
private String contentTitle; private String contentTitle;
private String contentDescription; private String contentDescription;
private String rejectReason; private String rejectReason;
private List<ActionsOnRule> actions; private List<String> actions;
/** /**
* Creates a new object of type Rule Definition * Creates a new object of type Rule Definition
@@ -189,15 +189,15 @@ public class RuleDefinition
return this; return this;
} }
public List<String> getActions()
public List<ActionsOnRule> getActions()
{ {
return actions; return actions;
} }
public RuleDefinition actions(List<ActionsOnRule> actions) public RuleDefinition actions(List<String> actions)
{ {
this.actions = actions; this.actions = actions;
return this; return this;
} }
} }

View File

@@ -38,7 +38,6 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.alfresco.rest.core.v0.BaseAPI; import org.alfresco.rest.core.v0.BaseAPI;
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
import org.alfresco.rest.rm.community.model.rules.RuleDefinition; import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.json.JSONArray; import org.json.JSONArray;
@@ -251,10 +250,10 @@ public class RulesAPI extends BaseAPI
{ {
List<JSONObject> ruleActionsList = new ArrayList<>(); List<JSONObject> ruleActionsList = new ArrayList<>();
for (ActionsOnRule ruleAction : ruleProperties.getActions()) for (String ruleAction : ruleProperties.getActions())
{ {
JSONObject ruleActionObj = new JSONObject(); JSONObject ruleActionObj = new JSONObject();
ruleActionObj.put("actionDefinitionName", ruleAction.getActionValue()); ruleActionObj.put("actionDefinitionName", ruleAction);
JSONObject parameters = new JSONObject(); JSONObject parameters = new JSONObject();
if (ruleProperties.getPath() != null) if (ruleProperties.getPath() != null)
{ {