Skip to content

Commit

Permalink
submitTaskFromTemplate, task cleanup after completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Oct 23, 2017
1 parent 14217ec commit 06738bc
Show file tree
Hide file tree
Showing 14 changed files with 993 additions and 689 deletions.
Expand Up @@ -503,4 +503,14 @@ public QName getTypeName() {
ItemDefinition definition = getDefinition();
return definition != null ? definition.getTypeName() : null;
}

public static PrismValue fromRealValue(Object realValue) {
if (realValue instanceof Containerable) {
return ((Containerable) realValue).asPrismContainerValue();
} else if (realValue instanceof Referencable) {
return ((Referencable) realValue).asReferenceValue();
} else {
return new PrismPropertyValue<>(realValue);
}
}
}
Expand Up @@ -32,10 +32,7 @@
import org.w3c.dom.NodeList;

import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.datatype.*;
import javax.xml.namespace.QName;

import java.io.File;
Expand Down Expand Up @@ -652,4 +649,7 @@ public static int compare(XMLGregorianCalendar o1, XMLGregorianCalendar o2) {
return o1.compare(o2);
}

public static boolean isBeforeNow(XMLGregorianCalendar time) {
return toMillis(time) < System.currentTimeMillis();
}
}
Expand Up @@ -546,4 +546,7 @@ public abstract class SchemaConstants {
// // resetPassword
// public static final String RESET_PASSWORD_ID = "user";
// public static final String RESET_PASSWORD_TOKEN = "token";

// a bit of hack
public static final String COMPLETED_TASK_CLEANUP_TRIGGER_HANDLER_URI = SchemaConstants.NS_MODEL + "/completedTaskCleanup/handler-3";
}
Expand Up @@ -1604,6 +1604,16 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="cleanupAfterCompletion" type="xsd:duration" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
If set, the task is automatically cleaned up after this time following its completion.
</xsd:documentation>
<xsd:appinfo>
<a:since>3.7</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="nextRunStartTimestamp" type="xsd:dateTime" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Expand Down
Expand Up @@ -37,5 +37,4 @@ public class ModelPublicConstants {
public static final String FOCUS_VALIDITY_SCANNER_TASK_HANDLER_URI = NS_SYNCHRONIZATION_TASK_PREFIX + "/focus-validation-scanner/handler-3"; // TODO why synchronization?
public static final String TRIGGER_SCANNER_TASK_HANDLER_URI = SchemaConstants.NS_MODEL + "/trigger/scanner/handler-3";
public static final String SHADOW_REFRESH_TASK_HANDLER_URI = SchemaConstants.NS_MODEL + "/shadowRefresh/handler-3";

}
Expand Up @@ -22,6 +22,7 @@

import javax.xml.namespace.QName;

import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -1077,4 +1078,12 @@ List<ObjectReferenceType> getMembersAsReferences(String orgOid)
ExtensionType collectExtensions(AssignmentPathType path, int startAt)
throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException,
ConfigurationException, ExpressionEvaluationException;

TaskType submitTaskFromTemplate(String templateTaskOid, List<Item<?, ?>> extensionItems)
throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException,
ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PolicyViolationException;

TaskType submitTaskFromTemplate(String templateTaskOid, Map<QName, Object> extensionValues)
throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException,
ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PolicyViolationException;
}

0 comments on commit 06738bc

Please sign in to comment.