on ‎2018 Jul 10 12:56 PM
I'm geting the following error:
[AbstractProcessContextStrategy] Failed to lookup BaseSite for BusinessProcess [forgottenPassword-home2019@gmail.com-1531153262830]. Unable to setup site in session.
WARN [TaskExecutor-master-1978-ProcessTask [8798223106998]] [GenerateEmailAction] Could not resolve the content catalog version, cannot generate email content
any ideia what is the problem?
Request clarification before answering.
this was a bug from hybris 6.6.
just add the following bean to your customcore-spring.xml
<bean depends-on="processContextResolutionStrategyMap" parent="mapMergeDirective">
<property name="key">
<value type="java.lang.Class">de.hybris.platform.processengine.model.BusinessProcessModel</value>
</property>
<property name="value" ref="storeFrontProcessContextStrategy"/>
</bean>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, you are right!
the problem happens here "DefaultProcessContextResolutionStrategy.java" "getStrategy" method when Hybris uses findeFirst
getProcessStrategyMap().entrySet().stream().filter(e -> e.getKey().isAssignableFrom(businessProcessModel.getClass())).**findFirst()**.map(Map.Entry::getValue);
}
you will get 2 strategies and the one that works is "storeFrontProcessContextStrategy" but I'm not sure if it is a good idea to force storeFrontProcessContextStrategy instead of BusinessProcessModel
You can use this implementation in order to find the most specific/suitable class:
@Override
protected Optional<ProcessContextResolutionStrategy<BaseSiteModel>> getStrategy(BusinessProcessModel businessProcessModel)
{
Class<?> processClass = businessProcessModel.getClass();
ProcessContextResolutionStrategy<BaseSiteModel> strategy = getProcessStrategyMap().get(processClass);
if (strategy == null)
{
Class<?> bestClass = findMostSpecificClass(processClass);
strategy = getProcessStrategyMap().get(bestClass);
}
return Optional.of(strategy);
}
private Class<?> findMostSpecificClass(Class<?> processClass)
{
Class<?> mostSpecific = null;
Set<Class<?>> supportedClasses = getProcessStrategyMap().keySet();
for (Class<?> supportedClass : supportedClasses)
{
if (!supportedClass.isAssignableFrom(processClass))
{
continue;
}
if (mostSpecific == null || mostSpecific.isAssignableFrom(supportedClass))
{
mostSpecific = supportedClass;
}
}
return mostSpecific;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I posted a detailed answer on the similar issue. Please visit the following link if you are interested more on this topic.
https://answers.sap.com/questions/12770693/failed-to-lookup-basesite-for-businessprocessunabl.html
Thanks,
Sriharsha K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
final ReportSizesWithoutStockModel reportFrontProcessModel = (ReportSizesWithoutStockModel) getBusinessProcessService()
.createProcess("reportSizesWithoutStockEmailProcess" + System.currentTimeMillis(),
"reportSizesWithoutStockEmailProcess");
reportFrontProcessModel.getProcessDefinitionName();
reportFrontProcessModel.setSite(baseSiteService.getCurrentBaseSite());
reportFrontProcessModel.setStore(baseStoreService.getCurrentBaseStore());
getModelService().save(reportFrontProcessModel);
getBusinessProcessService().startProcess(reportFrontProcessModel);
I have the same problem with this lines.
Regards,
César.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vitor
You need to set current site in the process.
StoreFrontCustomerProcessModel forgotEmailProcess = businessProcessService .createProcess("forgotEmailProcess-" + System.currentTimeMillis(), "forgotEmailProcess");
forgotEmailProcess .setSite(site);
forgotEmailProcess .setLanguage(site.getDefaultLanguage());
forgotEmailProcess .setStore(baseStore);
modelService.save(forgotEmailProcess );
businessProcessService.startProcess(forgotEmailProcess );
Regards,
Yashwanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.