Within the <workflow> block, one or more global
callbacks (either for schematic or Workbench operations) can be defined in a child
<callbacks> block.
ACT currently provides 22 schematic callbacks. Each of the 11 operations available on the Project Schematic support both a pre- and post-operation callback.
ACT also provides two non-schematic, Workbench callbacks. The change design point operation supports both a pre- and post-operation callback.
The basic structure of a global callback definition follows.
<callbacks> <onbeforetaskreset></onbeforetaskreset> <onaftertaskreset></onaftertaskreset> <onbeforetaskrefresh></onbeforetaskrefresh> <onaftertaskrefresh></onaftertaskrefresh> <onbeforetaskupdate></onbeforetaskupdate> <onaftertaskupdate></onaftertaskupdate> <onbeforetaskduplicate></onbeforetaskduplicate> <onaftertaskduplicate></onaftertaskduplicate> <onbeforetasksourceschanged></onbeforetasksourceschanged> <onaftertasksourceschanged></onaftertasksourceschanged> <onbeforetaskcreation></onbeforetaskcreation> <onaftertaskcreation></onaftertaskcreation> <onbeforetaskdeletion></onbeforetaskdeletion> <onaftertaskdeletion></onaftertaskdeletion> <onbeforetaskcanusetransfer></onbeforetaskcanusetransfer> <onaftertaskcanusetransfer></onaftertaskcanusetransfer> <onbeforetaskcanduplicate></onbeforetaskcanduplicate> <onaftertaskcanduplicate></onaftertaskcanduplicate> <onbeforetaskstatus></onbeforetaskstatus> <onaftertaskstatus></onaftertaskstatus> <onbeforetaskpropertyretrieval></onbeforetaskpropertyretrieval> <onaftertaskpropertyretrieval></onaftertaskpropertyretrieval> <onbeforedesignpointchanged></onbeforedesignpointchanged> <onafterdesignpointchanged></onaftersignpointchanged> </callbacks>
Related Topics:
By default, if a global schematic callback is defined in the XML definition
file, it is called for each instance of the schematic task associated with it.
This applies to both pre-installed (non-ACT) and custom tasks. For example, if
you have defined the callback <onaftertaskupdate>,
it is invoked for each task that is updated. If three tasks on the
Project Schematic are updated, the callback is invoked
three times, once after each update.
Unless otherwise noted, a global schematic workflow callback receives a task as the method argument. Depending on the callback, the task is the concrete task displayed in the schematic or the task template.
To specify that a callback is processed only for a specific location in the project, such as the task or template, you can perform a check within the callback implementation based on the supplied arguments. For example, in the following IronPython code sample:
The method onBeforeUpdate is unfiltered. The
actions are invoked before the update of each eligible task on the
schematic.
The method onAfterUpdate is filtered. It
produces different messages for Engineering Data
tasks and the second Setup task, while printing
'ignored' for all other tasks.
Note: The Setup tasks for multiple Fluent task
groups would be identified in the following sequence:
Setup, Setup 1,
Setup 2, and so on.
The method onBeforeDuplicate is filtered. It
prints a specific message for the Setup tasks for
all Fluent tasks on the schematic.
...
def onBeforeUpdate(task):
msg = getPrintMessage('pre-update', task)
print msg
def onAfterUpdate(task):
if task.Name == "Engineering Data":
msg = getPrintMessage('post-update', task)
print msg
elif task.Name == "Setup 2":
print("fluent setup 2")
else:
print("ignored")
def onBeforeDuplicate(task):
if task.Container.Type == "Ansys.Fluent.Addin:SetupContainer":
print("all fluent setups")
else:
print("ignored")
...When multiple callbacks are defined for the same pre- or post-operation
schematic action, you can specify their order of execution by adding the
order attribute to the callback declaration:
<workflow ...>
<callbacks>
<onbeforetaskreset order=”1”>...</onbeforetaskreset>
...
</callbacks>
</workflow>ACT executes the callbacks from lowest order to highest order. This means that a callback with an order of 2 executes after a callback with an of order of 1. When values are identical, the order in which the extension is loaded dictates the collision resolution.
This section describes the global callback and corresponding methods and arguments for each schematic operation.
Note: Any hyphenation within long table entries can be ignored. Callbacks and methods do not include hyphens.
ResetResets a component back to its pristine, new state.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
RefreshConsumes all upstream data and prepares any local data for an ensuing update.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
UpdateGenerates all broadcast output types that render the component fully solved.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
CreateCreates a task based on an underlying template.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
|
Note:This is
a task representing the template. Some components
do not include the template as a parameter to the
command |
|
|
|
task |
DeleteRemoves a task from a task group.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
DuplicateCreates an identical, yet independent, clone of the task.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
SourcesChangedProcesses a change in upstream sources.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
CanUseTransferChecks whether the task can consume data from a specific upstream task.
Callback receives two tasks as arguments: the
source (upstream producer) task and
target (downstream consumer)
task.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
|
|
|
|
|
Note: The
argument
|
CanDuplicateChecks whether the task permits duplication.
Callback receives no arguments. The schematic does not provide any workable information to construct or provide tasks (either container-based or template-based). Callback only serve as a general “processing” hook if exposed.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
|
None |
|
|
|
Note: The
argument
|
StatusCalculates the task’s current state.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
Note: The
argument
|
PropertyRetrievalDetermines the visibility of property-containing objects.
| Global Callbacks | Methods | Arguments |
|---|---|---|
|
|
| task |
|
|
|
Note: The
argument
|
This section describes the global callback and corresponding methods for each non-schematic Workbench operation.
designpointchangedSignals to workflow that a design point change is about to or has occurred.
| Global Callbacks | Methods |
|---|---|
|
|
|
|
|
|