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:incoming>Flow_1c2eg26</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_1fo1w71</bpmn:outgoing>
|
||||
<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
|
||||
<bpmn:script>hours = 0
|
||||
minutes = 0
|
||||
seconds = 0
|
||||
days = 0
|
||||
|
||||
# Extract the value after "PT"
|
||||
time_value_str = timer_value_tfc.split('PT')[1]
|
||||
if 'H' in timer_value_tfc:
|
||||
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
|
||||
numeric_part = ""
|
||||
for char in time_value_str:
|
||||
if char.isdigit():
|
||||
numeric_part += char
|
||||
else:
|
||||
break
|
||||
if 'M' in timer_value_tfc:
|
||||
minutes_str = timer_value_tfc.split('M')[0][-2:]
|
||||
minutes = int(minutes_str) if minutes_str.isdigit() else 0
|
||||
|
||||
# Populate values based on the selected time format
|
||||
if time_format == "Hour(s)":
|
||||
hours = int(numeric_part) if numeric_part.isdigit() else 0
|
||||
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>
|
||||
if 'S' in timer_value_tfc:
|
||||
seconds_str = timer_value_tfc.split('S')[0][-2:]
|
||||
seconds = int(seconds_str) if seconds_str.isdigit() else 0</bpmn:script>
|
||||
</bpmn:scriptTask>
|
||||
<bpmn:userTask id="Activity_0ejewop" name="Receive Equipment at SASD Gate area">
|
||||
<bpmn:extensionElements>
|
||||
|
|
Loading…
Reference in New Issue