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 b8be1e375e
commit ff0a24a577
2 changed files with 6 additions and 7 deletions

View File

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

View File

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