Workflow

Workflow class is the main container of Steps and Modules

class DIRAC.Core.Workflow.Workflow.Workflow(obj=None, name=None)

Bases: AttributeCollection

__init__(obj=None, name=None)

Be aware that 1-st param is an obj not a name!!!! obj can me a string with XML representation or with filename also obj can be a Workflow or ParameterCollections

addModule(module)
addParameter(opt, prefix='', postfix='')
addParameterLinked(opt, prefix='', postfix='')
addStep(step)
addTool(name, tool)

Add an object that will be available in all the modules to perform some operations. For example, a state reporting facility.

clear() None.  Remove all items from D.
compare(s)
compareParameters(s)
copy() a shallow copy of D
createCode(combine_steps=False)
createStepInstance(type_o, name)

Creates step instance of type ‘type_o’ with the name ‘name’

execute()
findParameter(name_or_ind)
findParameterIndex(ind)
fromWorkflow(obj)
fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

getBody()
getDescrShort()
getDescription()
getName()
getOrigin()
getParent()
getRequired()
getType()
getVersion()
items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
linkUp(opt, prefix='', postfix='', objname='self')
pop(k[, d]) v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

removeAllParameters()
removeParameter(name_or_ind)
removeStepInstance(name)
resolveGlobalVars()

This method will create global parameter list and then will resolve all instances of @{VARNAME} Be aware that parameters of that type are GLOBAL!!! are string and can not be dynamically change The scope: the resolution of that parameters apply from lower to upper object, for example if parameter use in module, then it checks module, then step, then workflow

Comment: If varible linked it should not be used in a global list

setBody(body)
setDescrShort(descr_short)
setDescription(description)
setName(name)
setOrigin(origin)
setParent(parent)
setRequired(required)
setType(att_type)
setValue(name, value, type_=None)
setVersion(ver)
setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

toXML()

Creates an XML representation of itself

toXMLFile(outFile)
toXMLString()
update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

updateParents()
values() an object providing a view on D's values
DIRAC.Core.Workflow.Workflow.fromXMLFile(xml_file, obj=None)
DIRAC.Core.Workflow.Workflow.fromXMLString(xml_string, obj=None)