@ -938,8 +938,9 @@ public class ProcessServiceImpl implements ProcessService {
}
if ( cmdParam ! = null ) {
CommandType commandTypeIfComplement = getCommandTypeIfComplement ( processInstance , command ) ;
// reset global params while repeat running is needed by cmdParam
if ( commandTypeIfComplement = = CommandType . REPEAT_RUNNING ) {
// reset global params while repeat running and recover tolerance fault process is needed by cmdParam
if ( commandTypeIfComplement = = CommandType . REPEAT_RUNNING | |
commandTypeIfComplement = = CommandType . RECOVER_TOLERANCE_FAULT_PROCESS ) {
setGlobalParamIfCommanded ( processDefinition , cmdParam ) ;
}
@ -2081,8 +2082,7 @@ public class ProcessServiceImpl implements ProcessService {
cmd . setProcessDefinitionCode ( processDefinition . getCode ( ) ) ;
cmd . setProcessDefinitionVersion ( processDefinition . getVersion ( ) ) ;
cmd . setProcessInstanceId ( processInstance . getId ( ) ) ;
cmd . setCommandParam (
String . format ( "{\"%s\":%d}" , CMD_PARAM_RECOVER_PROCESS_ID_STRING , processInstance . getId ( ) ) ) ;
cmd . setCommandParam ( JSONUtils . toJsonString ( createCommandParams ( processInstance ) ) ) ;
cmd . setExecutorId ( processInstance . getExecutorId ( ) ) ;
cmd . setCommandType ( CommandType . RECOVER_TOLERANCE_FAULT_PROCESS ) ;
cmd . setProcessInstancePriority ( processInstance . getProcessInstancePriority ( ) ) ;
@ -3202,4 +3202,15 @@ public class ProcessServiceImpl implements ProcessService {
}
}
}
private Map < String , Object > createCommandParams ( ProcessInstance processInstance ) {
Map < String , Object > commandMap =
JSONUtils . parseObject ( processInstance . getCommandParam ( ) , new TypeReference < Map < String , Object > > ( ) {
} ) ;
Map < String , Object > recoverFailoverCommandParams = new HashMap < > ( ) ;
Optional . ofNullable ( MapUtils . getObject ( commandMap , CMD_PARAM_START_PARAMS ) )
. ifPresent ( startParams - > recoverFailoverCommandParams . put ( CMD_PARAM_START_PARAMS , startParams ) ) ;
recoverFailoverCommandParams . put ( CMD_PARAM_RECOVER_PROCESS_ID_STRING , processInstance . getId ( ) ) ;
return recoverFailoverCommandParams ;
}
}