결함이 발생할 때 타스크를 완료하려면 결함 메시지를 작성하십시오. //retrieve the faults modeled for the task
List faultNames = task.getFaultNames(tkiid);
//create a message of the appropriate type
ClientObjectWrapper myFault =
task.createFaultMessage(tkiid, (String)faultNames.get(0));
// set the parts in your fault message, for example, an error number
DataObject myMessage = null ;
if ( myFault.getObject()!= null && input.getObject() instanceof DataObject )
{
myMessage = (DataObject)myFault.getObject();
//set the parts in the message, for example, a customer name
myMessage.setInt("error",1304);
}
task.complete(tkiid, (String)faultNames.get(0), myFault);
이 조치를 실행하면 오류 코드를 포함하는 결함 메시지가 설정됩니다.
타스크는 실패 상태가 됩니다.