{
IF_FAIL_RETURN(jobInfo, E_PARAM);
+ // If there is only one requirement, "disjunction == true" is pointless.
+ if (jobInfo->getRequirements().size() <= 1)
+ jobInfo->setDisjunction(false);
+
+ // If a requirement has only one attribute, "disjunction == true" is pointless.
+ for (auto& req : jobInfo->getRequirements()) {
+ if (req->size() <= 1)
+ req->setDisjunction(false);
+ }
+
+ // If a trigger has only one attribute, "disjunction == true" is pointless.
+ if (jobInfo->getType() == JobInfo::Type::ON_DEMAND) {
+ for (auto& trg : static_cast<OnDemandJobInfo*>(jobInfo)->getTriggers()) {
+ if (trg->size() <= 1)
+ trg->setDisjunction(false);
+ }
+ }
+
std::string serialized = jobInfo->serialize();
GVariant* param = g_variant_new("(s)", serialized.c_str());
GVariant* result = NULL;
return __uri;
}
+unsigned int JobContext::size() const
+{
+ return __attributes.size();
+}
+
Attribute* JobContext::getAttribute(const std::string& attrName)
{
for (auto& attr : __attributes) {
virtual JobContext::Type getType() const = 0;
const std::string& getUri() const;
+ unsigned int size() const;
Attribute* getAttribute(const std::string& attrName);
bool prepareAttributeInt(const std::string& attrName);