대기 중인 첫 번째 서비스로 메시지를 전송하십시오. 첫 번째 서비스는 사용자가 사용할 서비스로
간주됩니다. 호출자는 메시지를 수신하는 활동의 잠재적 시작자 또는
프로세스 인스턴스 관리자여야 합니다.
VTID vtid = services[0].getServiceTemplateID();
ATID atid = services[0].getActivityTemplateID();
String inputType = services[0].getInputMessageTypeName();
// create a message for the service to be called
ClientObjectWrapper message =
process.createMessage(vtid,atid,inputMessageTypeName);
DataObject myMessage = null;
if ( message.getObject()!= null && message.getObject() instanceof DataObject )
{
myMessage = (DataObject)message.getObject();
//set the strings in the message, for example, chocolate is to be ordered
myMessage.setString("Order", "chocolate");
}
// send the message to the waiting activity
process.sendMessage(vtid, atid, message);
}
이 조치는 지정된 메시지를 대기 중 활동 서비스로 전송하고
일부 순서 데이터를 전달합니다.
프로세스 인스턴스 ID를 지정하여 메시지가 지정된 프로세스
인스턴스에 전송되는지 확인할 수도 있습니다. 프로세스 인스턴스 ID가 지정되지 않는 경우
메시지가 메시지의 상관 값에서 식별한 프로세스 인스턴스 및 활동 서비스로 전송됩니다. 프로세스 인스턴스 ID가 지정된 경우 상관 값을 사용해 찾은 프로세스 인스턴스를 확인하여
지정된 프로세스 인스턴스 ID를 갖는지 확인하십시오.