Custom action should only executed for particular DcumentType

Hi @machak and @jasper.floor,

Appreciate your help for custom action class.

Now I want to execute those custom class for particular document type.

For example if I have defined 3 document types such as “News”, “Product” & “ContactUs” then it should get executed only for “News” document type when it is published and NOT for others.

I tried to find but no luck for how we can get document type details in hipposcxml:scxml file so that based on condition my above requirement will satisfy.

Need your help!.
Thanks.

You may be better served by using a workflow event

1 Like

Although, it depends on what you are tryng to achieve. Does it need to be done on publish? Perhaps a validator can do what you want instead. That works on save though.

1 Like

Thanks for your quick reply, yes, it need to be done on publish.

Then a workflow event listener is probably better than a custom workflow action. Though it could be done on transition into publish state. You’d have to add some logic to check the type. I think it may be possible in scxml, but I’m not sure it’s worth it to figure it out. Responding to a workflow event is easier to understand and implement in this case.

1 Like

Hi @jasper.floor, can you help me to get document type in hipposcxml:scxml file?, I tried to find out how we can get and check type in scxml but not able to achieve it, will be highly appreciated if you can help me!!!.

Hi all,

I need your help for above query, can anyone help me out.

Thanks,

I believe you can get the node being handled from the workflow context. But I don’t have a ready solution for you, I’d have to try it out myseld. I highly recommend you look into workflow event listeners instead.

1 Like

Hi @jasper.floor ,

Above I have fixed, now I am trying to get fields that is related to myproject i.e. name, email …, I can read workflowData.documents[‘draft’].availability but I am unable to get for myproject:name, how I can modify my expression so that it could read name, dob,email …etc fields of myproject.

This is not working : workflowData.documents[‘draft’].name,
name, dob,email, all fields are coming from my custom template.