Package com.uc4.api.objects
Class WorkflowIF
- java.lang.Object
-
- com.uc4.api.objects.UC4Object
-
- com.uc4.api.objects.WorkflowIF
-
- All Implemented Interfaces:
LifecycleSaveAware
,WorkflowInterfaces.IUpdatable
public class WorkflowIF extends UC4Object implements WorkflowInterfaces.IUpdatable, LifecycleSaveAware
This class represents an IF in a ProcessFlow.
-
-
Constructor Summary
Constructors Constructor Description WorkflowIF()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFalse(JobPlanTask task)
Adds a task to thefalse
branch of this IF workflow.void
addFalse(JobPlanTask task, int pos)
Adds a task to thefalse
branch of this IF workflow at the specified position.void
addTrue(JobPlanTask task)
Adds a task to thetrue
branch of this IF workflow.void
addTrue(JobPlanTask task, int pos)
Adds a task to thetrue
branch of this IF workflow at the specified position.void
afterSaveObject()
Called after an object is saved.JobPlanAttributes
attributes()
Returns attributes of thisJobPlan
.void
clear()
Removes all tasks from thetrue
andfalse
branches.ConditionsSet
condition()
Returns the condition of the IF.protected com.uc4.api.objects.WorkflowTasks
createWorkflowTasks(com.uc4.util.XMLDocument doc, ConnectionAttributes info)
Creates aWorkflowTasks
object which holds the tasks of a workflow.java.util.Iterator<JobPlanTask>
falseTasksIterator()
Returns an iterator over tasks in thefalse
branch.JobPlanTask
getEndTask()
Returns the END task of an IF.int
getNumberOfFalseTasks()
Returns the number of tasks in thefalse
branch.int
getNumberOfTrueTasks()
Returns the number of tasks in thetrue
branch.java.lang.String
getProcess()
Returns the content of the "Process" tab.JobPlanTask
getStartTask()
Returns the Start Task of an IF.JobPlanTask
getTaskByUserDefinedID(java.lang.String id)
Returns a worfkflow task with the specified ID.XHeader
header()
Returns the header data of this object.boolean
isExecutable()
Returnstrue
if this Object can be executed.boolean
removeTask(JobPlanTask task)
Removes the specified task from theWorkFLowIF
.Rollback
rollback()
This method provides access to the rollback tab of an executable object.Runtime
runtime()
Returns runtime information of this job.void
setProcess(java.lang.String script)
Sets the content of the "Process" tab.protected void
setTaskFactory(WorkFlowTaskFactory taskFactory)
Sub classes may call this method in order to provide their own sub class ofJobPlanTask
which may contain additional features.SyncList
syncs()
Returns aSyncList
object which contains sync conditions of this object.java.util.Iterator<JobPlanTask>
trueTasksIterator()
Returns an iterator over tasks in thetrue
branch.void
update()
Update the object (i.e.void
validate()
Validates the object.ObjectValues
values()
-
Methods inherited from class com.uc4.api.objects.UC4Object
docu, getAccess, getIdnr, getModCount, getName, getObjectClient, getType, isOldVersion, load, store
-
-
-
-
Method Detail
-
setTaskFactory
protected void setTaskFactory(WorkFlowTaskFactory taskFactory)
Sub classes may call this method in order to provide their own sub class ofJobPlanTask
which may contain additional features.- Parameters:
taskFactory
- Task Factory
-
values
public ObjectValues values()
- Returns:
- Variables of this object
-
header
public XHeader header()
Returns the header data of this object. This is the information of the header tab in the dialog client.- Returns:
- header
-
syncs
public SyncList syncs()
Returns aSyncList
object which contains sync conditions of this object.- Returns:
- sync conditions
-
getTaskByUserDefinedID
public JobPlanTask getTaskByUserDefinedID(java.lang.String id)
Returns a worfkflow task with the specified ID.- Parameters:
id
- ID of the task- Returns:
- Task or
null
if not found
-
runtime
public Runtime runtime()
Returns runtime information of this job. This corresponds to the "Runtime" tab in the dialog client.- Returns:
- Runtime information
-
getProcess
public java.lang.String getProcess()
Returns the content of the "Process" tab.- Returns:
- JCL
-
setProcess
public void setProcess(java.lang.String script)
Sets the content of the "Process" tab.- Parameters:
script
- Script
-
attributes
public JobPlanAttributes attributes()
Returns attributes of thisJobPlan
.- Returns:
- JobPlan attributes
-
addTrue
public void addTrue(JobPlanTask task)
Adds a task to thetrue
branch of this IF workflow.- Parameters:
task
- JobPlanTask to add
-
addTrue
public void addTrue(JobPlanTask task, int pos)
Adds a task to thetrue
branch of this IF workflow at the specified position.- Parameters:
task
- JobPlanTask to addpos
- Position where the task should be added
-
removeTask
public boolean removeTask(JobPlanTask task) throws java.io.InvalidObjectException
Removes the specified task from theWorkFLowIF
.- Parameters:
task
- WorkFLowIF task which should be removed- Returns:
- True if the task was removed successfully
- Throws:
java.io.InvalidObjectException
- If the object is not valid
-
getStartTask
public JobPlanTask getStartTask()
Returns the Start Task of an IF.- Returns:
- Start task
-
getEndTask
public JobPlanTask getEndTask()
Returns the END task of an IF.- Returns:
- End task
-
rollback
public Rollback rollback()
This method provides access to the rollback tab of an executable object.- Returns:
- Rollback settings
-
addFalse
public void addFalse(JobPlanTask task)
Adds a task to thefalse
branch of this IF workflow.- Parameters:
task
- JobPlanTask to add
-
addFalse
public void addFalse(JobPlanTask task, int pos)
Adds a task to thefalse
branch of this IF workflow at the specified position.- Parameters:
task
- JobPlanTask to addpos
- Position where the task should be added
-
getNumberOfTrueTasks
public int getNumberOfTrueTasks()
Returns the number of tasks in thetrue
branch.- Returns:
- Number of tasks which are executed when the condition is
true
-
getNumberOfFalseTasks
public int getNumberOfFalseTasks()
Returns the number of tasks in thefalse
branch.- Returns:
- Number of tasks which are executed when the condition is
false
-
trueTasksIterator
public java.util.Iterator<JobPlanTask> trueTasksIterator()
Returns an iterator over tasks in thetrue
branch.- Returns:
- Iterator of tasks in the
true
branch.
-
falseTasksIterator
public java.util.Iterator<JobPlanTask> falseTasksIterator()
Returns an iterator over tasks in thefalse
branch.- Returns:
- Iterator of tasks in the
false
branch.
-
condition
public ConditionsSet condition()
Returns the condition of the IF.- Returns:
- IF condition
-
clear
public void clear()
Removes all tasks from thetrue
andfalse
branches.
-
isExecutable
public boolean isExecutable()
Description copied from class:UC4Object
Returnstrue
if this Object can be executed.- Specified by:
isExecutable
in classUC4Object
- Returns:
- true if the Object can be executed, false if not.
-
createWorkflowTasks
protected com.uc4.api.objects.WorkflowTasks createWorkflowTasks(com.uc4.util.XMLDocument doc, ConnectionAttributes info)
Creates aWorkflowTasks
object which holds the tasks of a workflow. Sub classes may override this method.- Parameters:
doc
- XML Documentinfo
- Connection attributes- Returns:
- WorklfowTasks
-
validate
public void validate() throws java.io.InvalidObjectException
Description copied from class:UC4Object
Validates the object. If the object is not valid anInvalidObjectException
is thrown.
-
update
public void update()
Description copied from interface:WorkflowInterfaces.IUpdatable
Update the object (i.e. recalculate internal properties, sort tasks, ...)- Specified by:
update
in interfaceWorkflowInterfaces.IUpdatable
-
afterSaveObject
public void afterSaveObject()
Description copied from interface:LifecycleSaveAware
Called after an object is saved.- Specified by:
afterSaveObject
in interfaceLifecycleSaveAware
-
-