Skip to content

Commit

Permalink
fix for MID-6196
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Apr 7, 2020
1 parent c4819ce commit 05805dd
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -47,11 +47,16 @@ public class TaskHandlerWrapperFactory extends PrismPropertyWrapperFactoryImpl<S
@Override
protected PrismPropertyWrapper<String> createWrapper(PrismContainerValueWrapper<?> parent, PrismProperty<String> item,
ItemStatus status, WrapperContext ctx) {

PrismObject<?> prismObject = getParent(ctx);
if (prismObject == null || !TaskType.class.equals(prismObject.getCompileTimeClass())) {
return super.createWrapper(parent, item, status, ctx);
}

getRegistry().registerWrapperPanel(item.getDefinition().getTypeName(), PrismPropertyPanel.class);
PrismPropertyWrapper<String> propertyWrapper = new PrismPropertyWrapperImpl<>(parent, item, status);
PrismReferenceValue valueEnumerationRef = item.getDefinition().getValueEnumerationRef();
if (valueEnumerationRef != null) {
//TODO: task and result from context
Task task = ctx.getTask();
OperationResult result = ctx.getResult().createSubresult(OPERATION_DETERMINE_LOOKUP_TABLE);
Collection<SelectorOptions<GetOperationOptions>> options = WebModelServiceUtils
Expand All @@ -70,8 +75,8 @@ protected PrismPropertyWrapper<String> createWrapper(PrismContainerValueWrapper<
}

if (parent != null && parent.getParent() != null) {
PrismObject<TaskType> taskPrism = (PrismObject) ctx.getObject();
TaskType task = taskPrism.asObjectable();

TaskType task = (TaskType) prismObject.asObjectable();

if (ItemStatus.ADDED == status) {
Collection<AssignmentType> assignmentTypes = task.getAssignment()
Expand Down Expand Up @@ -110,6 +115,10 @@ protected PrismPropertyWrapper<String> createWrapper(PrismContainerValueWrapper<
return propertyWrapper;
}

private PrismObject<?> getParent(WrapperContext ctx) {
return ctx.getObject();
}

private String normalizeHandler(String handler) {
handler = StringUtils.remove(handler, "-3");
handler = StringUtils.removeStart(handler, "http://midpoint.evolveum.com/xml/ns/public/").replace("-", "/").replace("#", "/");
Expand Down

0 comments on commit 05805dd

Please sign in to comment.