How to call microflow in pluggable widget?

1
Hi, I am creating a pluggable widget. I need call a mircoflow when click a html element. In customized widget(Dojo based), we found  win.mx.data.action  api can be used. I saw some forum post say: this api will be deprecated.    Where can i find the correct way api which can be used in pluggale widget? I have readed all page about pluggable widget in docs.mendx. If have sample codes, it will be perfact!                
asked
3 answers
1

According to the current documentation, you have already found the right function.

(DOC with Examples)


Maybe you have read, that the mx.ui.action function is depricated and can be removed by an update and not the mx.data.action?

(DOC with examples)

answered
0

Hi Haiji,

You can now use the action property in the xml (type = action). When using this, the user can choose what to do: open a page, call a microflow, nanoflow, etc. 

In your code, you can do something like:

if (microflowProp && microflowProp.canExecute) {

microflowProp.execute();

}

Hope this helps!

answered
0

Hi @Johan Munneke

I Folow the guide doc to create a pluggable widget. but the action prop aways empty . could you please help have a look?

 <propertyGroup caption="Events">
            <property key="onChangeAction" type="action" required="false">
                <caption>On change</caption>
                <description/>
            </property>
        </propertyGroup>

export interface InputProps {

    value: string;

    onChangeAction?: ActionValue;

}

export class TextInput extends Component<InputProps> {

 private readonly handleChange = this.onChange.bind(this);

render(): ReactNode {

        return <input type="text" 

        onBlur={this.handleChange}

        value={this.props.value} />;

    }

private onChange(event: ChangeEvent<HTMLInputElement>) {

….

 alert(JSON.stringify(this.props));  // HERE, It aways dispay {value:”xxx”}, have no prop of onChangeAction 

 if (this.props.onChangeAction) {

            alert("XZXX"+event);

            

            this.props.onChangeAction.execute();

        }else{

            alert("NO:"+event);

        }

END

answered