Skip to content

Commit

Permalink
Attempt to fix 500 error on "all work items" page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jun 28, 2017
1 parent 65873ec commit 702bcb4
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -24,6 +24,7 @@
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
Expand All @@ -42,6 +43,8 @@
*/
public class WfContextUtil {

private static final Trace LOGGER = TraceManager.getTrace(WfContextUtil.class);

@Nullable
public static String getStageInfo(WfContextType wfc) {
if (wfc == null || hasFinished(wfc)) {
Expand Down Expand Up @@ -348,7 +351,9 @@ public static String getProcessInstanceId(WorkItemType workItem) {
public static WfContextType getWorkflowContext(WorkItemType workItem) {
PrismContainerValue<?> parent = PrismContainerValue.getParentContainerValue(workItem.asPrismContainerValue());
if (parent == null) {
throw new IllegalStateException("No containing workflow context for " + workItem);
LOGGER.error("No workflow context for workItem {}", workItem);
// this is only a workaround, FIXME MID-4030
return new WfContextType(workItem.asPrismContainerValue().getPrismContext());
}
Containerable parentReal = parent.asContainerable();
if (!(parentReal instanceof WfContextType)) {
Expand Down

0 comments on commit 702bcb4

Please sign in to comment.