@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License .
* limitations under the License .
* /
* /
package org.apache.dolphinscheduler.service.process ;
package org.apache.dolphinscheduler.service.process ;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE ;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE ;
@ -145,7 +146,6 @@ public class ProcessService {
private ResourceMapper resourceMapper ;
private ResourceMapper resourceMapper ;
@Autowired
@Autowired
private ErrorCommandMapper errorCommandMapper ;
private ErrorCommandMapper errorCommandMapper ;
@ -157,6 +157,7 @@ public class ProcessService {
/ * *
/ * *
* handle Command ( construct ProcessInstance from Command ) , wrapped in transaction
* handle Command ( construct ProcessInstance from Command ) , wrapped in transaction
*
* @param logger logger
* @param logger logger
* @param host host
* @param host host
* @param validThreadNum validThreadNum
* @param validThreadNum validThreadNum
@ -186,6 +187,7 @@ public class ProcessService {
/ * *
/ * *
* save error command , and delete original command
* save error command , and delete original command
*
* @param command command
* @param command command
* @param message message
* @param message message
* /
* /
@ -198,6 +200,7 @@ public class ProcessService {
/ * *
/ * *
* set process waiting thread
* set process waiting thread
*
* @param command command
* @param command command
* @param processInstance processInstance
* @param processInstance processInstance
* @return process instance
* @return process instance
@ -215,6 +218,7 @@ public class ProcessService {
/ * *
/ * *
* check thread num
* check thread num
*
* @param command command
* @param command command
* @param validThreadNum validThreadNum
* @param validThreadNum validThreadNum
* @return if thread is enough
* @return if thread is enough
@ -226,6 +230,7 @@ public class ProcessService {
/ * *
/ * *
* insert one command
* insert one command
*
* @param command command
* @param command command
* @return create result
* @return create result
* /
* /
@ -239,6 +244,7 @@ public class ProcessService {
/ * *
/ * *
* find one command from queue list
* find one command from queue list
*
* @return command
* @return command
* /
* /
public Command findOneCommand ( ) {
public Command findOneCommand ( ) {
@ -247,6 +253,7 @@ public class ProcessService {
/ * *
/ * *
* check the input command exists in queue list
* check the input command exists in queue list
*
* @param command command
* @param command command
* @return create command result
* @return create command result
* /
* /
@ -279,6 +286,7 @@ public class ProcessService {
/ * *
/ * *
* find process instance detail by id
* find process instance detail by id
*
* @param processId processId
* @param processId processId
* @return process instance
* @return process instance
* /
* /
@ -288,6 +296,7 @@ public class ProcessService {
/ * *
/ * *
* get task node list by definitionId
* get task node list by definitionId
*
* @param defineId
* @param defineId
* @return
* @return
* /
* /
@ -312,6 +321,7 @@ public class ProcessService {
/ * *
/ * *
* find process instance by id
* find process instance by id
*
* @param processId processId
* @param processId processId
* @return process instance
* @return process instance
* /
* /
@ -321,6 +331,7 @@ public class ProcessService {
/ * *
/ * *
* find process define by id .
* find process define by id .
*
* @param processDefinitionId processDefinitionId
* @param processDefinitionId processDefinitionId
* @return process definition
* @return process definition
* /
* /
@ -330,6 +341,7 @@ public class ProcessService {
/ * *
/ * *
* delete work process instance by id
* delete work process instance by id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @return delete process instance result
* @return delete process instance result
* /
* /
@ -339,6 +351,7 @@ public class ProcessService {
/ * *
/ * *
* delete all sub process by parent instance id
* delete all sub process by parent instance id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @return delete all sub process instance result
* @return delete all sub process instance result
* /
* /
@ -355,9 +368,9 @@ public class ProcessService {
return 1 ;
return 1 ;
}
}
/ * *
/ * *
* remove task log file
* remove task log file
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* /
* /
public void removeTaskLogFile ( Integer processInstanceId ) {
public void removeTaskLogFile ( Integer processInstanceId ) {
@ -383,16 +396,14 @@ public class ProcessService {
// compatible old version
// compatible old version
ip = taskInstance . getHost ( ) ;
ip = taskInstance . getHost ( ) ;
}
}
// remove task log from loggerserver
// remove task log from loggerserver
logClient . removeTaskLog ( ip , port , taskLogPath ) ;
logClient . removeTaskLog ( ip , port , taskLogPath ) ;
}
}
}
}
/ * *
/ * *
* calculate sub process number in the process define .
* calculate sub process number in the process define .
*
* @param processDefinitionId processDefinitionId
* @param processDefinitionId processDefinitionId
* @return process thread num count
* @return process thread num count
* /
* /
@ -404,6 +415,7 @@ public class ProcessService {
/ * *
/ * *
* recursive query sub process definition id by parent id .
* recursive query sub process definition id by parent id .
*
* @param parentId parentId
* @param parentId parentId
* @param ids ids
* @param ids ids
* /
* /
@ -435,6 +447,7 @@ public class ProcessService {
* sub work process instance need not to create recovery command .
* sub work process instance need not to create recovery command .
* create recovery waiting thread command and delete origin command at the same time .
* create recovery waiting thread command and delete origin command at the same time .
* if the recovery command is exists , only update the field update_time
* if the recovery command is exists , only update the field update_time
*
* @param originCommand originCommand
* @param originCommand originCommand
* @param processInstance processInstance
* @param processInstance processInstance
* /
* /
@ -485,6 +498,7 @@ public class ProcessService {
/ * *
/ * *
* get schedule time from command
* get schedule time from command
*
* @param command command
* @param command command
* @param cmdParam cmdParam map
* @param cmdParam cmdParam map
* @return date
* @return date
@ -501,6 +515,7 @@ public class ProcessService {
/ * *
/ * *
* generate a new work process instance from command .
* generate a new work process instance from command .
*
* @param processDefinition processDefinition
* @param processDefinition processDefinition
* @param command command
* @param command command
* @param cmdParam cmdParam map
* @param cmdParam cmdParam map
@ -558,6 +573,7 @@ public class ProcessService {
* there is tenant id in definition , use the tenant of the definition .
* there is tenant id in definition , use the tenant of the definition .
* if there is not tenant id in the definiton or the tenant not exist
* if there is not tenant id in the definiton or the tenant not exist
* use definition creator ' s tenant .
* use definition creator ' s tenant .
*
* @param tenantId tenantId
* @param tenantId tenantId
* @param userId userId
* @param userId userId
* @return tenant
* @return tenant
@ -581,6 +597,7 @@ public class ProcessService {
/ * *
/ * *
* check command parameters is valid
* check command parameters is valid
*
* @param command command
* @param command command
* @param cmdParam cmdParam map
* @param cmdParam cmdParam map
* @return whether command param is valid
* @return whether command param is valid
@ -599,6 +616,7 @@ public class ProcessService {
/ * *
/ * *
* construct process instance according to one command .
* construct process instance according to one command .
*
* @param command command
* @param command command
* @param host host
* @param host host
* @return process instance
* @return process instance
@ -755,6 +773,7 @@ public class ProcessService {
/ * *
/ * *
* return complement data if the process start with complement data
* return complement data if the process start with complement data
*
* @param processInstance processInstance
* @param processInstance processInstance
* @param command command
* @param command command
* @return command type
* @return command type
@ -769,6 +788,7 @@ public class ProcessService {
/ * *
/ * *
* initialize complement data parameters
* initialize complement data parameters
*
* @param processDefinition processDefinition
* @param processDefinition processDefinition
* @param processInstance processInstance
* @param processInstance processInstance
* @param cmdParam cmdParam
* @param cmdParam cmdParam
@ -792,11 +812,11 @@ public class ProcessService {
}
}
/ * *
/ * *
* set sub work process parameters .
* set sub work process parameters .
* handle sub work process instance , update relation table and command parameters
* handle sub work process instance , update relation table and command parameters
* set sub work process flag , extends parent work process command parameters
* set sub work process flag , extends parent work process command parameters
*
* @param subProcessInstance subProcessInstance
* @param subProcessInstance subProcessInstance
* @return process instance
* @return process instance
* /
* /
@ -841,6 +861,7 @@ public class ProcessService {
/ * *
/ * *
* join parent global params into sub process .
* join parent global params into sub process .
* only the keys doesn ' t in sub process global would be joined .
* only the keys doesn ' t in sub process global would be joined .
*
* @param parentGlobalParams parentGlobalParams
* @param parentGlobalParams parentGlobalParams
* @param subGlobalParams subGlobalParams
* @param subGlobalParams subGlobalParams
* @return global params join
* @return global params join
@ -862,6 +883,7 @@ public class ProcessService {
/ * *
/ * *
* initialize task instance
* initialize task instance
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* /
* /
private void initTaskInstance ( TaskInstance taskInstance ) {
private void initTaskInstance ( TaskInstance taskInstance ) {
@ -880,6 +902,7 @@ public class ProcessService {
/ * *
/ * *
* submit task to db
* submit task to db
* submit sub process to command
* submit sub process to command
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return task instance
* @return task instance
* /
* /
@ -909,6 +932,7 @@ public class ProcessService {
* consider o
* consider o
* repeat running does not generate new sub process instance
* repeat running does not generate new sub process instance
* set map { parent instance id , task instance id , 0 ( child instance id ) }
* set map { parent instance id , task instance id , 0 ( child instance id ) }
*
* @param parentInstance parentInstance
* @param parentInstance parentInstance
* @param parentTask parentTask
* @param parentTask parentTask
* @return process instance map
* @return process instance map
@ -937,6 +961,7 @@ public class ProcessService {
/ * *
/ * *
* find previous task work process map .
* find previous task work process map .
*
* @param parentProcessInstance parentProcessInstance
* @param parentProcessInstance parentProcessInstance
* @param parentTask parentTask
* @param parentTask parentTask
* @return process instance map
* @return process instance map
@ -990,6 +1015,7 @@ public class ProcessService {
/ * *
/ * *
* complement data needs transform parent parameter to child .
* complement data needs transform parent parameter to child .
*
* @param instanceMap
* @param instanceMap
* @param parentProcessInstance
* @param parentProcessInstance
* @return
* @return
@ -1011,6 +1037,7 @@ public class ProcessService {
/ * *
/ * *
* create sub work process command
* create sub work process command
*
* @param parentProcessInstance
* @param parentProcessInstance
* @param childInstance
* @param childInstance
* @param instanceMap
* @param instanceMap
@ -1043,6 +1070,7 @@ public class ProcessService {
/ * *
/ * *
* initialize sub work flow state
* initialize sub work flow state
* child instance state would be initialized when ' recovery from pause / stop / failure '
* child instance state would be initialized when ' recovery from pause / stop / failure '
*
* @param childInstance
* @param childInstance
* /
* /
private void initSubInstanceState ( ProcessInstance childInstance ) {
private void initSubInstanceState ( ProcessInstance childInstance ) {
@ -1070,7 +1098,8 @@ public class ProcessService {
}
}
/ * *
/ * *
* update sub process definition
* update sub process definition todo
*
* @param parentProcessInstance parentProcessInstance
* @param parentProcessInstance parentProcessInstance
* @param childDefinitionId childDefinitionId
* @param childDefinitionId childDefinitionId
* /
* /
@ -1078,14 +1107,14 @@ public class ProcessService {
ProcessDefinition fatherDefinition = this . findProcessDefineById ( parentProcessInstance . getProcessDefinitionId ( ) ) ;
ProcessDefinition fatherDefinition = this . findProcessDefineById ( parentProcessInstance . getProcessDefinitionId ( ) ) ;
ProcessDefinition childDefinition = this . findProcessDefineById ( childDefinitionId ) ;
ProcessDefinition childDefinition = this . findProcessDefineById ( childDefinitionId ) ;
if ( childDefinition ! = null & & fatherDefinition ! = null ) {
if ( childDefinition ! = null & & fatherDefinition ! = null ) {
childDefinition . setReceivers ( fatherDefinition . getReceivers ( ) ) ;
childDefinition . setWarningGroupId ( fatherDefinition . getWarningGroupId ( ) ) ;
childDefinition . setReceiversCc ( fatherDefinition . getReceiversCc ( ) ) ;
processDefineMapper . updateById ( childDefinition ) ;
processDefineMapper . updateById ( childDefinition ) ;
}
}
}
}
/ * *
/ * *
* submit task to mysql
* submit task to mysql
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @param processInstance processInstance
* @param processInstance processInstance
* @return task instance
* @return task instance
@ -1132,10 +1161,10 @@ public class ProcessService {
return taskInstance ;
return taskInstance ;
}
}
/ * *
/ * *
* $ { processInstancePriority } _$ { processInstanceId } _$ { taskInstancePriority } _$ { taskInstanceId } _$ { task executed by ip1 } , $ { ip2 } . . .
* $ { processInstancePriority } _$ { processInstanceId } _$ { taskInstancePriority } _$ { taskInstanceId } _$ { task executed by ip1 } , $ { ip2 } . . .
* The tasks with the highest priority are selected by comparing the priorities of the above four levels from high to low .
* The tasks with the highest priority are selected by comparing the priorities of the above four levels from high to low .
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return task zk queue str
* @return task zk queue str
* /
* /
@ -1199,6 +1228,7 @@ public class ProcessService {
/ * *
/ * *
* check process instance strategy
* check process instance strategy
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return check strategy result
* @return check strategy result
* /
* /
@ -1220,6 +1250,7 @@ public class ProcessService {
/ * *
/ * *
* check the task instance existing in queue
* check the task instance existing in queue
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return whether taskinstance exists queue
* @return whether taskinstance exists queue
* /
* /
@ -1235,6 +1266,7 @@ public class ProcessService {
/ * *
/ * *
* create a new process instance
* create a new process instance
*
* @param processInstance processInstance
* @param processInstance processInstance
* /
* /
public void createProcessInstance ( ProcessInstance processInstance ) {
public void createProcessInstance ( ProcessInstance processInstance ) {
@ -1246,6 +1278,7 @@ public class ProcessService {
/ * *
/ * *
* insert or update work process instance to data base
* insert or update work process instance to data base
*
* @param processInstance processInstance
* @param processInstance processInstance
* /
* /
public void saveProcessInstance ( ProcessInstance processInstance ) {
public void saveProcessInstance ( ProcessInstance processInstance ) {
@ -1263,6 +1296,7 @@ public class ProcessService {
/ * *
/ * *
* insert or update command
* insert or update command
*
* @param command command
* @param command command
* @return save command result
* @return save command result
* /
* /
@ -1276,6 +1310,7 @@ public class ProcessService {
/ * *
/ * *
* insert or update task instance
* insert or update task instance
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return save task instance result
* @return save task instance result
* /
* /
@ -1289,6 +1324,7 @@ public class ProcessService {
/ * *
/ * *
* insert task instance
* insert task instance
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return create task instance result
* @return create task instance result
* /
* /
@ -1299,6 +1335,7 @@ public class ProcessService {
/ * *
/ * *
* update task instance
* update task instance
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return update task instance result
* @return update task instance result
* /
* /
@ -1306,8 +1343,10 @@ public class ProcessService {
int count = taskInstanceMapper . updateById ( taskInstance ) ;
int count = taskInstanceMapper . updateById ( taskInstance ) ;
return count > 0 ;
return count > 0 ;
}
}
/ * *
/ * *
* delete a command by id
* delete a command by id
*
* @param id id
* @param id id
* /
* /
public void delCommandByid ( int id ) {
public void delCommandByid ( int id ) {
@ -1316,6 +1355,7 @@ public class ProcessService {
/ * *
/ * *
* find task instance by id
* find task instance by id
*
* @param taskId task id
* @param taskId task id
* @return task intance
* @return task intance
* /
* /
@ -1323,9 +1363,9 @@ public class ProcessService {
return taskInstanceMapper . selectById ( taskId ) ;
return taskInstanceMapper . selectById ( taskId ) ;
}
}
/ * *
/ * *
* package task instance , associate processInstance and processDefine
* package task instance , associate processInstance and processDefine
*
* @param taskInstId taskInstId
* @param taskInstId taskInstId
* @return task instance
* @return task instance
* /
* /
@ -1345,9 +1385,9 @@ public class ProcessService {
return taskInstance ;
return taskInstance ;
}
}
/ * *
/ * *
* get id list by task state
* get id list by task state
*
* @param instanceId instanceId
* @param instanceId instanceId
* @param state state
* @param state state
* @return task instance states
* @return task instance states
@ -1358,6 +1398,7 @@ public class ProcessService {
/ * *
/ * *
* find valid task list by process definition id
* find valid task list by process definition id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @return task instance list
* @return task instance list
* /
* /
@ -1367,6 +1408,7 @@ public class ProcessService {
/ * *
/ * *
* find previous task list by work process id
* find previous task list by work process id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @return task instance list
* @return task instance list
* /
* /
@ -1376,6 +1418,7 @@ public class ProcessService {
/ * *
/ * *
* update work process instance map
* update work process instance map
*
* @param processInstanceMap processInstanceMap
* @param processInstanceMap processInstanceMap
* @return update process instance result
* @return update process instance result
* /
* /
@ -1383,9 +1426,9 @@ public class ProcessService {
return processInstanceMapMapper . updateById ( processInstanceMap ) ;
return processInstanceMapMapper . updateById ( processInstanceMap ) ;
}
}
/ * *
/ * *
* create work process instance map
* create work process instance map
*
* @param processInstanceMap processInstanceMap
* @param processInstanceMap processInstanceMap
* @return create process instance result
* @return create process instance result
* /
* /
@ -1399,6 +1442,7 @@ public class ProcessService {
/ * *
/ * *
* find work process map by parent process id and parent task id .
* find work process map by parent process id and parent task id .
*
* @param parentWorkProcessId parentWorkProcessId
* @param parentWorkProcessId parentWorkProcessId
* @param parentTaskId parentTaskId
* @param parentTaskId parentTaskId
* @return process instance map
* @return process instance map
@ -1409,6 +1453,7 @@ public class ProcessService {
/ * *
/ * *
* delete work process map by parent process id
* delete work process map by parent process id
*
* @param parentWorkProcessId parentWorkProcessId
* @param parentWorkProcessId parentWorkProcessId
* @return delete process map result
* @return delete process map result
* /
* /
@ -1419,6 +1464,7 @@ public class ProcessService {
/ * *
/ * *
* find sub process instance
* find sub process instance
*
* @param parentProcessId parentProcessId
* @param parentProcessId parentProcessId
* @param parentTaskId parentTaskId
* @param parentTaskId parentTaskId
* @return process instance
* @return process instance
@ -1435,6 +1481,7 @@ public class ProcessService {
/ * *
/ * *
* find parent process instance
* find parent process instance
*
* @param subProcessId subProcessId
* @param subProcessId subProcessId
* @return process instance
* @return process instance
* /
* /
@ -1448,9 +1495,9 @@ public class ProcessService {
return processInstance ;
return processInstance ;
}
}
/ * *
/ * *
* change task state
* change task state
*
* @param state state
* @param state state
* @param startTime startTime
* @param startTime startTime
* @param host host
* @param host host
@ -1473,6 +1520,7 @@ public class ProcessService {
/ * *
/ * *
* update process instance
* update process instance
*
* @param processInstance processInstance
* @param processInstance processInstance
* @return update process instance result
* @return update process instance result
* /
* /
@ -1482,6 +1530,7 @@ public class ProcessService {
/ * *
/ * *
* update the process instance
* update the process instance
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @param processJson processJson
* @param processJson processJson
* @param globalParams globalParams
* @param globalParams globalParams
@ -1508,6 +1557,7 @@ public class ProcessService {
/ * *
/ * *
* change task state
* change task state
*
* @param state state
* @param state state
* @param endTime endTime
* @param endTime endTime
* @param taskInstId taskInstId
* @param taskInstId taskInstId
@ -1530,6 +1580,7 @@ public class ProcessService {
/ * *
/ * *
* convert integer list to string list
* convert integer list to string list
*
* @param intList intList
* @param intList intList
* @return string list
* @return string list
* /
* /
@ -1546,6 +1597,7 @@ public class ProcessService {
/ * *
/ * *
* query schedule by id
* query schedule by id
*
* @param id id
* @param id id
* @return schedule
* @return schedule
* /
* /
@ -1555,6 +1607,7 @@ public class ProcessService {
/ * *
/ * *
* query Schedule by processDefinitionId
* query Schedule by processDefinitionId
*
* @param processDefinitionId processDefinitionId
* @param processDefinitionId processDefinitionId
* @see Schedule
* @see Schedule
* /
* /
@ -1564,6 +1617,7 @@ public class ProcessService {
/ * *
/ * *
* query need failover process instance
* query need failover process instance
*
* @param host host
* @param host host
* @return process instance list
* @return process instance list
* /
* /
@ -1574,6 +1628,7 @@ public class ProcessService {
/ * *
/ * *
* process need failover process instance
* process need failover process instance
*
* @param processInstance processInstance
* @param processInstance processInstance
* /
* /
@Transactional ( rollbackFor = RuntimeException . class )
@Transactional ( rollbackFor = RuntimeException . class )
@ -1593,6 +1648,7 @@ public class ProcessService {
/ * *
/ * *
* query all need failover task instances by host
* query all need failover task instances by host
*
* @param host host
* @param host host
* @return task instance list
* @return task instance list
* /
* /
@ -1603,6 +1659,7 @@ public class ProcessService {
/ * *
/ * *
* find data source by id
* find data source by id
*
* @param id id
* @param id id
* @return datasource
* @return datasource
* /
* /
@ -1610,9 +1667,9 @@ public class ProcessService {
return dataSourceMapper . selectById ( id ) ;
return dataSourceMapper . selectById ( id ) ;
}
}
/ * *
/ * *
* update process instance state by id
* update process instance state by id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @param executionStatus executionStatus
* @param executionStatus executionStatus
* @return update process result
* @return update process result
@ -1626,6 +1683,7 @@ public class ProcessService {
/ * *
/ * *
* find process instance by the task id
* find process instance by the task id
*
* @param taskId taskId
* @param taskId taskId
* @return process instance
* @return process instance
* /
* /
@ -1639,6 +1697,7 @@ public class ProcessService {
/ * *
/ * *
* find udf function list by id list string
* find udf function list by id list string
*
* @param ids ids
* @param ids ids
* @return udf function list
* @return udf function list
* /
* /
@ -1648,6 +1707,7 @@ public class ProcessService {
/ * *
/ * *
* find tenant code by resource name
* find tenant code by resource name
*
* @param resName resource name
* @param resName resource name
* @param resourceType resource type
* @param resourceType resource type
* @return tenant code
* @return tenant code
@ -1658,6 +1718,7 @@ public class ProcessService {
/ * *
/ * *
* find schedule list by process define id .
* find schedule list by process define id .
*
* @param ids ids
* @param ids ids
* @return schedule list
* @return schedule list
* /
* /
@ -1668,6 +1729,7 @@ public class ProcessService {
/ * *
/ * *
* get dependency cycle by work process define id and scheduler fire time
* get dependency cycle by work process define id and scheduler fire time
*
* @param masterId masterId
* @param masterId masterId
* @param processDefinitionId processDefinitionId
* @param processDefinitionId processDefinitionId
* @param scheduledFireTime the time the task schedule is expected to trigger
* @param scheduledFireTime the time the task schedule is expected to trigger
@ -1682,6 +1744,7 @@ public class ProcessService {
/ * *
/ * *
* get dependency cycle list by work process define id list and scheduler fire time
* get dependency cycle list by work process define id list and scheduler fire time
*
* @param masterId masterId
* @param masterId masterId
* @param ids ids
* @param ids ids
* @param scheduledFireTime the time the task schedule is expected to trigger
* @param scheduledFireTime the time the task schedule is expected to trigger
@ -1699,7 +1762,6 @@ public class ProcessService {
return cycleDependencyList ;
return cycleDependencyList ;
}
}
String strCrontab = "" ;
String strCrontab = "" ;
CronExpression depCronExpression ;
CronExpression depCronExpression ;
Cron depCron ;
Cron depCron ;
@ -1754,6 +1816,7 @@ public class ProcessService {
/ * *
/ * *
* find last scheduler process instance in the date interval
* find last scheduler process instance in the date interval
*
* @param definitionId definitionId
* @param definitionId definitionId
* @param dateInterval dateInterval
* @param dateInterval dateInterval
* @return process instance
* @return process instance
@ -1766,6 +1829,7 @@ public class ProcessService {
/ * *
/ * *
* find last manual process instance interval
* find last manual process instance interval
*
* @param definitionId process definition id
* @param definitionId process definition id
* @param dateInterval dateInterval
* @param dateInterval dateInterval
* @return process instance
* @return process instance
@ -1778,6 +1842,7 @@ public class ProcessService {
/ * *
/ * *
* find last running process instance
* find last running process instance
*
* @param definitionId process definition id
* @param definitionId process definition id
* @param startTime start time
* @param startTime start time
* @param endTime end time
* @param endTime end time
@ -1792,6 +1857,7 @@ public class ProcessService {
/ * *
/ * *
* query user queue by process instance id
* query user queue by process instance id
*
* @param processInstanceId processInstanceId
* @param processInstanceId processInstanceId
* @return queue
* @return queue
* /
* /
@ -1809,16 +1875,14 @@ public class ProcessService {
return queue ;
return queue ;
}
}
/ * *
/ * *
* get task worker group
* get task worker group
*
* @param taskInstance taskInstance
* @param taskInstance taskInstance
* @return workerGroupId
* @return workerGroupId
* /
* /
public String getTaskWorkerGroup ( TaskInstance taskInstance ) {
public String getTaskWorkerGroup ( TaskInstance taskInstance ) {
String workerGroup = taskInstance . getWorkerGroup ( ) ;
String workerGroup = taskInstance . getWorkerGroup ( ) ;
if ( StringUtils . isNotBlank ( workerGroup ) ) {
if ( StringUtils . isNotBlank ( workerGroup ) ) {
return workerGroup ;
return workerGroup ;
}
}
@ -1834,6 +1898,7 @@ public class ProcessService {
/ * *
/ * *
* get have perm project list
* get have perm project list
*
* @param userId userId
* @param userId userId
* @return project list
* @return project list
* /
* /
@ -1853,6 +1918,7 @@ public class ProcessService {
/ * *
/ * *
* get have perm project ids
* get have perm project ids
*
* @param userId userId
* @param userId userId
* @return project ids
* @return project ids
* /
* /
@ -1867,6 +1933,7 @@ public class ProcessService {
/ * *
/ * *
* list unauthorized udf function
* list unauthorized udf function
*
* @param userId user id
* @param userId user id
* @param needChecks data source id array
* @param needChecks data source id array
* @return unauthorized udf function list
* @return unauthorized udf function list
@ -1898,6 +1965,8 @@ public class ProcessService {
Set < Integer > authorizedUdfs = udfFuncMapper . listAuthorizedUdfFunc ( userId , needChecks ) . stream ( ) . map ( t - > t . getId ( ) ) . collect ( toSet ( ) ) ;
Set < Integer > authorizedUdfs = udfFuncMapper . listAuthorizedUdfFunc ( userId , needChecks ) . stream ( ) . map ( t - > t . getId ( ) ) . collect ( toSet ( ) ) ;
originResSet . removeAll ( authorizedUdfs ) ;
originResSet . removeAll ( authorizedUdfs ) ;
break ;
break ;
default :
break ;
}
}
resultList . addAll ( originResSet ) ;
resultList . addAll ( originResSet ) ;
@ -1908,6 +1977,7 @@ public class ProcessService {
/ * *
/ * *
* get user by user id
* get user by user id
*
* @param userId user id
* @param userId user id
* @return User
* @return User
* /
* /
@ -1917,6 +1987,7 @@ public class ProcessService {
/ * *
/ * *
* get resource by resoruce id
* get resource by resoruce id
*
* @param resoruceId resource id
* @param resoruceId resource id
* @return Resource
* @return Resource
* /
* /
@ -1924,9 +1995,9 @@ public class ProcessService {
return resourceMapper . selectById ( resoruceId ) ;
return resourceMapper . selectById ( resoruceId ) ;
}
}
/ * *
/ * *
* list resources by ids
* list resources by ids
*
* @param resIds resIds
* @param resIds resIds
* @return resource list
* @return resource list
* /
* /
@ -1936,6 +2007,7 @@ public class ProcessService {
/ * *
/ * *
* format task app id in task instance
* format task app id in task instance
*
* @param taskInstance
* @param taskInstance
* @return
* @return
* /
* /