public class SystemAction extends Object
Constructor and Description |
---|
SystemAction() |
Modifier and Type | Method and Description |
---|---|
void |
addDocument(String origin,
String filepath,
String docpath)
Add a document to the process folder.
|
void |
addFolder(String name)
add a folder to the process.
|
void |
addSubform(String form,
String id)
Add a subform.
|
void |
autoTake()
This method performs a take when the activity instance is assigned to a role
and there is exactly one user having this role.
|
void |
cancelActivity(String name)
Cancel the activity: finishes the activity with the given task id
|
void |
cancelProcess()
Cancel the whole process.
|
Object |
evaluateXPath(String xpathExpression)
Evaluates the given XPath 1.0 expression.
|
void |
executeReport(String id,
String action,
String target)
Execute a report and store the result document.
|
void |
exportDocument(String docpath,
String filepath)
Copy a document form process folder to the file system.
|
void |
finishActivity(String label)
Finish a task, an andpar, orpar, or a parfor.
|
void |
fourEyesPrinciple(String stepLabel)
Check, if the current agent is not the agent of the step referenced by steplabel.
|
void |
fourEyesPrinciple(String stepLabel,
ActivityInstance ai)
Check, if the current agent is not the agent who did the last step instance of the step identified by the passed label.
|
Object |
getFormFieldValue(String formfield)
Returns the value of a formfield.
|
Object |
getPreviousAgent(String steplabel,
String defaultId)
Get the agent of a previous step (identified by its label).
|
Object |
getPreviousAgent(String steplabel,
String defaultId,
ActivityInstance ai) |
void |
httpGet(String urlstr,
String returnfield)
Make a get request to a HTTP URL.
|
void |
increasePriority(String offset)
Increase the priority with an offset.
|
boolean |
isActive(String task)
Returns true, if there is an active or idle or suspended activity instance in the
current process that has the task with the given id.
|
boolean |
isFalse()
Use as condition dummy, returns false.
|
boolean |
isStartAgent(String formfield)
This method returns true, if the formfield contains a user object and the
user is the start agent of the current process.
|
boolean |
isTrue()
Use as condition dummy, always returns true.
|
void |
join(String n,
String mode)
Expression in andjoin for implementing generalized andjoin.
|
boolean |
lock(String name)
Add a lock to the process instance.
|
boolean |
lockForCurrentTransaction(String name)
Add a lock to the process instance.
|
boolean |
log(String message,
String level)
Writes the argument on the log.
|
boolean |
manualIf() |
void |
nop()
Use as system step dummy, does nothing.
|
void |
parforJoin(String n,
String mode)
Expression in end parfor for implementing generalized parfor join.
|
boolean |
randomTrue(String percent)
Returns true randomly.
|
void |
sendMessage(String templateid)
Send a message using a pre-defined message template.
|
void |
setAgentFromField(String formfield)
Set the current agent from a form field.
|
void |
setDuedateFromField(String formfield)
Set the duedate of the current task to the value of the given form field.
|
void |
setFieldToAgent(String formfield)
Set a form field to the current user.
|
void |
setFieldToCurrentDate(String formfield)
Set a form field to the current date.
|
void |
setFieldToOU(String formfield)
Set a form field to the home org unit of agent
|
void |
setFieldToValue(String formfield,
String value)
Set a form field to specified value.
|
boolean |
setOUFromField(String formfield,
String forProcess)
Set the org-unit of the current activity and optionally the process (parent) of the activity from a form field.
|
void |
setProcessDuedateFromField(String formfield)
Set the duedate of the current process instance to the value of the given form field.
|
ProcessInstance |
startProcess(String id,
String orgUnit,
String form1,
String form2)
Start a process.
|
void |
suspend(String days)
Suspend the current activity instance.
|
boolean |
unlock(String name)
Removes the lock.
|
void |
untake()
Untake the task.
|
public boolean lock(String name)
unlock(String)
.name
- name of the lockpublic boolean unlock(String name)
name
- name of the lockpublic boolean lockForCurrentTransaction(String name)
name
- name of the lockpublic void cancelActivity(String name)
name
- the id of a taskpublic void cancelProcess()
public void autoTake() throws Exception
Exception
public boolean log(String message, String level)
message
- the messagelevel
- the log level: error, warn, info, debug, tracetrue
public void setFieldToAgent(String formfield)
formfield
- the form field: formid "." fieldamepublic void setFieldToOU(String formfield)
formfield
- the form field: formid "." fieldamepublic void setFieldToCurrentDate(String formfield)
formfield
- the form field: formid "." fieldamepublic Object getFormFieldValue(String formfield)
formfield
- in the syntax formid "." fieldnamepublic void setFieldToValue(String formfield, String value) throws Exception
formfield
- the form field: formid "." fieldameException
public boolean isStartAgent(String formfield)
formfield
- the form field in syntax: formid "." fieldamepublic boolean isActive(String task)
task
- the id of a task objectpublic void join(String n, String mode)
n
- number of branches that must be completedmode
- either cancel or none. every other value is taken as nonepublic void parforJoin(String n, String mode)
n
- number of branches that must be completedmode
- either cancel or none. every other value is taken as nonepublic void finishActivity(String label)
label
- the label of a steppublic void setAgentFromField(String formfield)
formfield
- the form field: formid "." fieldamepublic boolean isTrue()
public boolean isFalse()
public void nop()
public boolean manualIf()
public Object evaluateXPath(String xpathExpression)
xpathExpression
- public void increasePriority(String offset)
public void untake()
public void setDuedateFromField(String formfield) throws Exception
Exception
public void setProcessDuedateFromField(String formfield) throws Exception
Exception
public void fourEyesPrinciple(String stepLabel)
stepLabel
- the label of the step to checkpublic void fourEyesPrinciple(String stepLabel, ActivityInstance ai)
stepLabel
- the label of the step to checkai
- the activity instance for which the check is performedpublic boolean setOUFromField(String formfield, String forProcess)
formfield
- the form field: formid "." fieldame containing an org-unitforProcess
- if value is true the org-unit of the parent of the activity-instance is also set to the given org-unitpublic boolean randomTrue(String percent)
percent
- either an integer number giving the percentage of true results or the name of a configuration
parameter defining the percentage.public void sendMessage(String templateid) throws Exception
templateid
- the id of the message templateException
public Object getPreviousAgent(String steplabel, String defaultId)
steplabel
- label of a step in the processdefaultId
- role or user idpublic Object getPreviousAgent(String steplabel, String defaultId, ActivityInstance ai)
public void httpGet(String urlstr, String returnfield) throws IOException
urlstr
- use substitutions like inreturnfield
- a form field to write the return valueIOException
public void addSubform(String form, String id) throws Exception
form
- id of the main formid
- id of the subform relation (parsed to an integer)Exception
public void suspend(String days)
public void executeReport(String id, String action, String target) throws Exception
id
- id of reportaction
- email, dms or filetarget
- message template, dms folder, or path.
if action is dms and no target is given, the target is the folder of the process instance.Exception
public ProcessInstance startProcess(String id, String orgUnit, String form1, String form2)
id
- the id of the process to startorgUnit
- the org-unit of the processform1
- a comma separated list of form fields of the current process: the values are copied to the respective fields in form2,
subforms can be copied by specifying <formid>.<subformid>form2
- a comma separated list of formfields of the new process, leave it empty if it is the same as form1public void exportDocument(String docpath, String filepath) throws Exception
docpath
- path to a document of the processfilepath
- path in filesystem (absolute or relative to ep directory).Exception
public void addDocument(String origin, String filepath, String docpath) throws Exception
origin
- dms or filefilepath
- path in filesystem or dms, see DMS.getDMSObject(String)
for syntax of pathdocpath
- path to the documentException
public void addFolder(String name)
name
- name of the folder@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.