JAVA tools

JAVA tools

General remarks

  1. Click: The parts that require you to click with the mouse will be displayed in bold.

  2. Variables: When mentioning dynamic or non-fixed text items, [] will be used as a prompt, such as [User Name]

  3. Component: Every object in process design is commonly called a component.

  4. Field: generally refers to the interface that can be input. In this system, it also specifically refers to the input field in the form design.

  5. Tabs: paging options on the interface or window

  6. Block: refers to a collection of multiple fields, usually with a name at the top

  7. Order number: also called data_no, an order will only have one order number.

  8. Data number: also known as id / data_id. An order will have multiple ids. A new id will be generated every time an order is pushed.

Preface

This article mainly introduces how the JAVA Base system uses the omflow.jar package to create and access process data.

Class: com.syscomgo.omflow.java.Login

1.1 Obtain Token

Method: doLogin

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. user: User account with process permissions

  3. password: the user’s password

The data type returned is JSON Object and the format is as follows:

{
    status: boolean
    message: string (success or error message)
    token: string (token or empty)
}

1.2 Maintain Token

Method: keepToken

OMFLOW's API requires a token to confirm who is sending the request, and this token is time-sensitive. After the last request (including any request), if there is no request again for more than 5 minutes, the token will become invalid. Need Re-obtain Token. The purpose of this method is to maintain the validity of the Token with minimal resource consumption.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. token: Token obtained by doLogin

The data type returned is String (success or error message)

Class: com.syscomgo.omflow.java.Data

2.1 Open an order

Method: putData

The user fills in the form content and then sends it, allowing the data to be advanced according to the designed process until it encounters "manual processing" and then stops and waits for the next user to manually advance, or until it encounters "end" and closes the order.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. api_path: Specify the API path of the process

  3. token: Token obtained by doLogin

  4. obj.Form: Form object, see Chapter [3.4] for details

The data type returned is String, "order number" or error message

2.2 Push orders

Method: modData

After the user confirms the current form content and fills in the necessary information, the form execution process is pushed again.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. api_path: Specify the API path of the process

  3. data_id: Data number. Since the OMFLOW process has a "parallel" function, it may not be possible to accurately advance the form only by relying on the "single number"; in the data returned in the list, the value with the key id is data_id

  4. token: Token obtained by doLogin

  5. obj.Form: Form object, see Chapter [3.4] for details

The data type returned is String, "order number" or error message

2.3 Get information (list)

Method: getList

This method allows the user to obtain all the data that the process has currently opened.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. token: Token obtained by doLogin

  3. obj.query: Query object, see Chapter [3.1] for details

The data type returned is JSONArray and the format is as follows:

[
    {'id':1,'data_no':'value','formitm_1':'value','formitm_2':'value'},
    {'id':2,'data_no':'value','formitm_1':'value','formitm_2':'value'},
    ...
]

2.4 Obtain historical data of a specific order number

Method: loadHistory

From the time a form is created, every time it goes through "manual processing" and is pushed by the user, a "process" will be generated to record the content filled in by the user for future audits and other situations. This method allows users to obtain all "processes" for a specific order number in a specific process.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. token: Token obtained by doLogin

  3. api_path: Specify the API path of the process

  4. data_no: The order number to be queried

The data type returned is JSONArray and the format is as follows:

[
    {'id':1,'data_no':'value','formitm_1':'value','formitm_2':'value'},
    {'id':2,'data_no':'value','formitm_1':'value','formitm_2':'value'},
    ...
]

2.5 Delete order

Method: delData

This method allows users to delete an already created order, including the order's "history", attached files, etc.

The input parameters are as follows:

  1. URL: URL of the object OMFLOW Server, for example: https://omflow.com.tw

  2. api_path: Specify the API path of the process

  3. token: Token obtained by doLogin

  4. data_no: The input data type is ArrayList, and the order number to be deleted is placed in the List.

The data type returned is boolean

3 Appendix

Sections 1 and 2 describe the services that omflow.jar can provide, and this section will supplement some of the object formats required in the first two sections.

3.1 Query

Class: com.syscomgo.omflow.java.obj.Query

propertiesmethodinput typenote

api_path

setAPI

String

searchkey

setSearchkey

String

Perform fuzzy search for search_columns

search_columns

putColumn

com.syscomgo.omflow.java.obj.Column

search_conditions

putCondition

com.syscomgo.omflow.java.obj.Condition

order_columns

putOrderColumn

com.syscomgo.omflow.java.obj.Column

index

setIndex

Int

From which data to start

limit

setLimit

Int

fetch several pieces of data at a time

clear

toJSON

※ Only one of searchkey and search_conditions will take effect (search_conditions takes precedence)

OMFLOW version 1.1.6.3 features:

3.2 Condition

Class: com.syscomgo.omflow.java.obj.Condition

propertiesmethodinput typenote

name

setColumnName

String

oper

setOper

String

!=,=,>,<,in,contains

value

setValue

String

setValue

ArrayList

setValue

boolean

super

setSuper

boolean

toJSON

3.3 Column

Class: com.syscomgo.omflow.java.obj.Column

propertiesmethodinput typenote

name

setColumnName

String

is_query

getIsQuery

boolean

setStringValue returns False, setQueryValue returns True

value_string

setStringValue(String)

String

value_query

setQueryValue(query)

com.syscomgo.omflow.java.obj.query

is_text

setTextMode

boolean

default = true

3.4 Form

Class: com.syscomgo.omflow.java.obj.Form

| properties | method | input type | note | | ---------- | ----------- | -------------------- | ----- --------------- | | formdata | setForm | String, JSONObject | field name, field value | | | setForm | String, ArrayList | field name, field value | | | setForm | String, String | field name, field value | | | setForm | String, int | field name, field value | | | getFormData | | ArrayList |

Last updated