Skip to content

Commit

Permalink
[API] BPM - Adds Execution Variables (#4603)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThuF authored Jan 31, 2025
1 parent 2bf9e7d commit 2f1fb53
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ class ExecutionContext {
return this.data.callbackType ?? undefined;
}

public getVariable(variableName: string): any | undefined {
return this.getVariables()[variableName];
}

public getVariables(): Record<string, any> {
return this.data.variables ?? {};
}

}

// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
*/
package org.eclipse.dirigible.components.engine.bpm.flowable.delegate;

import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Scope;
import jakarta.annotation.Nullable;
import static org.eclipse.dirigible.components.engine.bpm.flowable.dto.ActionData.Action.SKIP;
import static org.eclipse.dirigible.components.engine.bpm.flowable.service.BpmService.DIRIGIBLE_BPM_INTERNAL_SKIP_STEP;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import org.eclipse.dirigible.commons.api.helpers.GsonHelper;
import org.eclipse.dirigible.components.engine.bpm.flowable.dto.ExecutionData;
import org.eclipse.dirigible.components.open.telemetry.OpenTelemetryProvider;
Expand All @@ -26,14 +28,10 @@
import org.graalvm.polyglot.Value;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import static org.eclipse.dirigible.components.engine.bpm.flowable.dto.ActionData.Action.SKIP;
import static org.eclipse.dirigible.components.engine.bpm.flowable.service.BpmService.DIRIGIBLE_BPM_INTERNAL_SKIP_STEP;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Scope;
import jakarta.annotation.Nullable;

/**
* The Class DirigibleCallDelegate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.eclipse.dirigible.components.engine.bpm.flowable.dto;

import java.util.Date;
import java.util.Map;

/**
* The Class ExecutionData.
Expand Down Expand Up @@ -157,6 +158,9 @@ public class ExecutionData {
/** The callback type. */
protected String callbackType;

/** The variables. */
protected Map<String, Object> variables;

/**
* Gets the id.
*
Expand Down Expand Up @@ -1003,4 +1007,22 @@ public void setCallbackType(String callbackType) {
this.callbackType = callbackType;
}

/**
* Gets the variables.
*
* @return the variables
*/
public Map<String, Object> getVariables() {
return variables;
}

/**
* Sets the variables.
*
* @param variables the new callback type
*/
public void setVariables(Map<String, Object> variables) {
this.variables = variables;
}

}

0 comments on commit 2f1fb53

Please sign in to comment.