- ExecutionContext executionContext = new ExecutionContext();
-
- // convert the values of flow.getFlowDescriptor()
- Map<String, Object> values = flow.getFlowDescriptor().getValues();
-
- Map<String, Object> convertedValues = new HashMap<String, Object>();
-
- for(String key : values.keySet()) {
- Object value = values.get(key);
- if(value instanceof PrimitiveValue) {
- PrimitiveValue primitiveValue = (PrimitiveValue) value;
-
- // TODO: check that the class of the the primitiveValue.value matches
- // the primitiveValue.type
- convertedValues.put(key, primitiveValue.getValue());
- }
- else if(value instanceof RefValue) {
- RefValue refValue = (RefValue) value;
- convertedValues.put(key, refValue.getLabel());
- }
- }
-
- executionContext.addVariables(convertedValues);
- ExecutionThread thread = new ExecutionThread(executionContext, flow.getFlowDescriptor(),
- module);