Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

问题

Using multiapproval [Multiple Approval 使用多人审批 [多重审批 v2 (Thread safe)] while having forms in both parent and child process. You have 2 different processes while subprocess approve doesnt contain any row in database, so it can't be linked with datalist inbox only with inbox as in example, which takes data only from SHKAssignmentsTable, without any data from forms.

Motivation

You can simply use INBOX in userview, but this gives absolutely no info to users, I wanted to give them all relevant informations which were provided in apply, while retain opportunity to run actions for both processes from one datalist.

 

Solution

1.Create row in DB

Create new tool in process Apply

Image Removed

线程安全)] 同时在父进程和子进程中都有表单。你有2个不同的进程,而子进程批准 不包含数据库中的任何行,所以它不能与仅包含收件箱的数据收件箱链接,如示例中所示,它仅从SHKAssignmentsTable获取数据,而没有来自表单的任何数据

动机

你可以简单地在用户视图中使用INBOX,但是这不会给用户提供任何信息,我想给他们提供所有在应用程序中提供的相关信息,同时保留从一个数据列表为两个进程运行动作的机会。

 

解决

1.在DB中创建行

在申请中创建新工具

Image Added

使用预设表单数据工具集ID用于审批表单,这会导致在表中创建具有正确进程ID的行(该数据列表收件箱用于通过SHKAssignmentsTable配对分配)。在字段ID中,我们分配#assignment.processId#,用于审批表单。Using Preset Form Data Tool set ID for Approval Form, which leads to creating row in table with correct process ID (which datalist inbox uses for pairing with assignments through SHKAssignmentsTable ). Into field ID we assign #assignment.processId#, for Approval Form.

  

Ignore "Multi User Approval Form" it is my application with different names, there should be Form linked to Approval.忽略“多用户审批表”,这是我申请的不同的名称,应该有表格链接到审批。

 

2.

...

存储childIDs

在主流程(应用)中的表单应用添加隐藏的字段childIDs,所以JW在表中创建此列。

将以下行添加到生成批准工具中。这将把所有的子进程ID保存到childIDs列中,这样我们就可以为datalist收件箱引用。

In main Process (Apply) in form Apply add hidden field childIDs so JW creates this column in table.

Add following lines into Generate Approvals Tool. This will save all child process ID's into childIDs column so we can have reference for datalist inbox.

Code Block
languagejava
themeDJango
Connection con = null;
try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jwdb?characterEncoding=UTF-8", "root", "/////////////");
    if (!con.isClosed()) {
        String sql = "UPDATE jwdb.app_fd_multiApproval_applications SET c_childIDs = ? WHERE id = ?";
        PreparedStatement stmt = con.prepareStatement(sql);
        String concated = approvalInstanceIds.substring(0, approvalInstanceIds.length() - 1); //cut out last ","
        stmt.setString(1, concated);
        stmt.setString(2, "#assignment.processId#");
        stmt.execute();
    }
} catch (Exception ex) {
    System.err.println("Exception: " + ex.getMessage());
} finally {
    try {
        if (con != null)
            con.close();
    } catch (SQLException e) {
        System.err.println("Exception: " + ex.getMessage());
    }
} 

 

3.

...

创建数据列表任务箱 

数据绑定器:JDBCdata binder: JDBC

setup connection to JWDB建立与jwdb的连接

 

 

Now write your own query to UNION data of this 2 processes.

This is example one which I use.

现在把你自己的查询写入这2个进程的UNION数据中。

这是我使用的一个例子。

Code Block
languagesql
themeDJango
select
	jwdb.app_fd_multiApproval_approvals.id,NR.dateCreated, NR.dateModified, NR.c_value, NR.c_number, NR.c_doc_org, NR.c_requester_name, NR.c_priority
from
  (select 1 n union all
   select 2 union all select 3 union all
   select 4 union all select 5) numbers  INNER JOIN jwdb.app_fd_multiApproval_applications NR
  on CHAR_LENGTH(NR.c_childIDs)
     -CHAR_LENGTH(REPLACE(NR.c_childIDs, ',', ''))>=numbers.n-1
JOIN jwdb.app_fd_multiApproval_approvals
ON SUBSTRING_INDEX(SUBSTRING_INDEX(NR.c_childIDs, ',', numbers.n), ',', -1) COLLATE utf8_general_ci = jwdb.app_fd_multiApproval_approvals.id 
where c_childIDs != '' and NR.c_requester  is not null
UNION 
select 
	id, dateCreated, dateModified,c_value, c_number, c_doc_org, c_requester_name, c_priority
from jwdb.app_fd_multiApproval_applications 
where  jwdb.app_fd_multiApproval_applications .c_requester  is not null

 

P.S. I would like to provide my application, but it is quite robust and this is only small part of it, I will try to provide edited Multiple Approval v2 (Thread safe) with datalist inbox as soon as possible.  我想提供我的应用程序,但它是相当强大的,这只是其中的一小部分,我会尝试尽快提供编辑的  多重审批 v2 (线程安全)  和数据列表任务箱。