@ -46,7 +46,6 @@ import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils;
import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils.SnowFlakeException ;
import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils.SnowFlakeException ;
import org.apache.dolphinscheduler.common.utils.StringUtils ;
import org.apache.dolphinscheduler.common.utils.StringUtils ;
import org.apache.dolphinscheduler.dao.entity.DagData ;
import org.apache.dolphinscheduler.dao.entity.DagData ;
import org.apache.dolphinscheduler.dao.entity.ProcessData ;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition ;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition ;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog ;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog ;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance ;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance ;
@ -287,10 +286,12 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
Set < Long > postTaskCodes = taskRelationList . stream ( ) . map ( ProcessTaskRelationLog : : getPostTaskCode ) . collect ( Collectors . toSet ( ) ) ;
Set < Long > postTaskCodes = taskRelationList . stream ( ) . map ( ProcessTaskRelationLog : : getPostTaskCode ) . collect ( Collectors . toSet ( ) ) ;
Set < Long > taskNodeCodes = taskNodeList . stream ( ) . map ( TaskNode : : getCode ) . collect ( Collectors . toSet ( ) ) ;
Set < Long > taskNodeCodes = taskNodeList . stream ( ) . map ( TaskNode : : getCode ) . collect ( Collectors . toSet ( ) ) ;
Collection < Long > codes = CollectionUtils . subtract ( postTaskCodes , taskNodeCodes ) ;
Collection < Long > codes = CollectionUtils . subtract ( postTaskCodes , taskNodeCodes ) ;
if ( CollectionUtils . isNotEmpty ( codes ) ) {
logger . error ( "the task code is not exit" ) ;
logger . error ( "the task code is not exit" ) ;
putMsg ( result , Status . TASK_DEFINE_NOT_EXIST , StringUtils . join ( codes , Constants . COMMA ) ) ;
putMsg ( result , Status . TASK_DEFINE_NOT_EXIST , StringUtils . join ( codes , Constants . COMMA ) ) ;
return result ;
return result ;
}
}
}
if ( graphHasCycle ( taskNodeList ) ) {
if ( graphHasCycle ( taskNodeList ) ) {
logger . error ( "process DAG has cycle" ) ;
logger . error ( "process DAG has cycle" ) ;
putMsg ( result , Status . PROCESS_NODE_HAS_CYCLE ) ;
putMsg ( result , Status . PROCESS_NODE_HAS_CYCLE ) ;