0

Windows の Case Manager 5.2.1 で Java API を使用しています。

私の Web サービスは次のことを行います。

// Create a brand new case
CaseType myCaseType = CaseType.fetchInstance(osRef, myCaseTypeName);
Case newPendingCase = Case.createPendingInstance(myCaseType);

// Save it now to get access to the Case ID
newPendingCase.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);
newCaseIdentifier = newPendingCase.getIdentifier();

// Fetch a fresh copy of the case instance
Case cs = Case.fetchInstanceFromIdentifier(osRef, newCaseIdentifier);

// Now set a whole bunch of properties, add documents, etc. etc.
...

// Finally, save all our updates: to "cs", not "newCaseIdentifier"
cs.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);

問題: 断続的に次のエラーが発生します。

クラス「MyCaseTypeName」のオブジェクト {52EECAC2-38B2-4CB5-8F22-BAF33D6C35EC} は、アプリケーションが取得してからリポジトリで 1 回以上変更されたため、変更も削除もされませんでした。シーケンス番号の不一致を更新します。要求された USN = 0、データベース USN = 1

case.save() 呼び出しが 2 つしかないことはわかっています。

同じコードを複数回実行します。「更新シーケンス番号の不一致」エラーで失敗する場合もあります。

Q: この問題のトラブルシューティング方法に関するアイデアや提案はありますか?

4

1 に答える 1

1

あなたが提供したコードを見ると、2 番目の Case インスタンスを作成する理由がわかりません。代わりにこれを行う方が良いと思います:

// Create a brand new case
CaseType myCaseType = CaseType.fetchInstance(osRef, myCaseTypeName);
Case newPendingCase = Case.createPendingInstance(myCaseType);

// Save it now to get access to the Case ID
newPendingCase.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);
newCaseIdentifier = newPendingCase.getIdentifier();

// Fetch a fresh copy of the case instance (not sure if this is necessary)
newPendingCase = Case.fetchInstanceFromIdentifier(osRef, newCaseIdentifier);

// Now set a whole bunch of properties, add documents, etc. etc.
...

// Finally, save all our updates: to "newPendingCase"
newPendingCase.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);

私は Case Manager を使用したことはありませんが、P8 を使用したことはあります。API 呼び出しは非常に似ています。

USN 番号は少し扱いに​​くい場合があります。外部呼び出し (たとえば、サード パーティの REST インターフェイスへの呼び出し) を待っている期間がある場合はnewPendingCase.Refresh()、呼び出しの後に を実行してから、ケースの必要なプロパティを再入力することをお勧めします。

于 2016-06-21T13:51:26.633 に答える