These are the Java classes and methods which are available in the [Script Task]. There are Questetra-specific classes and Java standard classes.
BPMN icon:[Script Task]
1. Questetra-specific Classes
1-1. Class for retrieving/updating the Workflow platform
com.questetra.bpms.core.event.scripttask.WorkflowEngine
1-2. Class for retrieving the Workflow App definition (business process definition)
com.questetra.bpms.core.event.scripttask.WorkflowEngine
com.questetra.bpms.core.event.scripttask.ProcessDataDefinitionView
com.questetra.bpms.core.event.scripttask.SubDataDefinitionView
1-3. Class for retrieving/updating the properties of Processes flowing in a Workflow App
com.questetra.bpms.core.event.scripttask.ProcessInstanceView
1-4. Class for retrieving/updating business data stored in a Process that flows into a Workflow App
com.questetra.bpms.core.event.scripttask.WorkflowEngine
1-5. Class for retrieving a child Process
com.questetra.bpms.core.event.scripttask.ScriptTaskEngine
1-6. Class for manipulating Select-type data(SELECT, SELECT_SINGLE, SELECT_CHECKBOX)
com.questetra.bpms.core.event.scripttask.ItemView
com.questetra.bpms.core.event.scripttask.ItemDaoWrapper
1-7. Class for manipulating Datetime-type data(DATE, DATE_YMD, DATE_YM, DATE_Y, DATE_MD, DATETIME)
com.questetra.bpms.util.AddableDate
com.questetra.bpms.util.AddableTimestamp
com.questetra.bpms.core.event.scripttask.DateFormatWrapper
1-8. Class for manipulating User-type data(QUSER)
com.questetra.bpms.core.event.scripttask.QuserView
com.questetra.bpms.core.event.scripttask.QuserDaoWrapper
1-9. Class for manipulating Organization-type data(QGROUP)
com.questetra.bpms.core.event.scripttask.QgroupView
com.questetra.bpms.core.event.scripttask.QgroupDaoWrapper
1-10. Class for manipulating Roles(QROLE)
com.questetra.bpms.core.event.scripttask.QroleView
com.questetra.bpms.core.event.scripttask.QroleDaoWrapper
1-11. Class for manipulating Table-type data(LIST)
com.questetra.bpms.core.event.scripttask.ScriptListArray
com.questetra.bpms.core.event.scripttask.ScriptListArray.ScriptListRow
com.questetra.bpms.core.model.formdata.ListArray (deprecated: 2024-04) => ScriptListArray
com.questetra.bpms.core.model.formdata.ListArray.ListRow (deprecated: 2024-04) => ScriptListRow
1-12. Class for manipulating File-type data(FILE)
com.questetra.bpms.core.event.scripttask.QfileView
com.questetra.bpms.core.event.scripttask.NewQfile
com.questetra.bpms.core.event.scripttask.FileRepositoryWrapper
fileRepository sample (script for service task definition (Addon-XML))
1-13. Class for manipulating strings and collections
com.questetra.bpms.core.event.scripttask.Base64UtilsWrapper
com.questetra.bpms.core.event.scripttask.HexWrapper
com.questetra.bpms.core.event.scripttask.DigestUtilsWrapper
com.questetra.bpms.core.event.scripttask.RSAWrapper
com.questetra.bpms.core.event.scripttask.HmacUtilsWrapper
com.questetra.bpms.core.event.scripttask.Joiner
com.questetra.bpms.core.event.scripttask.StringEscapeUtilsWrapper
1-14. Class for manipulating XML
com.questetra.bpms.core.event.scripttask.XPathWrapper
com.questetra.bpms.core.event.scripttask.XPathWrapper.NodeWrapper
com.questetra.bpms.core.event.scripttask.XPathWrapper.NodeListWrapper
xpath sample (script for service task definition (Addon-XML))
1-15. Class for manipulating byte array
com.questetra.bpms.core.event.scripttask.ByteArrayWrapper
1-16. Class for controlling posting to Open Chat
com.questetra.bpms.core.event.scripttask.FeedServiceWrapper com.questetra.bpms.core.event.scripttask.FeedServiceWrapper.FeedMessageWrapper
feedService sample (Script for service task definition (Addon-XML))
1-17. Class for controlling HTTP communication
com.questetra.bpms.core.event.scripttask.HttpClientWrapper
com.questetra.bpms.core.event.scripttask.HttpClientWrapper.HttpRequestWrapper
com.questetra.bpms.core.event.scripttask.HttpClientWrapper.HttpResponseWrapper
com.questetra.bpms.core.event.scripttask.AuthSettingWrapper
authSetting sample (Script for service task definition (Addon-XML))
1-18. Class for controlling SMTP (Email) communication
com.questetra.bpms.core.event.scripttask.EmailServiceWrapper
com.questetra.bpms.core.event.scripttask.EmailServiceWrapper.EmailMessageWrapper
2. Classes that Retrieve Config values of a Service Task Definition (Add-on)
For scripts described in Service Task definition (Add-on) (M416)
Code example
const processId = configs.get( "conf_ProcessId" );
Type | Method (constructor) / Description |
---|---|
String | get(String configName) Returns the following string, depending on the form-type setting - TEXTFIELD, TEXTAREA: Returns the entered string or (If el-enabled = "true") the result of the EL expression being evaluated - SELECT: Returns the data definition number of the specified Data Item or (if editable = "true") the entered character string - SELECT_ITEM: Returns the value of the selected choice (item) - TOGGLE: Returns a boolean as a string ("true" or "false") - QUSER: Returns the user ID of the selected Quser - OAUTH2: Returns the settingName of the selected OAuth2 settings |
Object |
getObject(String configName) |
3. Java standard Classes
java.lang.String
java.lang.Long
java.lang.Math
java.util.ArrayList
java.util.Date
java.util.HashMap
java.util.Locale
java.util.regex.Pattern
java.util.regex.Matcher
java.math.BigDecimal
java.text.SimpleDateFormat
java.text.DecimalFormat
java.sql.Date
java.sql.Timestamp
Details of Questetra-specific Classes
com.questetra.bpms.core.event.scripttask.WorkflowEngine
Code example
const item = engine.findDataDefinitionByName( "Customer Name" );
Method for updating the Workflow platform
Type | Method (constructor) / Description |
---|---|
String | getTimeZoneId() Returns the time zone ID of the system |
int | getTimeZoneOffsetInMinutes() Returns the offset time of the system time zone in minutes |
void | log(String message) Outputs log messages to processing records |
Methods for retrieving the Workflow App definition
Type | Method (constructor) / Description |
---|---|
List<ProcessDataDefinitionView> | findDataDefinitions() Returns a list of Data Items |
ProcessDataDefinitionView | findDataDefinitionByName(String name) Returns the Data Item searched by name. If there are multiple Data Items with the same name, the first one is returned |
ProcessDataDefinitionView | findDataDefinitionByNumber(String dataDefNum) Returns the Data Item searched by definition number |
ProcessDataDefinitionView | findDataDefinitionByNumber(Long dataDefNum) Returns the Data Item searched by definition number |
ProcessDataDefinitionView | findDataDefinitionByVarName(String fieldName) Return the Data Item searched by field name |
Methods for retrieving/updating business data
Type | Method (constructor) / Description |
---|---|
Object |
findDataByVarName(String fieldName) Returns the object of the Data Item specified by the field name. (For the object type, see the description of findData()) |
Object |
findDataByName(String name) Returns the Data Item object specified by the Data Item Name. (For the object type, see the description of findData()) |
Object |
findDataByNumber(String dataDefNum) Returns the Data Item object specified by the data definition number. (For the object type, see the description of findData()) |
Object |
findDataByNumber(Long dataDefNum) Returns the Data Item object specified by the data definition number. (For the object type, see the description of findData()) |
Object |
findData(ProcessDataDefinitionView pocket) |
void | setDataByVarName(String fieldName, Object value) Assigns a value to a Data Item specified by a field name |
void | setDataByName(String name, Object value) Assigns a value to the Data Item specified by the Data Item name |
void | setDataByNumber(String dataDefNum, Object value) Assigns a value to the Data Item specified by the data definition number |
void | setDataByNumber(Long dataDefNum, Object value) Assigns a value to the Data Item specified by the data definition number |
void | setData(ProcessDataDefinitionView pocket, Object value) Assigns a value (data object) to a Data Item specified by a data definition object |
com.questetra.bpms.core.event.scripttask.ScriptTaskEngine
Code example
const childProcess = engine.findChildProcessInstance( "1234" );
Methods that reference Child Processes
Type | Method (constructor) / Description |
---|---|
ProcessInstanceView | findChildProcessInstance(String pid) Returns the child process specified by Process ID (Error when trying to access a Process other than a child Process) |
ProcessInstanceView | findChildProcessInstance(Long pid) Returns the child Process specified by Process ID (Error when trying to access a Process other than a child Process) |
Object or List<Object> | findChildDataByVarName(ProcessInstanceView childPi, String varName) Returns an object of the Data Item specified by field name from the specified child Process (Error when trying to access a Data Item that is not allowed to be referenced by the parent Process) (For object types, see the description of WorflowEngine.findData()) |
com.questetra.bpms.core.event.scripttask.ProcessDataDefinitionView
Type | Method (constructor) / Description |
---|---|
String | getName() Returns the Data Item name |
long | getNumber() Returns the Data Item number |
String | getVarName() Returns the field name |
List<SubDataDefinitionView> | getSubDataDefinitions() Returns a list of table items for Table-type cases |
ScriptListArray | createListArray() Creates an empty table (an empty ScriptListArray object) for Table-type cases |
boolean |
matchDataType(String dataType) dataType: data types that are true |
com.questetra.bpms.core.event.scripttask.SubDataDefinitionView
Type | Method (constructor) / Description |
---|---|
String | getName() Returns the table item name |
String | getVarName() Returns the field name of the table item. If the field name is undefined it returns null |
long | getNumber() Returns the table item number |
boolean |
matchDataType(String dataType) dataType: data types that are true |
com.questetra.bpms.core.event.scripttask.ProcessInstanceView
Code example
const appId = processInstance.getProcessModelInfoId();
Type | Method (constructor) / Description |
---|---|
Long | getProcessModelInfoId() Returns the App ID |
String | getProcessModelInfoName() Returns the App name |
String | getProcessModelInfoCategory() Returns App Category |
Long | getProcessModelVersion() Returns the version of the App with which the Process was started |
Long | getProcessInstanceId() Returns Process ID |
Long | getParentProcessInstanceId() Returns the Process ID of the parent Process |
String | getProcessInstanceState() Returns Process status - STARTED: Incomplete - ENDED: Finished - FAILED: Abnormal end |
String | getProcessInstanceTitle() Returns the Title of the Process |
QuserView | getProcessInstanceInitQuser() Returns Process Start User |
Long | getProcessInstanceInitQuserId() Returns Process Start User ID |
String | getProcessInstanceInitQuserName() Returns Process Start User Name |
QgroupView | getProcessInstanceInitQgroup() Returns Process Start Organization |
Long | getProcessInstanceInitQgroupId() Retrieves Process Start Organization ID |
String | getProcessInstanceInitQgroupName() Returns Process Start Organization Name |
AddableTimestamp | getProcessInstanceStartDatetime() Returns Process Start DateTime |
Long | getProcessInstanceSequenceNumber() Returns Process Sequence Number |
void | setProcessInstanceTitle(String title) Sets the Title of the Process |
boolean | getProcessInstanceDebug() Determines if the Process is a Debug process. |
com.questetra.bpms.core.event.scripttask.ItemView
Type | Method (constructor) / Description |
---|---|
String | getValue() Returns the option ID |
String | getDisplay() Return the choice labels |
com.questetra.bpms.core.event.scripttask.ItemDaoWrapper
Code example
const options = itemDao.findAll("customer_master.xml", true);
Type | Method (constructor) / Description |
---|---|
List<ItemView> | findAll(String fileName, boolean isSharedFile) Returns all choices of the specified choice master |
List<ItemView> | findAll(ProcessDataDefinitionView dataDef) Returns all choices in the specified Select-type Data Item (Error if the Type of data source is "Get choice list via HTTP") |
ItemView | findByValue(String fileName, boolean isSharedFile, String value) Returns a choice with a specific value (choice ID) from a specified choice master |
ItemView | findByValue(ProcessDataDefinitionView dataDef, String value) Returns a choice with a specific value (choice ID) in the specified Select-type Data Item (Error if the Type of data source is "Get choice list via HTTP") |
com.questetra.bpms.util.AddableDate
Type | Method (constructor) / Description |
---|---|
(AddableDate) | AddableDate() Returns the Date when called (year, month, day/YMD) |
(AddableDate) | AddableDate(long time) Returns the Date specified in milliseconds (time) since 1970-01-01 00:00:00 UTC (year, month, day/YMD) |
long |
getTime() The Date-type value "2022-12-31" in the workflow platform operating in JST (+09:00) will be converted to the difference between |
AddableDate | addDays(int days) Returns a Date adding the number of days specified (Specified a negative value, it will go back in time) |
AddableDate | addMonths(int months) Returns a Date adding the number of months specified (Specified a negative value, it will go back in time) |
AddableDate | getFirstDateInMonth() Returns the first day of the month |
AddableDate | getFirstTimeInMonth() *deprecated (2024-04) |
AddableDate | getLastDateInMonth() Returns the last day of the month. The day before the 1st of the next month |
AddableDate | getLastTimeInMonth() *deprecated (2024-04) |
AddableTimestamp | getFirstTimeInDate() Returns the first time of the day |
String | toString() Returns strings in the format according to date subtype - Y/M/D: yyyy-MM-dd - M/D: MM-dd - Y/M: yyyy-MM - Y: yyyy |
com.questetra.bpms.util.AddableTimestamp
Type | Method (constructor) / Description |
---|---|
(AddableTimestamp) | AddableTimestamp() Returns the Timestamp at the time of the call |
(AddableTimestamp) | AddableTimestamp(long time) Returns a Timestamp specified in milliseconds (time) since 1970-01-01 00:00:00 UTC |
long | getTime() Returns the number of milliseconds since 1970-01-01 00:00:00 UTC (Datetime-type values are interpreted as the time of the workflow platform's time zone) The Datetime value "2022-12-31 12:34" in a workflow platform operating in JST (+09:00) will be converted to the difference between |
AddableTimestamp | addMinutes(int minutes) Returns the Timestamp adding the specified minutes (Specified a negative value, it will go back in time) |
AddableTimestamp | addHours(int hours) Returns the Timestamp adding the specified hours (Specified a negative value, it will go back in time) |
AddableTimestamp | addDays(int days) Returns the Timestamp adding the specified days (Specified a negative value, it will go back in time) |
AddableTimestamp | addMonths(int months) Returns the Timestamp adding the specified months (Specified a negative value, it will go back in time) |
AddableTimestamp | getFirstTimeInDate() Returns the first time of the day |
AddableTimestamp | getFirstTimeInMonth() Returns the first time of the first day of the month (0:00:00, 0 ms of the 1st.) |
AddableTimestamp | getLastTimeInMonth() Returns the last time of the last day of the month (1 ms before the first day of the next month) |
String | toString() Returns strings in "yyyy-MM-dd HH:mm" format |
com.questetra.bpms.core.event.scripttask.DateFormatWrapper
Code example
const text = dateFormatter.format('GMT+0900', 'yyyyMMdd HHmmZ', myTime); const datetime = dateFormatter.parse('yyyy-MM-dd HH:mm', '2020-03-14 09:45');
Type | Method (constructor) / Description |
---|---|
String | format(String timeZone, String format, AddableTimestamp datetime) Returns a formatted string out of Datetime data by specifying a time zone |
String | format(String format, AddableTimestamp datetime) Returns a formatted string out of Datetime data |
String | format(String format, AddableDate date) Returns a formatted string out of Date data |
AddableTimestamp | parse(String format, String textDatetime) Parses a string in the specified format and returns a timestamp |
com.questetra.bpms.core.event.scripttask.QuserView
Type | Method (constructor) / Description |
---|---|
Long | getId() Returns User ID |
String | getName() Returns User Name |
String | getEmail() Returns User's email address |
boolean | isDeletedInFuture() Determine if it is scheduled for deletion |
com.questetra.bpms.core.event.scripttask.QuserDaoWrapper
Code example
const quser = quserDao.findByEmail( "ques@example.com" );
Type | Method (constructor) / Description |
---|---|
QuserView | findByEmail(String email) Returns QuserView object for the specified email address |
QuserView | findById(Long id) Returns QuserView object for the specified User ID |
List<QuserView> | findByQgroup(QgroupView qgroup) Returns list of QuserView object who belongs to an Organization |
List<QuserView> | findByQgroupAndPosition(QgroupView qgroup, boolean isLeader) Returns list of QuserView object who belongs to an Organization as Leader/Staff member |
List<QuserView> | findByQrole(QroleView qrole) Returns list of QuserView object who belongs to a specified Role |
com.questetra.bpms.core.event.scripttask.QgroupView
Type | Method (constructor) / Description |
---|---|
Long | getId() Returns Organization ID |
String | getName() Returns Organization Name |
String | getEmail() Returns Organization's email address |
boolean | isDeletedInFuture() Determine if it is scheduled for deletion |
com.questetra.bpms.core.event.scripttask.QgroupDaoWrapper
Code example
const qorg = qgroupDao.findById( 3 );
Type | Method (constructor) / Description |
---|---|
QgroupView | findById(Long id) Returns QgroupView object for the specified Organization ID |
QgroupView | findByName(String name) Returns QgroupView object for the specified Organization name |
QgroupView | findParentQgroup(QgroupView qgroup) Returns QgroupView object which is parent Organization of the specified Organization |
QgroupView | findPrimaryQgroup(QuserView quser) Returns QgroupView object which the specified User primarily belongs to |
List<QgroupView> | findByQuser(QuserView quser) Returns list of QgroupView object which the specified User belongs to |
List<QgropuView> | findByQuserAndPosition(QuserView quser, boolean isLeader) Returns list of QgroupView object which the specified User belongs to as Leader/Staff member |
com.questetra.bpms.core.event.scripttask.QroleView
Type | Method (constructor) / Description |
---|---|
Long | getId() Returns Role ID |
String | getName() Returns Role Name |
boolean | isDeletedInFuture() Determine if it is scheduled for deletion |
com.questetra.bpms.core.event.scripttask.QroleDaoWrapper
Code example
const qrole = qroleDao.findById( 2 );
Type | Method (constructor) / Description |
---|---|
QroleView | findById(Long id) Returns QroleView object for the specified Role ID |
QroleView | findByName(String name) Returns QroleView object for the specified Role name |
List<QroleView> | findByQuser(QuserView quser) Returns list of QroleView object which the specified User belongs to |
com.questetra.bpms.core.event.scripttask.ScriptListArray
Type | Method (constructor) / Description |
---|---|
String | get(int row_index, int col_index) Returns cell data - row_index : Row number 0-index - col_index : Column number 0-index String format - String-type: (entered character string) - Numeric-type: Standard format (period as decimal point, no thousands separator) - Select-type: Choice ID - Date-type: yyyy-mm-dd |
Object | getObject(int row_index, int col_index) Returns cell data object - row_index : Row number 0-index - col_index : Column number 0-index Object types - String-type: java.lang.String - Numeric-type: java.math.BigDecimal - Select-type: com.questetra.bpms.core.event.scripttask.ItemView - Date-type com.questetra.bpms.util.AddableDate |
Object | getObject(int row_index, String varName) Returns cell data object (See above for object types) |
ScriptListArray.ScriptListRow | getRow(int row_index) Returns the specified row |
List<ScriptListArray.ScriptListRow> | getRows() Returns all rows |
int | size() Returns the number of rows |
ScriptListArray.ScriptListRow | addRow() Appends an empty row |
void | setRows(List<ListArray.ListRow> rows) * deprecated (2024-04) |
void | addRow(ListArray.ListRow row) * deprecated (2024-04) Adds rows |
ScriptListArray.ScriptListRow | removeRow(int row_index) Deletes specified row |
ScriptListArray.ScriptListRow | getSummary() Returns the contents in the summary row at the end of table (Null if it does not exist) |
void | setSummary(ListArray.ListRow summary) * deprecated (2024-04) |
void | clearSummary(int col_index) * deprecated (2024-04) Initializes the content in the summary rows with blanks in the specified number of rows |
String | toXmlString() Returns table in XML string |
com.questetra.bpms.core.event.scripttask.ScriptListArray.ScriptListRow
Type | Method (constructor) / Description |
---|---|
String | get(String field_name) Returns column specified by field name String format - String-type: (entered character string) - Numeric-type: Standard format (period as decimal point, no thousands separator) - Select-type: Choice ID - Date-type: yyyy-mm-dd |
String | getCol(int col_index) Returns the specified column (String format same as get()) |
List<String> | getCols() Returns all columns (String format same as get()) |
Object | getObject(int col_index) Returns column data object in the specified column - col_index: Column number 0-index Object type - String-type: java.lang.String - Numeric-type: java.math.BigDecimal - Select-type: com.questetra.bpms.core.event.scripttask.ItemView - Date-type: com.questetra.bpms.util.AddableDate |
Object | getObject(String field_name) Returns column data object specified by field name (See above for object types) |
int | size() Returns the number of columns |
void | setCols(List<String> cell_strings) * deprecated (2024-04) Overwrites all columns |
void | addCol(String cell_string) * deprecated (2024-04) Adds columns |
String | put(String field_name, String cell_string) Overwrites the column specified by field name, then retrieves the previous value String (cell_string) format - String-type: (entered character string) - Numeric-type: Standard format (period as decimal point, no thousands separator) - Select-type: Choice ID - Date-type: yyyy-mm-dd |
void | setCol(int col_index, String cell_string) * deprecated (2024-04) Overwrites the specified column String (cell_string) format - String-type: (entered character string) - Numeric-type: Standard format (period as decimal point, no thousands separator) - Select-type: Choice ID - Date-type: yyyy-mm-dd |
com.questetra.bpms.core.event.scripttask.QfileView
Type | Method (constructor) / Description |
---|---|
String | getName() Returns File Name |
Long | getLength() Returns File size |
String | getContentType() Returns the Content-Type of the File |
String | getCharset() Returns only the charset value among the values retrieved by getContentType() |
com.questetra.bpms.core.event.scripttask.NewQfile
Type | Method (constructor) / Description |
---|---|
(NewQfile) | NewQfile(String fileName, String contentType, String text) Save text data as a file by specifying Content-Type |
(NewQfile) | NewQfile(String fileName, String contentType, String charset, String text) Save text data as a file by specifying Content-Type and character code (charset) |
(NewQfile) | NewQfile(String fileName, String contentType, ByteArrayWrapper data) Saves the binary data as it is |
(NewQfile) | NewQfile(String fileName, String contentType, QfileView copyFrom) Duplicates and saves file data as it is |
String | getName() Returns File Name |
Long | getLength() Returns File size |
String | getContentType() Return the Content-Type of the file |
String | getCharset() Returns only the charset value among the values retrieved by getContentType() |
com.questetra.bpms.core.event.scripttask.FileRepositoryWrapper
Code example
fileRepository.readFile(file, "UTF-8", function(line) { text += line + '\n'; });
Type | Method (constructor) / Description |
---|---|
String | readFile(QfileView file, String encoding) Reads text files with specified character encoding (The size of the file that can be read is limited to 1MB) |
void | readFile(QfileView file, String encoding, java.util.function.Consumer<String> function) Reads a text file with the specified character code and passes it line by line to the specified function (For text files with 10 lines, the function is called 10 times) |
ByteArrayWrapper | readFile(QfileView file) Reads files as a byte array (The size of the file that can be read is limited to 1MB) |
void | readFile(QfileView file, int size, java.util.function.Consumer<ByteArrayWrapper> function) Reads the file as a byte array of a specified size and passes it to a specified function |
com.questetra.bpms.core.event.scripttask.Base64UtilsWrapper
Code example
const base64Str = base64.encodeToString( "Email subject" );
Type | Method (constructor) / Description |
---|---|
String | encodeToString(ByteArrayWrapper bytes) Encodes Base64 (RFC 4648) |
String | encodeToString(String src) Encodes Base64 as UTF-8 characters (RFC 4648) |
String | encodeToUrlSafeString(String src) Encodes Base64 as UTF-8 characters (RFC 4648: URL and Filename Safe Alphabet) (Uses "-" "_" instead of "+" "/") |
String | decodeFromString(String src) Decodes Base64 into UTF-8 characters (RFC 4648) |
String | decodeFromUrlSafeString(String src) Decodes Base64 into UTF-8 characters (RFC 4648: URL and Filename Safe Alphabet) (Uses "-" "_" instead of "+" "/") |
ByteArrayWrapper | decodeFromUrlSafeStringToByteArray(String src) Decodes Base64 into binary data (RFC 4648: URL and Filename Safe Alphabet) (Uses "-" "_" instead of "+" "/") |
com.questetra.bpms.core.event.scripttask.HexWrapper
Code example
const file = q_file.get(0); const md5_hex = hex.encodeToString(digest.md5(file)); // Outputs MD5 hash in hexadecimal
Type | Method (constructor) / Description |
---|---|
String | encodeToString(ByteArrayWrapper bytes) Outputs in hexadecimal |
com.questetra.bpms.core.event.scripttask.RSAWrapper
Code example
const privateKeyPem = `-----BEGIN PRIVATE KEY----- (Base64 encoded private key) -----END PRIVATE KEY-----`; // Read private key const privateKey = rsa.readKeyFromPkcs8(privateKeyPem); // Signature const sign = rsa.signRsa256(privateKey, 'hogehoge'); // Base64 encode const signString = base64.encodeToString(sign);
Type | Method (constructor) / Description |
---|---|
PrivateKeyWrapper | readKeyFromPkcs8(String privateKeyPem) Readd private key in KCS#8 format |
ByteArrayWrapper | signRsa256(PrivateKeyWrapper privateKey, String text) Sign with SA-SHA256 |
com.questetra.bpms.core.event.scripttask.PrivateKeyWrapper
Private key object class
com.questetra.bpms.core.event.scripttask.HmacUtilsWrapper
Code example
const key = engine.findDataByVarName('q_HMAC_key'); const text = engine.findDataByVarName('q_HMAC_text'); const hash = hex.encodeToString(hmac.sha256(key, text));
Type | Method (constructor) / Description |
---|---|
ByteArrayWrapper | sha256(String key, String text) Calculate the authentication code with HMAC-SHA256 |
com.questetra.bpms.core.event.scripttask.DigestUtilsWrapper
Code example
const file = q_file.get(0); const md5_hex = hex.encodeToString(digest.md5(file)); // Outputs MD5 hash in hexadecimal const sha256_base64 = base64.encodeToString(digest.sha256(file)); // Outputs SHA256 hash in Base64
Type | Method (constructor) / Description |
---|---|
ByteArrayWrapper | md5(ByteArrayWrapper bytes) Calculates the MD5 hash value |
ByteArrayWrapper | md5(QfileView qfile) Calculate the MD5 hash value |
ByteArrayWrapper | sha1(ByteArrayWrapper bytes) Calculates the SHA1 hash value |
ByteArrayWrapper | sha1(QfileView qfile) Calculates the SHA1 hash value |
ByteArrayWrapper | sha256(ByteArrayWrapper bytes) Calculates the SHA256 hash value |
ByteArrayWrapper | sha256(QfileView qfile) Calculates the SHA256 hash value |
ByteArrayWrapper | sha384(ByteArrayWrapper bytes) Calculates the SHA384 hash value |
ByteArrayWrapper | sha384(QfileView qfile) Calculates the SHA384 hash value |
ByteArrayWrapper | sha512(ByteArrayWrapper bytes) Calculates the SHA512 hash value |
ByteArrayWrapper | sha512(QfileView qfile) Calculates the SHA512 hash value |
com.questetra.bpms.core.event.scripttask.Joiner
Code example
const selects = engine.findDataByVarName("q_checkbox"); // Select-type (Checkbox) let text = joiner.join(selects, ', ', select => `${select.value}:${select.display}`);
Type | Method (constructor) / Description |
---|---|
String | join(Collection collection, String prefix, String suffix, String joiner, Function<Object, String> converter) Concatenates collections by specifying a Prefix/Suffix/Joiner |
String | join(Collection collection, String prefix, String suffix, Function<Object, String> converter) Concatenates collections by specifying a Prefix/Suffix |
String | join(Collection collection, String joiner, Function<Object, String> converter) Concatenates collections by specifying a Joiner |
String | splitJoin(String lines, String prefix, String suffix, String joiner) Splits a multi-line string into individual lines and concatenates them by specifying a Prefix/Suffix/Joiner |
String | splitJoin(String lines, String prefix, String suffix) Splits a multi-line string into individual lines and reconnects them by specifying a Prefix / Suffix |
String | splitJoin(String lines, String joiner) Splits a multi-line string into individual lines and concatenates them by specifying a Joiner |
com.questetra.bpms.core.event.scripttask.StringEscapeUtilsWrapper
Code example
text = escaper.escapeHtml(text);
Type | Method (constructor) / Description |
---|---|
String | escapeEcmaScript(String input) Escape for EcmaScript |
String | escapeJson(String input) Escape for JSON |
String | escapeHtml(String input) Escape for HTML |
String | escapeXml(String input) Escape for XML |
com.questetra.bpms.core.event.scripttask.XPathWrapper
Code example
const xmltext = '<sales vendor="John">' + '<merchandise type="Orange" price="4" quantity="6"/>' + '<merchandise type="Apple" price="3" quantity="10"/>' + '<merchandise type="Peach" price="5" quantity="3"/>' + '</sales>'; const nodeList = xpath.findNodeList(xmltext, '/sales/merchandise');
Type | Method (constructor) / Description |
---|---|
NodeWrapper | findNode(NodeWrapper node, String xpathText) Returns a DOM Node matching XPath expression from Node |
NodeWrapper | findNode(String xml, String xpathText) Returns a DOM Node matching the XPath expression from XML |
NodeListWrapper | findNodeList(NodeWrapper node, String xpathText) Returns a list of DOM Nodes matching the XPath expression from Node |
NodeListWrapper | findNodeList(String xml, String xpathText) Returns a list of DOM Nodes matching the XPath expression from XML |
String | findNodeText(NodeWrapper node, String xpathText) Returns the DOM Node that matches the XPath expression from Node and returns its text |
String | findNodeText(String xml, String xpathText) Returns the DOM Node matching the XPath expression from XML and return its text |
com.questetra.bpms.core.event.scripttask.XPathWrapper.NodeWrapper
Type | Method (constructor) / Description |
---|---|
String | getNodeName() Returns node name |
String | getNodeValue() Returns node value |
short | getNodeType() Returns node type |
NodeWrapper | getParentNode() Returns parent node |
NodeListWrapper | getChildNodes() Returns a list of child nodes |
NodeWrapper | getFirstChild() Returns the first child node |
NodeWrapper | getLastChild() Returns the last child node |
NodeWrapper | getPreviousSibling() Returns the previous node |
NodeWrapper | getNextSibling() Returns the next node |
boolean | hasChildNodes() Determines if it has child nodes |
String | getNamespaceURI() Returns a namespace URI |
String | getPrefix() Returns a namespace prefix |
String | getLocalName() Returns the local part of the qualified name of a node |
boolean | hasAttributes() Determines if it has attributes |
String | getBaseURI() Returns the absolute base URI of a node |
String | getTextContent() Returns the text content of the specified node and descendants of the node |
com.questetra.bpms.core.event.scripttask.XPathWrapper.NodeListWrapper
Type | Method (constructor) / Description |
---|---|
int | getLength() Return the length of the node list |
NodeWrapper | item(int N) Returns the Nth item |
com.questetra.bpms.core.event.scripttask.ByteArrayWrapper
Type | Method (constructor) / Description |
---|---|
int | getLength() Returns the length of a byte array |
com.questetra.bpms.core.event.scripttask.FeedServiceWrapper
Code example
feedService.begin() .setMessage( "Post message" ) .post();
Type | Method (constructor) / Description |
---|---|
FeedMessageWrapper | begin() Creates a post message |
int | getPostingLimit() Returns the maximum number of message posts |
com.questetra.bpms.core.event.scripttask.FeedServiceWrapper.FeedMessageWrapper
Type | Method (constructor) / Description |
---|---|
FeedMessageWrapper | setMessage(String message) Sets message body |
FeedMessageWrapper | setShareQgroup(QgroupView qgroup) Sets a shared scope Organization |
FeedMessageWrapper | attachFile(QfileView file) Attaches a File (up to 100MB) |
FeedMessageWrapper | attachLink(String url) Attaches a hyperlink (does not retrieve the title by accessing the Web site) |
Long | post() Posts message |
com.questetra.bpms.core.event.scripttask.HttpClientWrapper
Code example
const httpLimit = httpClient.getRequestingLimit();
Type | Method (constructor) / Description |
---|---|
HttpRequestWrapper | begin() Creates an HTTP Request |
AuthSettingWrapper | findAuthSetting(String authSettingName, boolean sharedOrNot) Returns [HTTP Authorization Setting] object |
String | getOAuth2Token(String authSettingName) * deprecated (2026-04) * Use getOAuth2Token(AuthSettingWrapper authSetting)() Returns Token by referring to [HTTP Authorization Setting] - [OAuth2]: Retruns saved Access Token. If the Access Token has expired / has not been acquired, gets a new Access Token from the Authorization Server and returns the Token. - [Token Fixed Value]: Return {Entered String} ("Fixed token value", "API key", etc) - [Basic Authentication]: Error |
String | getOAuth2Token(AuthSettingWrapper authSetting) Returns Token by referring to [HTTP Authorization Setting] - [OAuth2] [OAuth2 Client Credentials Grant Type]: Retruns saved Access Token. If the Access Token has expired / has not been acquired, gets a new Access Token from the Authorization Server and returns the Token. - [Token Fixed Value]: Return {Entered String} ("Fixed token value", "API key", etc) - [Basic Authentication]: Error |
String | getGoogleOAuth2Token(QuserView quser, String serviceName) * deprecated (2024-04) * Use HttpRequestWrapper.googleOAuth2() Acquires the OAuth2 Access Token by referring to the authentication settings for Google connectivity by each User serviceName: "Drive", "Calendar" |
int | getRequestingLimit() Returns the maximum number of HTTP Requests |
com.questetra.bpms.core.event.scripttask.HttpClientWrapper.HttpRequestWrapper
Type | Method (constructor) / Description |
---|---|
HttpRequestWrapper | queryParam(String name, String value) Adds text parameters to a query (on top of the URL encoding) |
HttpRequestWrapper | authSetting(String authSettingName) * deprecated (2026-04) * Use authSetting(AuthSettingWrapper authSetting) Adds Authorization header by referring to [HTTP Authorization Setting] - [OAuth2]: "Authorization: Bearer {managed AccessToken}" - [Token Fixed Value]: "Authorization: Bearer {string you entered}" - [Basic Authentication]: "Authorization: Basic {base64 encoded USR:PASSWORD}" |
HttpRequestWrapper | authSetting(AuthSettingWrapper authSetting) Adds Authorization header by referring to [HTTP Authorization Setting] - [OAuth2] [OAuth2 Client Credentials Grant Type]: "Authorization: Bearer {managed AccessToken}" - [Token Fixed Value]: "Authorization: Bearer {string you entered}" - [Basic Authentication]: "Authorization: Basic{base64 encoded USR:PASSWORD}" |
HttpRequestWrapper | googleOAuth2(QuserView quser, String serviceName) Adds an Authorization header by referring to the authentication settings for [Google Connectivity] by specified User serviceName: "Drive", "Calendar" |
HttpRequestWrapper | basic(String userName, String password) * deprecated (2024-04) Adds Basic Authentication to the header |
HttpRequestWrapper | bearer(String token) Adds Bearer Authentication to the header |
HttpRequestWrapper | header(String name, String value) Adds a custom header to the header (Custom HTTP headers that can be added [R2253]) |
boolean | containsHeader(String name) Determine if the specified header has already been set in the request |
HttpRequestWrapper | body() Set the body part empty (without Content-Type) |
HttpRequestWrapper | body(QfileView file) Sets file in the body |
HttpRequestWrapper | body(QfileView file, String contentType) Sets file in the body by specifying Content-Type |
HttpRequestWrapper | body(String content, String contentType) Sets text in the body by specifying Content-Type |
HttpRequestWrapper | body(ByteArrayWrapper content, String contentType) Sets binary data in the body by specifying Content-Type |
HttpRequestWrapper | formParam(String name, String value) Adds text parameters to the body (application/x-www-form-urlencoded) |
HttpRequestWrapper | multipart(String name, String value) Adds text parameters to the body (multipart/form-data) |
HttpRequestWrapper | multipart(String name, QfileView file) Adds file data to the body (multipart/form-data) |
HttpRequestWrapper | multipart(String name, String fileContent, String contentType, String fileName) Adds file data to the body after converting text data to character code (multipart/form-data) |
HttpResponseWrapper | get(String url) Sends GET request |
HttpResponseWrapper | post(String url) Sends POST request |
HttpResponseWrapper | patch(String url) Sends PATCH request |
HttpResponseWrapper | put(String url) Sends PUT request |
HttpResponseWrapper | delete(String url) Sends DELETE request |
- A "Questetra-Pid" header (the value is a numeric process ID) is always added when sending HTTP requests
- For debugging processes, a "Questetra-Debug: true" header is added
- If a value is explicitly specified, such as header("Questetra-Debug", "false"), it takes precedence
com.questetra.bpms.core.event.scripttask.HttpClientWrapper.HttpResponseWrapper
Type | Method (constructor) / Description |
---|---|
int | getStatusCode() Returns the status code of the HTTP response |
ByteArrayWrapper | getResponse() Returns HTTP responses as binary data |
String | getResponseAsString() Returns HTTP responses as a string |
String | getContentType() Returns the content type of the HTTP response |
String | getCharset() Returns the character code of the HTTP Response |
List<String> | getHeaderNames() Returns a list of HTTP response headers |
List<String> | getHeaderValues(String headerName) Returns a list of the values of specified headers in the HTTP response |
com.questetra.bpms.core.event.scripttask.AuthSettingWrapper
Type | Method (constructor) / Description |
---|---|
String | getName() Returns [HTTP Authorization Setting] name |
String | getAuthorizationCodeRequestUrl() Returns the value set in Authorization Endpoint URL of [HTTP Authorization Setting] (Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getAccessTokenRequestUrl() Returns the value set in Token Endpoint URL of [HTTP Authorization Setting] (Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getScope() Returns the value set in Scope of [HTTP Authorization Setting] (Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getClientId() Returns the value set in Client ID of [HTTP Authorization Setting] (Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getClientSecret() Returns the value set in Client Secret of [HTTP Authorization Setting] (Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getToken() Returns the value of Token in [HTTP Authorization Setting] (Only for Token Fixed Value. Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getBasicUserName() Returns the value set in User Name of [HTTP Authorization Setting] (Only for Basic Authorization. Error if the HTTP authentication setting does not have the corresponding setting item) |
String | getBasicPassword() Returns the value set in Password of [HTTP Authorization Setting] (Only for Basic Authorization. Error if the HTTP authentication setting does not have the corresponding setting item) |
com.questetra.bpms.core.event.scripttask.EmailServiceWrapper
Code example
emailService.begin() .addTo("yamada@example.com", "YAMADA") .setSubject("Email subject") .setBody( mail_body ) .send();
Type | Method (constructor) / Description |
---|---|
EmailMessageWrapper | begin() Creates an email message |
int | getSendingLimit() Returns the maximum number of emails sent |
com.questetra.bpms.core.event.scripttask.EmailServiceWrapper.EmailMessageWrapper
Type | Method (constructor) / Description |
---|---|
EmailMessageWrapper | addTo(String emailAddress, String fullName) Adds the To address |
EmailMessageWrapper | addCc(String emailAddress, String fullName) Adds the Cc address |
EmailMessageWrapper | addBcc(String emailAddress, String fullName) Adds the Bcc address |
EmailMessageWrapper | setFrom(String emailAddress, String fullName) Sets the From address |
EmailMessageWrapper | setReplyTo(String emailAddress, String fullName) Sets the ReplyTo address |
EmailMessageWrapper | setSubject(String subject) Sets the email subject |
EmailMessageWrapper | setBody(String body) Sets the email body, same as setTextBody() |
EmailMessageWrapper | setTextBody(String textBody) Sets the email body text |
EmailMessageWrapper | setHtmlBody(String htmlBody) Sets the email body in HTML |
EmailMessageWrapper | addAttachment(QfileView qfile) Adds an attachment(up to 5MB) |
EmailMessageWrapper | addAttachment(String fileName, String contentType, String fileContent) Converts text data to character code and attaches the data as a file |
void | send() Sends email |
- Set either setTextBody () or setHtmlBody (). If both are missing it will result in an error.
- If both setTextBody() and setHtmlBody() are set, it will be a multipart/alternative mail.
- It is not possible to embed inline images in an HTML mail.
- In addAttachment(), if Content-Type contains Java's own charset, charset is omitted
- For example: text/plain; charset=x-UTF-16LE-BOM
Comments
0 comments
Article is closed for comments.