Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/schmitt/local-cvs/midgard-current/workflow/fordoc/WorkflowProc.php
DataWorkFlow + DataflowVC -

WorkflowProc

MgdVCObject
   |
  +-- WorkflowProc

Represents a Workflow process.

 

private class WorkflowProc extends MgdVCObject

Represents a Workflow process.

 

Methods inherited from MgdVCObject

mgdvcobject, &realvcs, addcomment, &retrievecomments

Public Method Summary

object [unknown]

WorkflowProc(array &$db, [ integer $wfs ])

Construct a new WorkflowProc

Private Method Summary

object [unknown]

&brew(int $procDefId, int $destId, string $spec, [ integer $mode, integer $wfs ])

Static method
object [unknown]

&readById(int $id, [ integer $vcs ])

Static method
array

getMissingDeps()

Get objects (list of guids) that 1) the objects affected by this proc depend on and 2) are not present on the destination branch
void

getCurrentStep()

Returns the id of the current step
void

getCollectionId()

Returns the id of the MgdCollection that is affected by $this
void

getProcDefId()

Returns the id of the ProcDef (blueprint) for this WorkflowProc
void

getSrc()

Returns the id of the source branch
void

getDest()

Returns the id of the destination branch
void

getStatus()

Get the current status as stored in the DB
bool

_setStatus(int $status)

Set the status
int

hasApprovePerms([ integer $stepDefObj ])

Checks if the current user may call next() or previous() when the WorkflowProc is at the step specified.
int

hasUnPublishPerms()

Checks if the current user may unpublish this process. This is equivalent to the permission to do the last approve step
int

approveNext([ boolean $force ])

Go to next step, if it's the last step, set status to WF_TO_BE_PUBLISHED
int

approvePrevious()

Go back to the previous step
int

cancel()

Cancel the workflow process
int

undo()

Undo / unpublish
int

resolveDeps()

Starts the WorkflowProcs necessary to resolve dependencies or suggests to start them if the current user doesn't have permission
int

_publish([ boolean $force ])

Do the publish (internal)
int

_unpublish()

Do the unpublish (internal)
void

_prepare_step( $stepDefId)

For internal use
array

&searchNotCurrent([ integer $vcs ])

Static method
void

handleStatus()

Do pending actions, based on status

Fields inherited from MgdVCObject

$_vcs, $_mgddb, $_vc, $_nspace, $_branch

Private Field Summary

unknown

$_collectionId

unknown

$_stepDefId

unknown

$_procDefId

unknown

$_destId

unknown

$_closed

string

$_table

Public Method Details

WorkflowProc

public object [unknown] WorkflowProc( array &$db, [ integer $wfs ] )

  Construct a new WorkflowProc

Parameter
array &$db
the new contents of the fields, name => value
integer $wfs = >>0<<
the WorkflowSession (optional) omit if you want to use the default WorkflowSession
Returns object [unknown] $wfProc


Private Method Details

&brew

private object [unknown] &brew( int $procDefId, int $destId, string $spec, [ integer $mode, integer $wfs ] )

  Static method
Start a new WorkflowProc

Parameter
int $procDefId
id of the procdef / id of the proc
int $destId
: the id of the dest branch
string $spec
: guid or path
integer $mode = >>0<<
integer $wfs = >>0<<
the WorkflowSession (optional) omit if you want to use the default WorkflowSession
Returns object [unknown] $wfProc


&readById

private object [unknown] &readById( int $id, [ integer $vcs ] )

  Static method
Construct a WorkflowProc from the DB by id

Parameter
int $id
integer $vcs = >>0<<
(optional) omit if you want to use the default WorkflowSession
Returns object [unknown] $wfProc


getMissingDeps

private array getMissingDeps( )

  Get objects (list of guids) that 1) the objects affected by this proc depend on and 2) are not present on the destination branch

Returns array $guids


getCurrentStep

private void getCurrentStep( )

  Returns the id of the current step
return int $id

Returns void


getCollectionId

private void getCollectionId( )

  Returns the id of the MgdCollection that is affected by $this
return int $id

Returns void


getProcDefId

private void getProcDefId( )

  Returns the id of the ProcDef (blueprint) for this WorkflowProc
return int $id

Returns void


getSrc

private void getSrc( )

  Returns the id of the source branch
return int $id

Returns void


getDest

private void getDest( )

  Returns the id of the destination branch
return int $id

Returns void


getStatus

private void getStatus( )

  Get the current status as stored in the DB
return int $status

Returns void


_setStatus

private bool _setStatus( int $status )

  Set the status

Parameter
int $status
Returns bool $ret

false if failed


hasApprovePerms

private int hasApprovePerms( [ integer $stepDefObj ] )

  Checks if the current user may call next() or previous() when the WorkflowProc is at the step specified.

Parameter
integer $stepDefObj = >>0<<
(optional)
Returns int $ok


hasUnPublishPerms

private int hasUnPublishPerms( )

  Checks if the current user may unpublish this process. This is equivalent to the permission to do the last approve step

Returns int $ok


approveNext

private int approveNext( [ boolean $force ] )

  Go to next step, if it's the last step, set status to WF_TO_BE_PUBLISHED

Parameter
boolean $force = >>false<<
(optional, default false) if status change should be forced if dependencies are not resolved on the dest branch
Returns int $ok


approvePrevious

private int approvePrevious( )

  Go back to the previous step

Returns int $ok


cancel

private int cancel( )

  Cancel the workflow process

Returns int $ok


undo

private int undo( )

  Undo / unpublish

Returns int $ok


resolveDeps

private int resolveDeps( )

  Starts the WorkflowProcs necessary to resolve dependencies or suggests to start them if the current user doesn't have permission

Returns int $ok


_publish

private int _publish( [ boolean $force ] )

  Do the publish (internal)

Parameter
boolean $force = >>false<<
if it should be forced if dependencies are not resolved on the dest branch
Returns int $ok


_unpublish

private int _unpublish( )

  Do the unpublish (internal)

Returns int $ok


_prepare_step

private void _prepare_step( $stepDefId )

  For internal use

Parameter
$stepDefId
Warning: documentation is missing.
Returns void


&searchNotCurrent

private array &searchNotCurrent( [ integer $vcs ] )

  Static method
Get the ids of all procs in status WF_TO_BE_PUBLISHED or WF_TO_BE_UNPUBLISHED

Parameter
integer $vcs = >>0<<
(optional) omit if you want to use the default VCSession
Returns array $partIds


handleStatus

private void handleStatus( )

  Do pending actions, based on status

Returns void


Private Field Details

$_collectionId

private unknown $_collectionId

>><<



$_stepDefId

private unknown $_stepDefId

>><<



$_procDefId

private unknown $_procDefId

>><<



$_destId

private unknown $_destId

>><<



$_closed

private unknown $_closed

>><<



$_table

private string $_table

>>WF_PROC_TABLE<<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta