Related Topics
ProcessTask Class
This object represents a Process Task.
Properties
The ProcessTask Class is the base class for the WorkflowStep and ProjectActivity classes. It implements the following properties.
PROPERTY NAME | DATA TYPE | DESCRIPTION |
---|---|---|
PROCID | String | The ID of the process |
ID | String | The ID of the current Process Task |
TASKID | String | The ID of the Process Task |
Name | String | The name of the Process Task |
Instructions | String | The instructions for users in this Process Task |
Description | String | The description of this Process Task |
PROCINSTID | String | The ID of the process instance |
TASKINSTID | String | The ID of the Process Task instance |
ProcessInstance | Process Instance Object | The Process class for the Process Task |
Users | List Object | The list of ProcessTaskUser representing the users in this Process Task, returned as List<Users> |
Status | Integer | The status of the step, specified in the nStatus field of tblProjectInstance. Please see the table definition of tblProjectInstance for status codes. |
ReAuthenticate | Boolean | Boolean indicating whether reauthorization is required for this process task. |
Start | DateTime | The time the Timeline Activity started |
End | DateTime | The time the Timeline Activity ended |
Due | DateTime | The time the Timeline Activity is due |
ShowSignatureComments | Boolean | Boolean indicating whether signature comments are required to complete this process task. |
AllowEmailComplete | Boolean | Boolean indicating whether this process task can be completed by email |
BaseForm | For Object | The base Form used by this Process Task |
InstID | String | The ID of the Process Task instance |
EndReason | Integer | The reason the Process task was terminated. Please see the Classes topic for a list of termination reasons and their associated integer code. |
Duration | Timespan | The duration of the Process task |
Results | List Object | Returns a List object containing the Process task results, returned as a List<String> |
Methods
This API will add users to a Process Task. This method can be declared using the following overloads:
public bool AddUsersToTask(params User[] pUsers)
public bool AddUsersToTask(IEnumerable<User> pUsers)
public bool AddUsersToTask(string pUIDList)
Parameters
pUsers: A list of IEnumerable<User> or params objects to add.
pUIDList: A string of UIDs to add (separated by commas).
Returns
Boolean: True if the operation succeeds.
Example
// Add the process initiator to the current Process Step
bool bAddUsers =
CurrentProcessTask.AddUsersToTask(CurrentProject.Initiator);
This API will set the message property of the Process Task.
Parameters
CancelUID: A string containing the UID of the user for whom to cancel the Process Task.
CancelComments: An string value containing the cancellation comments.
Returns
Boolean: True if the operation succeeds.
Example
// Set the message of the Process Task
bool bCancel = CurrentProcessTask.CancelTask("USERUID",
"This is unnecessary");
This API will get a Process Task instance object from the specified ID.
Parameters
BP: The bp environment.
TASKINSTID: The ID of the Process Task instance to retrieve.
Returns
ProcessTask: Will return null if Process Task isn't found.
Example
// Normally not used directly
var oTaskInst = ProcessTask.GetProcessTaskByTASKINSTID( bp, "TASKINSTID" );
This API will get a Process Task definition object from the specified ID.
Parameters
BP: The bp environment.
TASKID: The ID of the Process Task to retrieve.
Returns
ProcessTask: Will return null if Process Task isn't found.
Example
// Normally not used directly
var oTaskDef = ProcessTask.GetProcessTaskByTASKID( bp, "TASKID" );
This API will return a list of Process Tasks for a specified process when given a Process ID as a parameter.
Parameters
BP: The BP Logix environment.
pRID: The Process ID of the Process to retrieve.
Returns
List<ProcessTask>: A list object of the Tasks in the specified Process, or null if not found.
Example
// Normally not used directly
var oTasks = ProcessTask.GetProcessTasksByPRID( bp, "PRID" );
This API will get a Process Task object from the specified Name.
Parameters
BP: The BP Logix environment.
Process: The Process object.
TaskName: The name of the Task to get.
Returns
ProcessTask: Will return null if Process Task isn't found.
Example
var oObject = Project.GetProcessByID(bp, "PRID" );
var oTask =
ProcessTask.GetTaskByName( bp, oObject , "Approve Doc" );
This API will remove users from a process task. This is an overloaded method with the following possible declarations:
public bool RemoveUsersFromTask(params User[] pUsers)
public bool RemoveUsersFromTask(IEnumerable<User> pUsers)
public bool RemoveUsersFromTask(string pUIDList)
Parameters
pUsers: A list of IEnumerable<User> or params objects to add.
UIDList: A string of UIDs to add (separated by commas).
Returns
Boolean: True if operation succeeds.
Example
// Remove the process initiator from the current Activity
CurrentProjectActivity.RemoveUsersFromTask(CurrentProject.Initiator);
This API will resend the task email to all task users.
Parameters
UIDAdmin: Optional string parameter of the user you want to associate with the resend in the audit logs.
Comments: The optional string comments for a completed task.
Returns
ProcessTask: The ProcessTask object or null if the operation fails.
Example
ProcessTask.ResendTaskEmails("UIDAdmin", "Comments");
This API will restart a specified task. This is an overloaded method with the following possible declarations:
public bool Restart()
public bool Restart(string UID, string Comments)
Parameters
UID: The UID string value of the user for whom the task should be restarted.Comments: A string containing comments to append to the task that is restarted.
Returns
Returns 'true" if the operation succeeds.
Example
// Restart the Process Task
bool bRestart = CurrentProcessTask.Restart();
This API will set the Duration of a Timeline-based Process Task.
Parameters
SECONDS: The number of seconds to set the duration to. Set to 0 to have the system automatically calculate the duration.
Returns
Boolean: True if the operation succeeds.
Example
// Set duration of current Activity
CurrentProjectActivity.SetDuration(10000);
This API will set the message property of the Process Task. This is an overloaded method with the following possible declarations:
public bool SetError(string pFormat, params object[] pParams)
public bool SetError(string strError, bool prepend)
Parameters
pFormat: A format string for the error message.
pParams: An params object containing a list of message parameters.
strError: A string value containing the error message to apply to the Process Task.
Prepend: A Boolean value signifying whether the error message should be prepended to an existing message, or replace the existing message.
Returns
Boolean: True if the operation succeeds.
Example
// Set the error message to display
bool bError = CurrentProcessTask.SetError("Error Message", true);
This API will set the message property of the Process Task. This is an overloaded method with the following possible declarations:
public bool SetMessage(string pFormat, params object[] pParams)
public bool SetMessage(string strMessage, bool prepend)
Parameters
pFormat: A formatting string.
pParams: A paramsobject containing a list of message parameters.
strMessage: A string value containing the message to apply to the Process Task.
Prepend: A Boolean value determining whether the message should be prepended to an existing message, or replace the existing message.
Returns
Boolean: True if the operation succeeds.
Example
// Set the message of the Process Task
bool bMessage = CurrentProcessTask.SetMessage("Message text", true);
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.