Ax2012에서 Thread 클래스를 사용하여 멀티 스레딩을 사용하는 기능에 대해 알게 된 후 다음과 같이 구현하려고했습니다.
먼저 모든 논리를 클래스의 정적 메서드로 구현해야합니다. 그 정적 메소드는 그 메소드의 호출을 작성해야 클래스의 정적 메소드를 생성 한 후 매개 변수로 예컨대
public static void process(thread _thread)
{
FG_ConfirmationEngine confirmationEngine = new FG_ConfirmationEngine();
salesTable salesTable;
container _con;;
_con = _thread.getInputParm();
info(conPeek(_thread.getInputParm(),1));
salesTable = salesTable::find(conPeek(_thread.getInputParm(),1));
confirmationEngine.parmSalesTable(salesTable);
confirmationEngine.run();// in this method all of my confirmation pre and post logic exist
}
을 스레드 클래스를 포함해야합니다. 주 : Thread 클래스를 통해 Args, Object를 보낼 수 없습니다. 당신은 thread.setInputParm() 메서드를 통해 _thread.setInputParm ([salestable.salesid]) 메서드와 같은 컨테이너 형태로만 매개 변수를 보낼 수 있습니다.
호출 :
salesline salesline;
ExecutePermission perm;
Thread myThread;
ttsBegin;
perm = new ExecutePermission();
if (!perm)
return;
perm.assert();
while select salesid from salestable
where salestable.FG_BookingReferenceID == "BRF-0001"
{
myThread = new Thread();
myThread.setInputParm([salestable.SalesId]);
if (myThread)
{
myThread.removeOnComplete(true);
myThread.run(classnum(FG_ConfirmationEngine), staticMethodStr(FG_ConfirmationEngine,process));
}
}
CodeAccessPermission::revertAssert();
그것이 도움이되기를 바랍니다. 해피 DAXing
누군가가 1 분 이내에 자신의 대답을하면 질문이되지 않습니다. – DAXaholic
@DAXaholic 사실, 자기 대답은 허용되며 심지어 권장됩니다. https://stackoverflow.com/help/self-answer –
아, 그걸 몰랐습니다. 이상한 작은 조각 그러나 그것은 단지 나의 의견이다. 그 지적을위한 Thx! – DAXaholic