User: hurairaidrees@gmail.com clicked save for playground/nutech/receipt/receipt.bpmn
This commit is contained in:
parent
219863453c
commit
2260726c5e
|
@ -143,49 +143,21 @@ 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># Assuming timer_value_tfc contains the time duration in ISO 8601 format
|
<bpmn:script>hours = 0
|
||||||
# Example: "PT2H30M15S" for 2 hours, 30 minutes, and 15 seconds
|
|
||||||
|
|
||||||
# Initialize variables
|
|
||||||
hours = 0
|
|
||||||
minutes = 0
|
minutes = 0
|
||||||
seconds = 0
|
seconds = 0
|
||||||
days = 0
|
|
||||||
|
|
||||||
# Extract the value after "PT"
|
if 'H' in timer_value_tfc:
|
||||||
time_value_str = timer_value_tfc.split('PT')[1]
|
hours_str = timer_value_tfc.split('H')[0][2:]
|
||||||
|
hours = int(hours_str) if hours_str.isdigit() else 0
|
||||||
|
|
||||||
# Extract the numeric part of the time value
|
if 'M' in timer_value_tfc:
|
||||||
numeric_part = ""
|
minutes_str = timer_value_tfc.split('M')[0][-2:]
|
||||||
for char in time_value_str:
|
minutes = int(minutes_str) if minutes_str.isdigit() else 0
|
||||||
if char.isdigit():
|
|
||||||
numeric_part += char
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
# Populate values based on the selected time format
|
if 'S' in timer_value_tfc:
|
||||||
if time_format == "Hour(s)":
|
seconds_str = timer_value_tfc.split('S')[0][-2:]
|
||||||
hours = int(numeric_part) if numeric_part.isdigit() else 0
|
seconds = int(seconds_str) if seconds_str.isdigit() else 0</bpmn:script>
|
||||||
elif time_format == "Minute(s)":
|
|
||||||
minutes = int(numeric_part) if numeric_part.isdigit() else 0
|
|
||||||
elif time_format == "Second(s)":
|
|
||||||
seconds = int(numeric_part) if numeric_part.isdigit() else 0
|
|
||||||
elif time_format == "Day(s)":
|
|
||||||
days = int(numeric_part) if numeric_part.isdigit() else 0
|
|
||||||
|
|
||||||
# Create ISO 8601 string representation based on the selected time format
|
|
||||||
if time_format == "Hour(s)":
|
|
||||||
timer_value_tfc = f"PT{hours}H"
|
|
||||||
elif time_format == "Minute(s)":
|
|
||||||
timer_value_tfc = f"PT{minutes}M"
|
|
||||||
elif time_format == "Second(s)":
|
|
||||||
timer_value_tfc = f"PT{seconds}S"
|
|
||||||
elif time_format == "Day(s)":
|
|
||||||
timer_value_tfc = f"P{days}D"
|
|
||||||
|
|
||||||
# Now timer_value_tfc_str contains the ISO 8601 string representation based on the selected time format
|
|
||||||
print(timer_value_tfc)
|
|
||||||
</bpmn:script>
|
|
||||||
</bpmn:scriptTask>
|
</bpmn:scriptTask>
|
||||||
<bpmn:userTask id="Activity_0ejewop" name="Receive Equipment at SASD Gate area">
|
<bpmn:userTask id="Activity_0ejewop" name="Receive Equipment at SASD Gate area">
|
||||||
<bpmn:extensionElements>
|
<bpmn:extensionElements>
|
||||||
|
|
Loading…
Reference in New Issue