Skip to content

Commit

Permalink
[KOGITO-9785] Walters comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Oct 31, 2023
1 parent 190bcf9 commit 3d83f1c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.github.javaparser.ast.expr.BooleanLiteralExpr;
import com.github.javaparser.ast.expr.LongLiteralExpr;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.expr.StringLiteralExpr;
import com.github.javaparser.ast.stmt.BlockStmt;

public class CompositeContextNodeVisitor<T extends CompositeContextNode> extends AbstractCompositeNodeVisitor<T> {
Expand Down Expand Up @@ -80,10 +79,6 @@ public void visitNode(String factoryField, T node, BlockStmt body, VariableScope

body.addStatement(getFactoryMethod(getNodeId(node), CompositeContextNodeFactory.METHOD_AUTO_COMPLETE, new BooleanLiteralExpr(node.isAutoComplete())));

String timeout = node.getTimeout();
if (timeout != null) {
body.addStatement(getFactoryMethod(getNodeId(node), "timeout", new StringLiteralExpr(timeout)));
}
addNodeMappings(node, body, getNodeId(node));
visitNodes(getNodeId(node), node.getNodes(), body, scope, metadata);
visitConnections(getNodeId(node), node.getNodes(), body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ protected CompositeContextNode getCompositeNode() {
return (CompositeContextNode) node;
}

public T timeout(String timeout) {
getCompositeNode().setTimeout(timeout);
return (T) this;
}

@Override
public T variable(String name, DataType type) {
return variable(name, type, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@
import java.util.Map;

import org.jbpm.process.core.timer.Timer;
import org.jbpm.process.instance.impl.actions.CompleteStateBasedNodeInstanceAction;
import org.jbpm.workflow.core.DroolsAction;
import org.jbpm.workflow.core.impl.DroolsConsequenceAction;
import org.jbpm.workflow.core.impl.ExtendedNodeImpl;

import static org.jbpm.ruleflow.core.Metadata.ACTION;

public class StateBasedNode extends ExtendedNodeImpl {

private static final long serialVersionUID = 510l;
Expand All @@ -39,25 +35,10 @@ public class StateBasedNode extends ExtendedNodeImpl {

private List<String> boundaryEvents;

private transient String duration;

public Map<Timer, DroolsAction> getTimers() {
return timers;
}

public void setTimeout(String duration) {
this.duration = duration;
Timer timer = new Timer();
timer.setDelay(duration);
DroolsConsequenceAction timeoutAction = new DroolsConsequenceAction("java", null);
timeoutAction.setMetaData(ACTION, new CompleteStateBasedNodeInstanceAction(getNodeUniqueId()));
addTimer(timer, timeoutAction);
}

public String getTimeout() {
return duration;
}

public void addTimer(Timer timer, DroolsAction action) {
if (timers == null) {
timers = new HashMap<>();
Expand Down

0 comments on commit 3d83f1c

Please sign in to comment.