Code reusability within IEM

Code reusability within IEM
http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=53987

@atlauren thanks for starting this thread. Obviously we have a significant need for code reusability (RFE#53987) within our organization. I think I may have mentioned that a couple times at InterConnect. We’d also like to see other, basic programming functionality like arrays, native error handling, looping, and try-catch-finally blocks. Migrating from TPM is painful because we’re lost all this basic programming functionality in ActionScripting.

1 Like

Are you looking for that in relevance or action script?

1 Like

You can do basically anything through ActionScript by calling off to other languages like VBScript, PowerShell, or generating a .BAT file on the fly using relevance substitution. There are quite a few ways to work around any ActionScript limitations.

If you had a particular example, I’d be interested to hear it.

@greenb Action Script is were we were thinking.

@jgstew you’re not wrong, but the current implementation requires 1-off/new content development for most internal customer requirements in our organization. If we had the ability to loop through a mufti-dimensional array of file names (URL, sha1sum and byte count) and then perform actions based on some specific file attribute or extension, this would allow us to create more generic content and push deployments to operational roles. Sorry, but this is about as specific as I can be on the forum.

I do agree in general that some of these things would be nice in ActionScript, but this is an area I can work around, while relevance is something I cannot. The simplicity of ActionScript is part of what makes it work so well, so extending it to add these more complicated things is hard to do well. Also, because you can use relevance substitution in ActionScript, you can achieve many more complicated things using that.

As @rkorinek points out you can do “looping” by having a task that does what you need for a single case and have it reapply. There are other options as well.

I think it is possible to achieve looping or what you need in a generic way that wouldn’t require one offs every time. You can accomplish quite a lot using relevance substitution.

You can use the create file command or download a file with a list of things in it and then do work based upon the contents of that list.

@jgstew we’re using relevance substitutions and create/append files frequently to work around limitations. The problem I have is that ActionScript seems like a step back from workflows in TPM in these regards.

When I first started using IEM, I too was frustrated by the lack of common techniques I was used to using in other languages. I eventually found a way to do most things by using sets for arrays and reapply behavior for loops. It does not cover all occasions, but many. Feel free to email me with more details if you cannot be more specific on the forum. rkorinek@us.ibm.com.

1 Like