User: hurairaidrees@gmail.com clicked save for playground/nutech/receipt/receipt.bpmn
This commit is contained in:
parent
f5b9e9183f
commit
08b40cdac7
|
@ -143,24 +143,35 @@ A **time duration** defined as ISO 8601 durations format.
|
||||||
<bpmn:scriptTask id="Activity_0x2ofau" name="Script to display timer value">
|
<bpmn:scriptTask id="Activity_0x2ofau" name="Script to display timer value">
|
||||||
<bpmn:incoming>Flow_1c2eg26</bpmn:incoming>
|
<bpmn:incoming>Flow_1c2eg26</bpmn:incoming>
|
||||||
<bpmn:outgoing>Flow_1fo1w71</bpmn:outgoing>
|
<bpmn:outgoing>Flow_1fo1w71</bpmn:outgoing>
|
||||||
<bpmn:script>
|
<bpmn:script># Assuming timer_value_tfc contains the time duration in ISO 8601 format
|
||||||
|
# Example: "PT2H30M15S" for 2 hours, 30 minutes, and 15 seconds
|
||||||
|
|
||||||
|
# Initialize variables
|
||||||
hours = 0
|
hours = 0
|
||||||
minutes = 0
|
minutes = 0
|
||||||
seconds = 0
|
seconds = 0
|
||||||
days = 0
|
days = 0
|
||||||
|
|
||||||
# Extract the value after "PT"
|
# Extract the value after "PT"
|
||||||
time_value_str = timer_value_tfc.split('PT')[1:]
|
time_value_str = timer_value_tfc.split('PT')[1]
|
||||||
|
|
||||||
|
# Extract the numeric part of the time value
|
||||||
|
numeric_part = ""
|
||||||
|
for char in time_value_str:
|
||||||
|
if char.isdigit():
|
||||||
|
numeric_part += char
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
# Populate values based on the selected time format
|
# Populate values based on the selected time format
|
||||||
if time_format == "Hour(s)":
|
if time_format == "Hour(s)":
|
||||||
hours = int(time_value_str[:-1]) if time_value_str[:-1].isdigit() else 0
|
hours = int(numeric_part) if numeric_part.isdigit() else 0
|
||||||
elif time_format == "Minute(s)":
|
elif time_format == "Minute(s)":
|
||||||
minutes = int(time_value_str[:-1]) if time_value_str[:-1].isdigit() else 0
|
minutes = int(numeric_part) if numeric_part.isdigit() else 0
|
||||||
elif time_format == "Second(s)":
|
elif time_format == "Second(s)":
|
||||||
seconds = int(time_value_str[:-1]) if time_value_str[:-1].isdigit() else 0
|
seconds = int(numeric_part) if numeric_part.isdigit() else 0
|
||||||
elif time_format == "Day(s)":
|
elif time_format == "Day(s)":
|
||||||
days = int(time_value_str[:-1]) if time_value_str[:-1].isdigit() else 0
|
days = int(numeric_part) if numeric_part.isdigit() else 0
|
||||||
|
|
||||||
# Create ISO 8601 string representation based on the selected time format
|
# Create ISO 8601 string representation based on the selected time format
|
||||||
if time_format == "Hour(s)":
|
if time_format == "Hour(s)":
|
||||||
|
|
Loading…
Reference in New Issue