Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 1.1
-
Component/s: None
-
Labels:None
-
Request Controller:Albers, Stephan
-
External Supervisor:Staskov, Ivan
-
Executing Programmer:Please select
Description
Often, workflows are using many Process Variables (eg. CatalogId,ContractID, SupplierId,CustomerID, CurrentVersionID, importFormat, and etc) in many Node of the process.
This requires that we assign the values of the action with many process variables.
As you can see in the example we have to pass many parameters into the ImportFormatConversion service. It would be nicer/shorter to place all "common" ProcessVariables into a map and put this map as a parameter into the action.
This minimizes the list of parameters which we are sending to Actions (see attached sample).
Example:
class SupplierWorkflowProcess {
//------------------------------- Common variables -------------------------------
public String supplierId
public String supplierName
public String customerId
public String customerName
public String productCatalogId
public String catalogName
public String contractId
...............
importConversionCatalog() {
action {
Log(relativePathToLogFile: "#relativePathToLogFile", messageBundle:"#bundle", languageId: "#defaultLanguageId", messageKey:'message.workflow.execute.importFormatConversionCatalog')
Log(relativePathToLogFile: "#relativePathToLogFile", languageId: "#defaultLanguageId",
messageBundle:"#bundle", messageKey:'message.workflow.execute.script',
params: "script\t#{importFormat}")
return ImportFormatConversion(supplierId: "#supplierId", customerId: "#customerId",
productCatalogId: "#productCatalogId", contractId: "#contractId", fileName: "#fileName",
updateType: "#updateType", format: "#importFormat", importClassification: "#importClassification",
importUomSystem: "#sourceUOM", languageId:"#defaultLanguageId",
booleanPattern: "#booleanPattern", decimalSeparator: "#decimalSeparator",
datePattern: "#datePattern", quotationMark: "#quotationMark", separator: "#separator",
mappingDefinitions: "updateCatalogFileName\tupdateCatalogPath\t\tupdateContractFileName\tupdateContractPath")
}
on('okay').to(['postImportConversionCatalog'])
}
................
}
class SupplierWorkflowProcess {
//------------------------------- Common variables -------------------------------
public String supplierId
public String supplierName
public String customerId
public String customerName
public String productCatalogId
public String catalogName
public String contractId
public Map commonProcessVariables = { supplierId:supplierId, supplierName:supplierName, customerId:customerId,... }
...............
importConversionCatalog() {
action {
Log(relativePathToLogFile: "#relativePathToLogFile", messageBundle:"#bundle", languageId: "#defaultLanguageId", messageKey:'message.workflow.execute.importFormatConversionCatalog')
Log(relativePathToLogFile: "#relativePathToLogFile", languageId: "#defaultLanguageId",
messageBundle:"#bundle", messageKey:'message.workflow.execute.script',
params: "script\t#{importFormat}")
return ImportFormatConversion(commonProcessVariables:"#commonProcessVariables ", languageId:"#defaultLanguageId",
booleanPattern: "#booleanPattern", decimalSeparator: "#decimalSeparator",
datePattern: "#datePattern", quotationMark: "#quotationMark", separator: "#separator",
mappingDefinitions: "updateCatalogFileName\tupdateCatalogPath\t\tupdateContractFileName\tupdateContractPath")
}
on('okay').to(['postImportConversionCatalog'])
}
................
}