improved Demo
This commit is contained in:
parent
e00739d564
commit
258f141808
3 changed files with 17 additions and 25 deletions
|
|
@ -103,12 +103,6 @@ public class ConditionalAIAdapter implements Serializable {
|
||||||
for (ItemCollection promptDefinition : llmConditionDefinitions) {
|
for (ItemCollection promptDefinition : llmConditionDefinitions) {
|
||||||
String llmAPIEndpoint = imixsAIPromptService.parseLLMEndpointByBPMN(promptDefinition);
|
String llmAPIEndpoint = imixsAIPromptService.parseLLMEndpointByBPMN(promptDefinition);
|
||||||
String userPrompt = promptDefinition.getItemValueString("prompt");
|
String userPrompt = promptDefinition.getItemValueString("prompt");
|
||||||
String llmAPIResultItem = promptDefinition.getItemValueString("result-item");
|
|
||||||
if (llmAPIResultItem.isEmpty()) {
|
|
||||||
throw new PluginException(OpenAIAPIService.class.getSimpleName(),
|
|
||||||
OpenAIAPIService.ERROR_PROMPT_TEMPLATE,
|
|
||||||
"Prompt Definition must include the tag 'result-item'.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("true".equalsIgnoreCase(promptDefinition.getItemValueString("debug"))) {
|
if ("true".equalsIgnoreCase(promptDefinition.getItemValueString("debug"))) {
|
||||||
llmAPIDebug = true;
|
llmAPIDebug = true;
|
||||||
|
|
@ -167,10 +161,7 @@ public class ConditionalAIAdapter implements Serializable {
|
||||||
if (llmAPIDebug) {
|
if (llmAPIDebug) {
|
||||||
logger.info("│ ├── ⚐ Conditional expression result: " + conditionalExpressionResult);
|
logger.info("│ ├── ⚐ Conditional expression result: " + conditionalExpressionResult);
|
||||||
}
|
}
|
||||||
// store result
|
|
||||||
boolean booleanExpressionResult = Boolean.parseBoolean(conditionalExpressionResult.trim());
|
boolean booleanExpressionResult = Boolean.parseBoolean(conditionalExpressionResult.trim());
|
||||||
conditionalEvent.getWorkitem().setItemValue(llmAPIResultItem, booleanExpressionResult);
|
|
||||||
|
|
||||||
// Store in transaction-scoped cache
|
// Store in transaction-scoped cache
|
||||||
promptResultCache.put(hashPrompt, "" + booleanExpressionResult);
|
promptResultCache.put(hashPrompt, "" + booleanExpressionResult);
|
||||||
conditionalEvent.setCondition("" + booleanExpressionResult);
|
conditionalEvent.setCondition("" + booleanExpressionResult);
|
||||||
|
|
|
||||||
|
|
@ -855,7 +855,7 @@ result.isValid=true;
|
||||||
</imixs:item>
|
</imixs:item>
|
||||||
<imixs:item name="txtactivityresult" type="xs:string">
|
<imixs:item name="txtactivityresult" type="xs:string">
|
||||||
<imixs:value><![CDATA[<wopi-template>
|
<imixs:value><![CDATA[<wopi-template>
|
||||||
<source-path><textblock>ausgangsrechnung-template</textblock></source-path>
|
<source-path><textblock>invoice-template</textblock></source-path>
|
||||||
<target-name><itemvalue>sequencenumber</itemvalue>.xlsx</target-name>
|
<target-name><itemvalue>sequencenumber</itemvalue>.xlsx</target-name>
|
||||||
<auto-open>true</auto-open>
|
<auto-open>true</auto-open>
|
||||||
</wopi-template>]]></imixs:value>
|
</wopi-template>]]></imixs:value>
|
||||||
|
|
@ -1518,7 +1518,7 @@ Debitor: <itemvalue>customer.name</itemvalue> (<itemvalue>customer.number</itemv
|
||||||
<bpmn2:sequenceFlow id="sequenceFlow_WMJa9Q" sourceRef="gateway_dCdQfA" targetRef="event_sLhvNg">
|
<bpmn2:sequenceFlow id="sequenceFlow_WMJa9Q" sourceRef="gateway_dCdQfA" targetRef="event_sLhvNg">
|
||||||
<bpmn2:documentation id="documentation_iYhWtw"/>
|
<bpmn2:documentation id="documentation_iYhWtw"/>
|
||||||
</bpmn2:sequenceFlow>
|
</bpmn2:sequenceFlow>
|
||||||
<bpmn2:sequenceFlow id="sequenceFlow_uaVUJA" sourceRef="gateway_YmVj8g" targetRef="event_ykc34Q">
|
<bpmn2:sequenceFlow id="sequenceFlow_uaVUJA" name="EU" sourceRef="gateway_YmVj8g" targetRef="event_ykc34Q">
|
||||||
<bpmn2:documentation id="documentation_Qa4cnA"/>
|
<bpmn2:documentation id="documentation_Qa4cnA"/>
|
||||||
</bpmn2:sequenceFlow>
|
</bpmn2:sequenceFlow>
|
||||||
<bpmn2:intermediateCatchEvent id="event_07075Q" imixs:activityid="30" name="Reject">
|
<bpmn2:intermediateCatchEvent id="event_07075Q" imixs:activityid="30" name="Reject">
|
||||||
|
|
@ -1866,17 +1866,18 @@ Debitor: <itemvalue>customer.name</itemvalue> (<itemvalue>customer.number</itemv
|
||||||
<bpmn2:outgoing>sequenceFlow_PL3AfA</bpmn2:outgoing>
|
<bpmn2:outgoing>sequenceFlow_PL3AfA</bpmn2:outgoing>
|
||||||
<bpmn2:outgoing>sequenceFlow_H0nRzA</bpmn2:outgoing>
|
<bpmn2:outgoing>sequenceFlow_H0nRzA</bpmn2:outgoing>
|
||||||
</bpmn2:task>
|
</bpmn2:task>
|
||||||
<bpmn2:sequenceFlow id="sequenceFlow_kWtVWw" name="check" sourceRef="gateway_YmVj8g" targetRef="event_kXkdQw">
|
<bpmn2:sequenceFlow id="sequenceFlow_kWtVWw" name="Not EU" sourceRef="gateway_YmVj8g" targetRef="event_kXkdQw">
|
||||||
<bpmn2:documentation id="documentation_0f3Qyw"/>
|
<bpmn2:documentation id="documentation_0f3Qyw"/>
|
||||||
<bpmn2:conditionExpression id="formalExpression_hy83hg" xsi:type="bpmn2:tFormalExpression"><![CDATA[<imixs-ai name="CONDITION">
|
<bpmn2:conditionExpression id="formalExpression_znXpIg" xsi:type="bpmn2:tFormalExpression"><![CDATA[<imixs-ai name="CONDITION">
|
||||||
<debug>true</debug>
|
<debug>true</debug>
|
||||||
<endpoint><propertyvalue>llm.service.endpoint</propertyvalue></endpoint>
|
<endpoint><propertyvalue>llm.service.endpoint</propertyvalue></endpoint>
|
||||||
<result-item>compliance.check</result-item>
|
<result-item>compliance.check</result-item>
|
||||||
<prompt><![CDATA[
|
<prompt><![CDATA[
|
||||||
Are Germany and Italy EU member countries? ]]]]><![CDATA[>
|
|
||||||
</prompt>
|
Is the recipient country code <itemvalue>customer.country</itemvalue> not a member of the European Union?
|
||||||
</imixs-ai>
|
|
||||||
]]></bpmn2:conditionExpression>
|
]]]]><![CDATA[></prompt>
|
||||||
|
</imixs-ai>]]></bpmn2:conditionExpression>
|
||||||
</bpmn2:sequenceFlow>
|
</bpmn2:sequenceFlow>
|
||||||
<bpmn2:sequenceFlow id="sequenceFlow_PL3AfA" sourceRef="task_omZN4A" targetRef="event_07075Q">
|
<bpmn2:sequenceFlow id="sequenceFlow_PL3AfA" sourceRef="task_omZN4A" targetRef="event_07075Q">
|
||||||
<bpmn2:documentation id="documentation_zaS02w"/>
|
<bpmn2:documentation id="documentation_zaS02w"/>
|
||||||
|
|
@ -2091,7 +2092,7 @@ Debitor: <itemvalue>customer.name</itemvalue> (<itemvalue>customer.number</itemv
|
||||||
<imixs:value><![CDATA[0]]></imixs:value>
|
<imixs:value><![CDATA[0]]></imixs:value>
|
||||||
</imixs:item>
|
</imixs:item>
|
||||||
<imixs:item name="rtfresultlog" type="xs:string">
|
<imixs:item name="rtfresultlog" type="xs:string">
|
||||||
<imixs:value><![CDATA[high-value of goods ⇨ export compliance review]]></imixs:value>
|
<imixs:value><![CDATA[Non-EU Member ⇨ export compliance review]]></imixs:value>
|
||||||
</imixs:item>
|
</imixs:item>
|
||||||
<imixs:item name="keyupdateacl" type="xs:boolean">
|
<imixs:item name="keyupdateacl" type="xs:boolean">
|
||||||
<imixs:value>false</imixs:value>
|
<imixs:value>false</imixs:value>
|
||||||
|
|
@ -3049,9 +3050,9 @@ th { font-weight: bold;}
|
||||||
</bpmndi:BPMNLabel>
|
</bpmndi:BPMNLabel>
|
||||||
</bpmndi:BPMNShape>
|
</bpmndi:BPMNShape>
|
||||||
<bpmndi:BPMNShape bpmnElement="event_ykc34Q" id="BPMNShape_Pf4oLg">
|
<bpmndi:BPMNShape bpmnElement="event_ykc34Q" id="BPMNShape_Pf4oLg">
|
||||||
<dc:Bounds height="36.0" width="36.0" x="1537.0" y="397.0"/>
|
<dc:Bounds height="36.0" width="36.0" x="1537.0" y="377.0"/>
|
||||||
<bpmndi:BPMNLabel id="BPMNLabel_NQVu9A">
|
<bpmndi:BPMNLabel id="BPMNLabel_NQVu9A">
|
||||||
<dc:Bounds height="20.0" width="100.0" x="1505.0" y="436.0"/>
|
<dc:Bounds height="20.0" width="100.0" x="1505.0" y="416.0"/>
|
||||||
</bpmndi:BPMNLabel>
|
</bpmndi:BPMNLabel>
|
||||||
</bpmndi:BPMNShape>
|
</bpmndi:BPMNShape>
|
||||||
<bpmndi:BPMNShape bpmnElement="event_kXkdQw" id="BPMNShape_REpEuA">
|
<bpmndi:BPMNShape bpmnElement="event_kXkdQw" id="BPMNShape_REpEuA">
|
||||||
|
|
@ -3166,7 +3167,7 @@ th { font-weight: bold;}
|
||||||
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_uaVUJA" id="BPMNEdge_TmsubA" sourceElement="BPMNShape_N57d0A" targetElement="BPMNShape_Pf4oLg">
|
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_uaVUJA" id="BPMNEdge_TmsubA" sourceElement="BPMNShape_N57d0A" targetElement="BPMNShape_Pf4oLg">
|
||||||
<di:waypoint x="1555.0" y="330.0"/>
|
<di:waypoint x="1555.0" y="330.0"/>
|
||||||
<di:waypoint x="1555.0" y="365.0"/>
|
<di:waypoint x="1555.0" y="365.0"/>
|
||||||
<di:waypoint x="1555.0" y="397.0"/>
|
<di:waypoint x="1555.0" y="377.0"/>
|
||||||
</bpmndi:BPMNEdge>
|
</bpmndi:BPMNEdge>
|
||||||
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_KW7K3Q" id="BPMNEdge_XY00LA" sourceElement="BPMNShape_lxN0AA" targetElement="BPMNShape_GQcp3w">
|
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_KW7K3Q" id="BPMNEdge_XY00LA" sourceElement="BPMNShape_lxN0AA" targetElement="BPMNShape_GQcp3w">
|
||||||
<di:waypoint x="1260.0" y="305.0"/>
|
<di:waypoint x="1260.0" y="305.0"/>
|
||||||
|
|
@ -3286,15 +3287,15 @@ th { font-weight: bold;}
|
||||||
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2Ya9Zw" id="BPMNEdge_1aho4g" sourceElement="BPMNShape_XKnQvQ" targetElement="BPMNShape_Pf4oLg">
|
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2Ya9Zw" id="BPMNEdge_1aho4g" sourceElement="BPMNShape_XKnQvQ" targetElement="BPMNShape_Pf4oLg">
|
||||||
<di:waypoint x="1963.0" y="305.0"/>
|
<di:waypoint x="1963.0" y="305.0"/>
|
||||||
<di:waypoint x="2019.0" y="305.0"/>
|
<di:waypoint x="2019.0" y="305.0"/>
|
||||||
<di:waypoint x="2019.0" y="415.0"/>
|
<di:waypoint x="2019.0" y="395.0"/>
|
||||||
<di:waypoint x="1573.0" y="415.0"/>
|
<di:waypoint x="1573.0" y="395.0"/>
|
||||||
</bpmndi:BPMNEdge>
|
</bpmndi:BPMNEdge>
|
||||||
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ck1EvQ" id="BPMNEdge_Sk0HSA" sourceElement="BPMNShape_WjFQvA" targetElement="BPMNShape_ExclusiveGateway_2">
|
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ck1EvQ" id="BPMNEdge_Sk0HSA" sourceElement="BPMNShape_WjFQvA" targetElement="BPMNShape_ExclusiveGateway_2">
|
||||||
<di:waypoint x="683.0" y="725.0"/>
|
<di:waypoint x="683.0" y="725.0"/>
|
||||||
<di:waypoint x="770.0" y="725.0"/>
|
<di:waypoint x="770.0" y="725.0"/>
|
||||||
</bpmndi:BPMNEdge>
|
</bpmndi:BPMNEdge>
|
||||||
<bpmndi:BPMNEdge bpmnElement="messageFlow_Tb93qQ" id="BPMNEdge_qQdLXA" sourceElement="BPMNShape_Pf4oLg" targetElement="BPMNShape_WjFQvA">
|
<bpmndi:BPMNEdge bpmnElement="messageFlow_Tb93qQ" id="BPMNEdge_qQdLXA" sourceElement="BPMNShape_Pf4oLg" targetElement="BPMNShape_WjFQvA">
|
||||||
<di:waypoint x="1555.0" y="433.0"/>
|
<di:waypoint x="1555.0" y="413.0"/>
|
||||||
<di:waypoint x="1555.0" y="509.0"/>
|
<di:waypoint x="1555.0" y="509.0"/>
|
||||||
<di:waypoint x="664.0" y="509.0"/>
|
<di:waypoint x="664.0" y="509.0"/>
|
||||||
<di:waypoint x="664.0" y="707.0"/>
|
<di:waypoint x="664.0" y="707.0"/>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue