Expand my Community achievements bar.

How to track workflow from being edit?

Avatar

Level 2

Hi Everyone,

I have some work policy to enforce some fields in the workflow properties after someone edit the workflow.

I try to use the XML tag <leave> and put it into xtk:workflow input form to check after someone edit the form but it is not working.

 

I'm not quite sure that I'm doing at the correct location or not.

Please suggest.

Thank you.

 

 

9 Replies

Avatar

Community Advisor

Hello XyNaiz,

Yes, you can use the <leave> element on the xtk:workflow form.

If you wnat to force some fields to be set, use the <set> element :

<leave>
 <if expr="[/ignored/@type]='a'">
  <set value="1" xpath="@myField"/>
 </if>
 <if expr="[/ignored/@type]='b'">
  <set value="2" xpath="@myField"/>
 </if>
</leave>

You can use this on container, subForm or at the end of the global form.

You can use temporary fields (not saved) with /tmp or /ignored elements.

Cédric

Avatar

Level 2

Hi CedricRey,

Thanks for the reply.

I try to put the <leave> at the end of the form but as I said - look like it not working as expect.

Here is my sample code that I have added into the xtk:workflow form. --> Just try to modify the history field in the workflow properties to 31.

Not sure what I did wrong :'(

XyNaiz_0-1620201017474.png

 

Avatar

Community Advisor

Hello XyNaiz,

It can be difficult to debug console forms.

I gave it a try, but I change one thing in the <leave> element, can you try this in your side ? I change the value attribute to expr. (if your field is a string, please add the quote marks '')

 

  <leave>
    <set expr="desc + ' form test...'" xpath="desc"/>
  </leave>
</form>

 

 

Also, the change is only available when user save the workflow (so an another change has to be made). If the form is opened and close without change, the attribute is not updated. If needed, there may be a solution (I know there is some "setNotifySaved" or other things that could help)

Cédric

Avatar

Level 2

Hi Cedric,

I try to do like this but still not working :'(

 

   <leave>
     <set expr="31" xpath="@history"/>
   </leave>
</form>

 

XyNaiz_0-1620205138335.png

 

The field is integer

XyNaiz_1-1620205264790.png

 

Avatar

Level 2
I can do this <leave> modification on nms:delivery form -> it working fine. Not sure that is there any limitation on changing the xtk:workflow form or not.

Avatar

Community Advisor

Hi XyNaiz,

You can certainly change the xtk:workflow, I did it a lot of time (and very carrefully...).

The example I gave you (<set expr="desc + ' form test...'" xpath="desc"/>) add some text to the "desc" element of the workflow, and I tested it successfully this morning.

I just did the exact same modification as you, and it worked. Also, 2 important things to know :

- When you edit the workflow form, you have to "refresh" this one into the console. Just leave the "workflow" view in the Explorer (select anything else like "Delivery" view,"Recipient" I don't know). Then come back into the workflow view, it should refresh the form. The other thing that most user do (and I don't suggest to do this as it is not necessary most of time) is to clear the console cache : File Menu > Clear local cache (or something like that, my console is not in english sorry). A tip to see if your modifications are updated into the console is to change something clearly visible into the interface (for example, change the properties button label adding "1" to the end, you can increment this during your developements )

- User have to do a modification to the workflow (for example, add just a space at the end of label) and save to execute the "set" order and change the @history value.

 

Cedric

Avatar

Level 2

Hi Cedric,

Look like it working at workflow level but it not apply for the workflow in the campaign as my test result.

Do I need to modify another form if aim to do it for the workflow in the campaign?

Avatar

Community Advisor
Hi XyNaiz, I'm not expert on this but you can try to get a look at the nms:operation form maybe ? I know this one is the view of your operation, an the container with name="sc_workflow" seems to be the workflow view you're looking for (but I can be totaly wrong). Remember, you can use the leave tag on input, subform etc.

Avatar

Administrator

Hi @XyNaiz,

Were you able to resolve this query with the given solution or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa