User: hurairaidrees@gmail.com clicked save for playground/nutech/issue2/issue2.bpmn
This commit is contained in:
parent
415c2ba026
commit
2ca5f1048a
|
@ -405,20 +405,41 @@ A time duration defined as ISO 8601 durations format.
|
|||
<bpmn:script>hours = 0
|
||||
minutes = 0
|
||||
seconds = 0
|
||||
days = 0
|
||||
|
||||
if 'H' in timer_value_warehouse:
|
||||
hours_str = timer_value_warehouse.split('H')[0][2:]
|
||||
hours = int(hours_str) if hours_str.isdigit() else 0
|
||||
# Extract the value after "PT"
|
||||
time_value_str = timer_value_warehouse.split('PT')[1]
|
||||
|
||||
if 'M' in timer_value_warehouse:
|
||||
minutes_str = timer_value_warehouse.split('M')[0][-2:]
|
||||
minutes = int(minutes_str) if minutes_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 'S' in timer_value_warehouse:
|
||||
seconds_str = timer_value_warehouse.split('S')[0][-2:]
|
||||
seconds = int(seconds_str) if seconds_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
|
||||
|
||||
</bpmn:script>
|
||||
# Create ISO 8601 string representation based on the selected time format
|
||||
if time_format == "Hour(s)":
|
||||
timer_value_warehouse = f"PT{hours}H"
|
||||
elif time_format == "Minute(s)":
|
||||
timer_value_warehouse = f"PT{minutes}M"
|
||||
elif time_format == "Second(s)":
|
||||
timer_value_warehouse = f"PT{seconds}S"
|
||||
elif time_format == "Day(s)":
|
||||
timer_value_warehouse = f"P{days}D"
|
||||
|
||||
# Now timer_value_tfc_str contains the ISO 8601 string representation based on the selected time format
|
||||
print(timer_value_warehouse)</bpmn:script>
|
||||
</bpmn:scriptTask>
|
||||
<bpmn:scriptTask id="Activity_0eqer8e" name="Script to convert timer value to string to display">
|
||||
<bpmn:incoming>Flow_1i02a0w</bpmn:incoming>
|
||||
|
|
Loading…
Reference in New Issue