6

I would like to create workflow using SDL Tridion 2011 SP1, and i am going through the documentation in the live content portal.

I have few questions when I go through the documentation as follows:

  1. Can I use C# (TOM.NET) for automatted activities/decisions? or should I use only VBScript (TOM)? Is there any sample code given in the live content portal for automatted activity/decision?

  2. If C# (TOM.NET) is not allowed to use in workflows, why are its namespace/class/member references given there in TOM.NET API file?

  3. If VBScript only allowed to use in WF, where can I get code/TOM API reference in SDL live content? As of now I dont have access to SDL Tridion server to get the documentation from the installer package.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Jey
  • 2,137
  • 4
  • 22
  • 40

4 Answers4

9

Can I use C# (TOM.NET) for automated activities? Or should I use only VBScript (TOM)?

You can use the TOM within your C# code to write automated activities. There is a primary interop assembly provided for that purpose (IIRC).

Is use of TOM.NET allowed in workflows?

Accessing workflow items from within existing TOM.NET code (i.e. a TBB or DataExtender) is supported. So you can query items that are in workflow, kick off workflows, etc.. But using the TOM.NET for writing automated workflow activities is not supported.

The reason for this has something to do with incompatible threading models from what I recall. But I mostly just took the word of the developers for it; they are bound to know better than me.

Where can I get code/TOM API reference?

API reference documentation for Tridion is not in LiveContent, but instead is delivered in CHM (or zipped JavaDoc) files. The latest documentation for the TOM API can be found in the "SDL Tridion 2009 full documentation" zip on the Tridion 2009 documentation page on SDL Tridion World (login required).

Thanks to Quirijn and Alvin for pointing this out in the comments.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Hi Frank, thanks for your time and answer, i have answered my question based on my understadning. Pleae validate. – Jey Jun 25 '12 at 11:36
  • The steps sound good, but please stick to the Q&A format of this site: although the steps you provide are very helpful, they don't answer to the 3 questions you asked. – Frank van Puffelen Jun 25 '12 at 11:45
  • Anyone know the answer to question #3? I cannot find the TOM api docs anywhere. They were shipped with all versions up to and including 2009 (Templating and Customization Manual TOM 2009.chm). – Quirijn Jun 25 '12 at 13:18
  • You need to get them from an older version. If you don't have access to an older Tridion version, you can request them through SDL Customer Support or one of your SDL WCMS contacts. – Frank van Puffelen Jun 25 '12 at 14:40
  • www.sdltridionworld.com has the older documentation under Downloads > Documentation. – Alvin Reyes Jun 25 '12 at 20:35
0

You can use C# for automated tasks. Create a class and sign it with:

[ProgId("[Namespace].[Class Name]")]
[ComVisible(true)]

And sign the assembly with RegAsm.exe with the /codebase parameter.

Then in the Script of the automated action you can use this object.

Arjen Stobbe
  • 1,684
  • 9
  • 15
-1
  1. Create the workflow diagram (based on the requirement) using visio after installing the visio plugin.
  2. upload the workflow into SDL Content Manager by providing the credentials and choosing the relevant publication.
  3. For automatted activities: create a c# class library and refer the tridion dll's, and user progid and comvisible = true in the solution.
  4. create the necessary functions for your workflow.
  5. register the assembly in the SDL Tridion Content Manager server.
  6. in the workflow "Edit script" use vb script code to get the C# object and its methods.
  7. This will simplify the VBScript code and provide flexibility to the developr to work in c#.
Jey
  • 2,137
  • 4
  • 22
  • 40
-2

It is fine to use the TOM .Net API. However we must consider that we would need to create Session instances since our new TOM .Net for Workflow won't allow you to pass a WorkItem instance from VBScript (Code Tab in Visio for Automatic Activities) and you are forced to pass the TcmUri for that WorkItem. The session creation is mandatory in order to get Tridion objects instantiated since you just have a tcmuri. The recommendation here is to use the C# class registered as a COM class by using the ComVisible and ProgId attributes but use the CoreServices for all the processing in your Com Visible class.

If you use the Core Services for processing you won't need to take care of sessions creations and your core would be much faster and scalable. You might be interested in use a TCP binding or a Net Pipes binding for performance obviously.

Eric Huiza
  • 393
  • 1
  • 4
  • 4
    Eric, using TOM.NET in Automatic Activities is not supported, so it is not fine to use it. – Nuno Linhares Jun 25 '12 at 19:49
  • 1
    Thanks for posting, @Eric. You might also be interested in the [Area 51 proposal Tridion-specific proposal](http://area51.stackexchange.com/proposals/38335/tridion?referrer=V2-BIZVA0gmNn9xqeeO2NA2). Sign up with the same SO account if you have a moment. – Alvin Reyes Jun 25 '12 at 19:51
  • Nuno, yes I know TOM.NET is not supported that is why I am pushing using Core Services – Eric Huiza Jun 25 '12 at 21:18