cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

4000 character limit for the workflow expression.

snair-2
1-Newbie

4000 character limit for the workflow expression.

Hi,

I'm trying to create a workflow, where I have to add some validation on a specific Task.

However, when I try to add my validation in the Transition tab's "Complete" phase... I find there's a restriction of 4000 characters.

I would like to know, is there a way this limit can be exceeded if not what is possible solution.

I would also like to know why is there a such a limit or what restricts the developers of this tool to provide more number of characters.

Thanks

Satish Nair

3 REPLIES 3
MatthewKnight
4-Participant
(To:snair-2)

I didn't research the character limit or how to change it. I think it's just bad practice to put a lot of code into a workflow expression. It's difficult to change. Just create your own classes to be called by the workflows.

For example, instead of putting this into an expression directly:

WTDocument doc = WTDocument.newWTDocument();

doc.setX

doc.setY

doc.setZ

save(doc)

Link link = Link.newLink(primaryBusinessObject,doc)

save(link)

Create this:

pubic class XYZ {

public static WTObject doXYZ(WTObject primaryBusinessObject, ObjectReference self) {

WTDocument doc = WTDocument.newWTDocument();

doc.setX

doc.setY

doc.setZ

save(doc)

Link link = Link.newLink(primaryBusinessObject,doc)

save(link)

return primaryBusinessObject;

}

}

And put this in your workflow expression:

primaryBusinessObject = com.example.XYZ.doXYZ(primaryBusinessObject,self);

That way, if you ever decide you don't want to create that doc and link (or you want to change how you do it), you can change your XYZ class and the changes will take effect in ALL processes immediately. No need to change the template and only get your change for new processes.

Ditto.

Adding just the comment that a large number of unrelated methods can all be in a single class.

Thanks Matt... it was vey helpfull

Top Tags