bp workflow update
This commit is contained in:
parent
8b463d3acb
commit
75ef221181
5 changed files with 2301 additions and 14 deletions
|
|
@ -287,6 +287,7 @@ public class BusinessPartnerService {
|
||||||
// phrase = LuceneSearchService.escapeSearchTerm(phrase);
|
// phrase = LuceneSearchService.escapeSearchTerm(phrase);
|
||||||
phrase = schemaService.normalizeSearchTerm(phrase);
|
phrase = schemaService.normalizeSearchTerm(phrase);
|
||||||
String sQuery = "(type:\"workitem\" OR type:\"workitemarchive\") AND ($modelversion:businesspartner-*)";
|
String sQuery = "(type:\"workitem\" OR type:\"workitemarchive\") AND ($modelversion:businesspartner-*)";
|
||||||
|
sQuery += " AND NOT ($taskid:1800) ";
|
||||||
|
|
||||||
// ist nur eine Zahl eingegeben worden?
|
// ist nur eine Zahl eingegeben worden?
|
||||||
if (isCargosoftNumber(phrase)) {
|
if (isCargosoftNumber(phrase)) {
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ public class CargosoftMigrationRestService implements Serializable {
|
||||||
for (ItemCollection cargosoftItemCol : cargosoftDataList) {
|
for (ItemCollection cargosoftItemCol : cargosoftDataList) {
|
||||||
totalObjects++;
|
totalObjects++;
|
||||||
|
|
||||||
if (businessPartnerImportService.syncCargosoftCreditorBusinessPartner(cargosoftItemCol) == true) {
|
if (businessPartnerImportService.syncCargosoftBusinessPartner(cargosoftItemCol) == true) {
|
||||||
updateService.updateIndex();
|
updateService.updateIndex();
|
||||||
syncs++;
|
syncs++;
|
||||||
if (syncs >= maxcount)
|
if (syncs >= maxcount)
|
||||||
|
|
|
||||||
|
|
@ -122,22 +122,39 @@ public class BusinessPartnerImportService {
|
||||||
if (event == null || event.getDocument() == null) {
|
if (event == null || event.getDocument() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// run only if we have the model 'businesspartner-*';
|
||||||
|
if (modelService.findVersionsByRegEx("(businesspartner*)").size() == 0) {
|
||||||
|
// no business partner workflow found
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check source
|
// check source
|
||||||
if (event.getEventType() == DocumentEvent.ON_DOCUMENT_SAVE
|
if ("cargosoftkreditor".equals(event.getDocument().getType())) {
|
||||||
&& "cargosoftkreditor".equals(event.getDocument().getType())) {
|
|
||||||
|
|
||||||
// set NOSNAPSHOT=true fro cargosoft item (migration)
|
if (event.getEventType() == DocumentEvent.ON_DOCUMENT_SAVE) {
|
||||||
event.getDocument().setItemValue(SnapshotService.NOSNAPSHOT, true);
|
// set NOSNAPSHOT=true fro cargosoft item (migration)
|
||||||
|
event.getDocument().setItemValue(SnapshotService.NOSNAPSHOT, true);
|
||||||
// run only if we have the model 'businesspartner-*';
|
logger.fine("Verify business partner object....");
|
||||||
if (modelService.findVersionsByRegEx("(businesspartner*)").size() == 0) {
|
ItemCollection importDoc = event.getDocument();
|
||||||
// no business partner workflow found
|
syncCargosoftBusinessPartner(importDoc);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.fine("Verify business partner object....");
|
if (event.getEventType() == DocumentEvent.ON_DOCUMENT_DELETE) {
|
||||||
ItemCollection importDoc = event.getDocument();
|
ItemCollection importDoc = event.getDocument();
|
||||||
syncCargosoftCreditorBusinessPartner(importDoc);
|
String cargosoftID = importDoc.getItemValueString("name");
|
||||||
|
String partnerID = InvoiceUtil.buildBPID(cargosoftID);
|
||||||
|
ItemCollection businesspartner = lookupBusinessPartner(partnerID);
|
||||||
|
if (businesspartner != null) {
|
||||||
|
logger.info("lock business partner object....");
|
||||||
|
try {
|
||||||
|
businesspartner.setEventID(80);
|
||||||
|
workflowService.processWorkItemByNewTransaction(businesspartner);
|
||||||
|
} catch (AccessDeniedException | ProcessingErrorException | PluginException | ModelException e) {
|
||||||
|
logger.warning(
|
||||||
|
"Failed to lock Business Partner Object " + cargosoftID + " - " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -156,7 +173,7 @@ public class BusinessPartnerImportService {
|
||||||
*
|
*
|
||||||
* @param creditor
|
* @param creditor
|
||||||
*/
|
*/
|
||||||
public boolean syncCargosoftCreditorBusinessPartner(ItemCollection importDoc) {
|
public boolean syncCargosoftBusinessPartner(ItemCollection importDoc) {
|
||||||
String cargosoftID = importDoc.getItemValueString("name");
|
String cargosoftID = importDoc.getItemValueString("name");
|
||||||
// K bedeutet Kreditor D bedeutet Debitor - beides kann vorkommen
|
// K bedeutet Kreditor D bedeutet Debitor - beides kann vorkommen
|
||||||
boolean isCreditor = cargosoftID.toUpperCase().startsWith("K");
|
boolean isCreditor = cargosoftID.toUpperCase().startsWith("K");
|
||||||
|
|
|
||||||
1107
workflow/businesspartner-de-1.0.2.bpmn
Normal file
1107
workflow/businesspartner-de-1.0.2.bpmn
Normal file
File diff suppressed because it is too large
Load diff
1162
workflow/businesspartner-en-1.0.1.bpmn
Normal file
1162
workflow/businesspartner-en-1.0.1.bpmn
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue