%3 ::xowf::WorkflowContainer ::xowf::WorkflowContainer cleanup init object object-specific specific wf-specific ::xowf::WorkflowObject ::xowf::WorkflowObject wf_context ::xowf::WorkflowContainer->::xowf::WorkflowObject ::xowf::WorkflowConstruct ::xowf::WorkflowConstruct get_cond_values get_value get_value_set in_role init object property set_new_property set_property ::xowf::WorkflowConstruct->::xowf::WorkflowObject ::xotcl::Object ::xotcl::Object ::xowf::WorkflowObject->::xotcl::Object ::xowf::Condition ::xowf::Condition defaultmethod init ::xowf::Condition->::xowf::WorkflowConstruct ::xowf::State ::xowf::State get_actions get_all_actions ::xowf::State->::xowf::WorkflowConstruct ::xowf::Action ::xowf::Action activate get_next_state invoke ::xowf::Action->::xowf::WorkflowConstruct

Class ::xowf::WorkflowConstruct

::xowf::WorkflowConstruct[i] create ... \
           [ -handled_roles (default "[list]") ] \
           [ -label (default "[namespace tail [self]]") ] \
           [ -name (default "[namespace tail [self]]") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowf::WorkflowObject[i]
  • subclass: ::xowf::Condition[i], ::xowf::State[i], ::xowf::Action[i]
::xotcl::Class create ::xowf::WorkflowConstruct \
     -superclass ::xowf::WorkflowObject

Methods (to be applied on instances)

  • get_cond_values (scripted)

    if {[lindex $values 0] eq "?"} {
      return [lrange $values 1 end]
    } elseif {$values eq ""} {
      return ""
    } else {
      if {[regexp {^(.+):([^ ]+) } $values _ cond value]} {
        :msg "switch '$values' to new syntax: ? $cond $value ..."
      }
      return [list "" $values]
    }
  • get_value (scripted)

     <instance of xowf::WorkflowConstruct[i]> get_value

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_workflow_constructs workflow_constructs (test ) xowf::WorkflowConstruct instproc get_value xowf::WorkflowConstruct instproc get_value test_workflow_constructs->xowf::WorkflowConstruct instproc get_value test_xowf xowf (test ) test_xowf->xowf::WorkflowConstruct instproc get_value

    Testcases:
    workflow_constructs, xowf
    foreach {cond value} [:get_cond_values $values] {
      if {$cond eq "" || $cond eq "default" || $cond eq "else" ||
          $cond == "true"} {
        return $value
      } elseif {[:$cond]} {
        return $value
      }
    }
  • get_value_set (scripted)

    set result [list]
    foreach {cond value} [:get_cond_values $values] {
      foreach v $value {lappend result $v}
    }
    return [lsort -unique $result]
  • handled_roles (setter)

  • in_role (scripted)

    set ctx [:wf_context]
    set obj [$ctx object]
    #:msg parent=$obj,cl=[$obj info class],name=[$obj name]
    if {[$ctx exists in_role]} {
      set success [expr {[$ctx in_role] eq $role}]
    } else {
      set success [$obj check_role $role]
    }
    #:msg role-$role->$success
    lappend :handled_roles $role
    $ctx set handled_roles($role) 1
    if {$success} {
      :configure {*}$configuration
    }
  • init (scripted)

    #
    # Warn about potentially dangerous names, shadowing global
    # commands.  Not sure, this is the best place (or whether this
    # should be always executed), since this method might be executed
    # several hundreds of times for a view instantiating a high number
    # of workflow instances. Maybe we should define a developer-mode
    # defining this and more other calls via mxin classes.
    #
    if {[nsf::is object ::${:name}]} {
      set ctx [:wf_context]
      if {[nsf::is object $ctx]} {
        set obj [$ctx object]
        set wfName [[$obj page_template] name]
        if {$wfName ne "en:Workflow.form"} {
          ns_log warning "Workflow $wfName defines [namespace tail [:info class]] with name '${:name}' potentially shadowing global commands"
        }
      }
    }
    next
  • label (setter)

  • name (setter)

  • object (forward)

  • property (forward)

  • set_new_property (forward)

  • set_property (forward)

Variables

::xowf::WorkflowConstruct set __default_metaclass ::xotcl::Class
::xowf::WorkflowConstruct set __default_superclass ::xotcl::Object