Skip to content

Commit a5adf21

Browse files
committed
Merge branch '3.5.x'
2 parents 0dcd1ae + bde175d commit a5adf21

File tree

11 files changed

+55
-22
lines changed

11 files changed

+55
-22
lines changed

framework/elsa/fit-elsa-react/src/common/Consts.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,16 @@ export const DEFAULT_LOOP_NODE_CONTEXT = {
204204
referenceNode: VIRTUAL_CONTEXT_NODE.id,
205205
value: [VIRTUAL_CONTEXT_NODE_VARIABLES.INSTANCE_ID],
206206
}],
207+
};
208+
209+
export const DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_USER_ID = {
210+
id: `userId_${uuidv4()}`,
211+
name: 'userId',
212+
type: 'String',
213+
from: 'Reference',
214+
referenceNode: VIRTUAL_CONTEXT_NODE.id,
215+
referenceId: VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID,
216+
referenceKey: VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID,
217+
editable: false,
218+
value: [VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID],
207219
};

framework/elsa/fit-elsa-react/src/components/knowledgeRetrieval/knowledgeRetrievalComponent.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import {v4 as uuidv4} from 'uuid';
88
import {KnowledgeRetrievalWrapper} from '@/components/knowledgeRetrieval/KnowledgeRetrievalWrapper.jsx';
99
import {retrievalComponent} from '@/components/retrieval/retrievalComponent.jsx';
10-
import {DATA_TYPES, DEFAULT_KNOWLEDGE_REPO_GROUP, FROM_TYPE} from '@/common/Consts.js';
10+
import {DATA_TYPES, DEFAULT_KNOWLEDGE_REPO_GROUP, DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_USER_ID, FROM_TYPE, VIRTUAL_CONTEXT_NODE} from '@/common/Consts.js';
1111
import {
1212
UpdateGroupIdReducer,
1313
UpdateInputParamReducer,
@@ -138,7 +138,8 @@ export const knowledgeRetrievalComponent = (jadeConfig, shape) => {
138138
from: FROM_TYPE.INPUT,
139139
value: DEFAULT_KNOWLEDGE_REPO_GROUP,
140140
}],
141-
}],
141+
},
142+
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_USER_ID],
142143
outputParams: [{
143144
id: `output_${uuidv4()}`,
144145
name: 'output',

framework/elsa/fit-elsa-react/src/components/knowledgeRetrieval/knowledgeRetrievalNodeState.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export const knowledgeRetrievalNodeState = (id, x, y, width, height, parent, dra
3939
{
4040
name: 'option',
4141
},
42+
{
43+
name: 'userId',
44+
},
4245
],
4346
return: {
4447
type: 'object',

framework/elsa/fit-elsa-react/src/flow/compatibility/compatibilityProcessors.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import {getDefaultReference} from '@/components/util/ReferenceUtil.js';
99
import {
1010
DATA_TYPES,
1111
DEFAULT_KNOWLEDGE_REPO_GROUP_STRUCT,
12+
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_USER_ID,
1213
DEFAULT_LLM_KNOWLEDGE_BASES,
13-
DEFAULT_LLM_REFERENCE_OUTPUT, DEFAULT_LOOP_NODE_CONTEXT,
14+
DEFAULT_LLM_REFERENCE_OUTPUT,
15+
DEFAULT_LOOP_NODE_CONTEXT,
1416
DEFAULT_MAX_MEMORY_ROUNDS,
1517
END_NODE_TYPE,
1618
FLOW_TYPE,
@@ -390,10 +392,32 @@ export const knowledgeRetrievalCompatibilityProcessor = (shapeData, graph, pageH
390392
const process = self.process;
391393
self.process = () => {
392394
process.apply(self);
393-
const optionValue = self.shapeData.flowMeta.jober.converter.entity.inputParams.find(inputParam => inputParam.name === 'option').value;
394-
if (!optionValue.find(v => v.name === 'groupId')) {
395-
optionValue.push(DEFAULT_KNOWLEDGE_REPO_GROUP_STRUCT);
396-
}
395+
396+
const optionParamProcess = () => {
397+
const optionValue = self.shapeData.flowMeta.jober.converter.entity.inputParams
398+
.find(inputParam => inputParam.name === 'option')?.value;
399+
400+
if (Array.isArray(optionValue) && !optionValue.some(v => v.name === 'groupId')) {
401+
optionValue.push(DEFAULT_KNOWLEDGE_REPO_GROUP_STRUCT);
402+
}
403+
};
404+
405+
const userIdParamProcess = () => {
406+
const inputParams = self.shapeData.flowMeta.jober.converter.entity.inputParams;
407+
const userIdParam = inputParams.find(inputParam => inputParam.name === 'userId');
408+
if (!userIdParam) {
409+
inputParams.push(DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_USER_ID);
410+
}
411+
const entityParams = self.shapeData.flowMeta.jober.entity.params;
412+
if (!entityParams.find(param => param.name === 'userId')) {
413+
const optionIndex = entityParams.findIndex(param => param.name === 'option');
414+
const insertIndex = optionIndex !== -1 ? optionIndex + 1 : entityParams.length;
415+
entityParams.splice(insertIndex, 0, {name: 'userId'});
416+
}
417+
};
418+
419+
optionParamProcess();
420+
userIdParamProcess();
397421
};
398422

399423
return self;

framework/fel/java/maven-plugins/tool-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</dependency>
5757
<dependency>
5858
<groupId>org.mockito</groupId>
59-
<artifactId>mockito-inline</artifactId>
59+
<artifactId>mockito-core</artifactId>
6060
</dependency>
6161
<dependency>
6262
<groupId>org.assertj</groupId>

framework/fel/java/pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
<!-- Test framework versions -->
6464
<assertj.version>3.27.3</assertj.version>
6565
<junit5.version>5.12.2</junit5.version>
66-
<mockito.version>5.15.2</mockito.version>
67-
<mockito.inline.version>4.11.0</mockito.inline.version>
66+
<mockito.version>5.17.0</mockito.version>
6867

6968
<!-- Jacoco version -->
7069
<jacoco.version>0.8.10</jacoco.version>
@@ -173,12 +172,6 @@
173172
<version>${junit5.version}</version>
174173
<scope>test</scope>
175174
</dependency>
176-
<dependency>
177-
<groupId>org.mockito</groupId>
178-
<artifactId>mockito-inline</artifactId>
179-
<version>${mockito.inline.version}</version>
180-
<scope>test</scope>
181-
</dependency>
182175
<dependency>
183176
<groupId>org.mockito</groupId>
184177
<artifactId>mockito-core</artifactId>

framework/fit/java/fit-dependency/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<!-- Test framework versions -->
4848
<assertj.version>3.27.3</assertj.version>
4949
<junit5.version>5.12.2</junit5.version>
50-
<mockito.version>5.15.2</mockito.version>
50+
<mockito.version>5.17.0</mockito.version>
5151
<h2.version>2.3.232</h2.version>
5252

5353
<!-- Maven plugin versions -->

framework/fit/java/fit-test/fit-test-framework/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- Third-party versions -->
1616
<junit5.version>5.12.2</junit5.version>
1717
<h2.version>2.3.232</h2.version>
18-
<mockito.version>5.15.2</mockito.version>
18+
<mockito.version>5.17.0</mockito.version>
1919
</properties>
2020

2121
<dependencies>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
numpy==1.25.2
22
PyYAML==6.0.1
3-
requests==2.31.0
4-
tornado==6.3.2
3+
requests==2.32.0
4+
tornado==6.4.2

framework/ohscript/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<!-- Test framework versions -->
5959
<assertj.version>3.27.3</assertj.version>
6060
<junit5.version>5.12.2</junit5.version>
61-
<mockito.version>5.15.2</mockito.version>
61+
<mockito.version>5.17.0</mockito.version>
6262

6363
<!-- Maven plugin versions -->
6464
<maven.compiler.version>3.14.0</maven.compiler.version>

0 commit comments

Comments
 (0)