Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RHPAM-2960] Case instance update fails with java.io.NotSerializableE… #1660

Merged
merged 1 commit into from May 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,6 +16,13 @@

package org.jbpm.process.instance.timer;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.drools.core.common.InternalKnowledgeRuntime;
import org.drools.core.common.InternalWorkingMemory;
import org.drools.core.marshalling.impl.MarshallerReaderContext;
Expand Down Expand Up @@ -45,13 +52,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
*
*/
Expand Down Expand Up @@ -261,9 +261,10 @@ public void deserialize(MarshallerReaderContext inCtx, Timer timer) throws Class
long now = pctx.getKnowledgeRuntime().getSessionClock().getCurrentTime();
// overdue timer
if (then < now) {
trigger = new OverdueTrigger(trigger, pctx.getKnowledgeRuntime());
trigger = new OverdueTrigger(trigger);
}
}
trigger.initialize(pctx.getKnowledgeRuntime());
JobHandle jobHandle = ts.scheduleJob(processJob, pctx, trigger);
timerInstance.setJobHandle(jobHandle);
pctx.setJobHandle(jobHandle);
Expand Down Expand Up @@ -485,10 +486,14 @@ public static class OverdueTrigger implements Trigger {
public static final long OVERDUE_DELAY = Long.parseLong(System.getProperty("jbpm.overdue.timer.delay", "2000"));

private Trigger orig;
private InternalKnowledgeRuntime kruntime;
private transient InternalKnowledgeRuntime kruntime;

public OverdueTrigger(Trigger orig, InternalKnowledgeRuntime kruntime) {
public OverdueTrigger(Trigger orig) {
this.orig = orig;
}

@Override
public void initialize(InternalKnowledgeRuntime kruntime) {
this.kruntime = kruntime;
}

Expand Down