MCPcopy
hub / github.com/sartography/SpiffWorkflow / get_name

Method get_name

SpiffWorkflow/util/task.py:84–101  ·  view source on GitHub ↗

Get the name of the state or mask from the value. Args: state (int): a `TaskState` value Returns: str: the name of the state

(cls, state)

Source from the content-addressed store, hash-verified

82
83 @classmethod
84 def get_name(cls, state):
85 """Get the name of the state or mask from the value.
86
87 Args:
88 state (int): a `TaskState` value
89
90 Returns:
91 str: the name of the state
92 """
93 names = dict(zip(cls._values, cls._names))
94 names.update({
95 TaskState.FINISHED_MASK: 'FINISHED_MASK',
96 TaskState.DEFINITE_MASK: 'DEFINITE_MASK',
97 TaskState.PREDICTED_MASK: 'PREDICTED_MASK',
98 TaskState.NOT_FINISHED_MASK: 'NOT_FINISHED_MASK',
99 TaskState.ANY_MASK: 'ANY_MASK',
100 })
101 return names.get(state) or '|'.join([ names.get(v) for v in cls._values if v & state ])
102
103 @classmethod
104 def get_value(cls, name):

Callers 7

stateMethod · 0.45
_set_stateMethod · 0.45
collect_log_extrasMethod · 0.45
__repr__Method · 0.45
get_dumpMethod · 0.45
serialize_taskMethod · 0.45

Calls 1

getMethod · 0.45

Tested by 1