cancel
Showing results for 
Search instead for 
Did you mean: 

Backoffice wizard is NOT triggered after action execution

former_member960891
Discoverer
0 Kudos

Hello everyone,

I have created a product list view action button which triggers a custom action. For some reason after action execution the wizard that I expect to show up is not triggered at all.

These are my action definition, action class and action configuration:

<code><?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved
-->
<action-definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="com.danfoss.b2b.backoffice.actions.portfolio.bulk" xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/action-definition.xsd">
   <name>Portfolio Import Action</name>
   <description>Action providing import of bulk Customer Portfolio data from CSV</description>
   <author>danfoss</author>
   <version>1.0</version>
   <actionClassName>com.danfoss.b2b.backoffice.actions.portfolio.bulk.PortfolioBulkImportAction</actionClassName>
   <sockets>
      <output id="typeCode" type="java.lang.String" />
   </sockets>
   <iconUri>icons/icon_action_import_portfolio_bulk_default.png</iconUri>
   <iconDisabledUri>icons/icon_action_import_portfolio_bulk_disabled.png</iconDisabledUri>
   <iconHoverUri>icons/icon_action_import_portfolio_bulk_hover.png</iconHoverUri>
</action-definition>

package com.danfoss.b2b.backoffice.actions.portfolio.bulk;

import com.hybris.cockpitng.actions.ActionContext;
import com.hybris.cockpitng.actions.ActionResult;
import com.hybris.cockpitng.actions.CockpitAction;
import com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware;
import org.apache.commons.lang3.StringUtils;

public class PortfolioBulkImportAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<String, String>
{
protected static final String SOCKET_OUT_TYPE_CODE = "typeCode";

public ActionResult<String> perform(ActionContext<String> ctx) {
var result = new ActionResult<String>("error");

if (ctx != null && StringUtils.isNotEmpty(ctx.getData())) {
this.sendOutput(SOCKET_OUT_TYPE_CODE, ctx.getData());
result.setData(ctx.getData());
result.setResultCode("success");
}

return result;
}

@Override
public boolean canPerform(ActionContext<String> ctx) {
return StringUtils.isNotEmpty(ctx.getData());
}

}

context type="Product" component="listviewactions" merge-by="type">
      <y:actions>
         <y:group qualifier="portfolio" show-group-header="false" show-separator="true">
            <y:action action-id="com.danfoss.b2b.backoffice.actions.portfolio.bulk" property="pageable.typeCode" />
         </y:group>
      </y:actions>
   </context>

These are the widget definition with socket connections:

<?xml version="1.0" encoding="UTF-8"?>
<!--PORTFOLIO BULK ASSIGNMENT -->
<widget id="portfolioBulkFlowContextCreator" widgetDefinitionId="com.hybris.cockpitng.widgets.common.propextractor" slotId="cockpitWidgetChildrenInvisible" template="false">
   <setting key="expression" type="String">{
			TYPE_CODE:#root
			, configurableFlowConfigCtx:'portfolio-bulk-wizard'
			}</setting>
   <setting key="socketDataType_$T" type="String">java.util.Map</setting>
   <virtual-sockets />
</widget>

<widget-connection sourceWidgetId="STUB_com.danfoss.b2b.backoffice.actions.portfolio.bulk" outputId="typeCode" targetWidgetId="portfolioBulkFlowContextCreator" inputId="genericInput" />
   <widget-connection sourceWidgetId="portfolioBulkFlowContextCreator" outputId="genericOutput" targetWidgetId="configurableFlow" inputId="context" />
						

And finally my wizard definition:

<code>
   <context type="Product" component="portfolio-bulk-wizard" merge-by="type">
      <wz:flow id="portfolioBulkWizard" title="portfolio.bulk.assign.title" show-breadcrumb="true">
         <wz:prepare id="portfolioBulkWizardPrepare">
            <wz:initialize property="portfolioMode" type="PortfolioMode" />
            <wz:initialize property="bulkCSV" type="Media" />
         </wz:prepare>
         <wz:step id="step1" label="portfolio.bulk.wizard.essential.label" sublabel="portfolio.bulk.wizard.essential.sublabel">
            <wz:content id="step1.content">
               <wz:property qualifier="portfolioMode" description="Portfolio Mode to use" label="portfolio.bulk.wizard.portfolio.mode.label" />
               <wz:property qualifier="bulkCSV" description="CSV file to upload" label="portfolio.bulk.wizard.bulk.csv.label" type="com.hybris.cockpitng.editor.defaultfileupload.FileUploadResult" editor="com.hybris.cockpitng.editor.dndfileupload" validate="false">
                  <wz:editor-parameter>
                     <wz:name>accept</wz:name>
                     <wz:value>text/csv</wz:value>
                  </wz:editor-parameter>
                  <wz:editor-parameter>
                     <wz:name>singleLineMode</wz:name>
                     <wz:value>true</wz:value>
                  </wz:editor-parameter>
               </wz:property>
            </wz:content>
            <wz:navigation id="step1.navigation">
               <wz:cancel />
               <wz:done />
               <!--
						<wz:custom label="excel.import.wizard.button.label" handler="excelImportHandler"
							visible="excelForm.excelFile!=null"/>
					-->
            </wz:navigation>
         </wz:step>
      </wz:flow>
   </context>
</config>

Could you share if I miss something in these configurations ? Thanks in advance!

pavan_joshi1
Participant
0 Kudos

<contexttype="Product" component="portfolio-bulk-wizard" merge-by="type"><wz:flow id="portfolioBulkWizard" title="portfolio.bulk.assign.title" show-breadcrumb="true">


Is this component part right ? It should be create-wizard right ?

If this is something custom, you need to define its context in wizards XML.

Just my question! sorry if am not right.

Accepted Solutions (0)

Answers (0)