use of com.evolveum.midpoint.web.page.admin.server.PageTaskAdd in project midpoint by Evolveum.
the class ResourceContentPanel method newTaskPerformed.
private void newTaskPerformed(String category, AjaxRequestTarget target) {
TaskType taskType = new TaskType();
PrismProperty<ShadowKindType> pKind;
try {
pKind = taskType.asPrismObject().findOrCreateProperty(new ItemPath(TaskType.F_EXTENSION, SchemaConstants.MODEL_EXTENSION_KIND));
pKind.setRealValue(getKind());
} catch (SchemaException e) {
getSession().warn("Could not set kind for new task " + e.getMessage());
}
PrismProperty<String> pIntent;
try {
pIntent = taskType.asPrismObject().findOrCreateProperty(new ItemPath(TaskType.F_EXTENSION, SchemaConstants.MODEL_EXTENSION_INTENT));
pIntent.setRealValue(getIntent());
} catch (SchemaException e) {
getSession().warn("Could not set kind for new task " + e.getMessage());
}
PrismObject<ResourceType> resource = getResourceModel().getObject();
taskType.setObjectRef(ObjectTypeUtil.createObjectRef(resource));
taskType.setCategory(category);
setResponsePage(new PageTaskAdd(taskType));
;
}
Aggregations