Monday, 24 September 2012

Clean way to restart your livelink services

Sometimes you would like to restart your livelink services for adding patches, upgrading modules or just like that. The best practice to do a restart is listed below.

  1. First we Log-in to server where the web server is installed (In this case : IIS)
  2. We take Livelink server out of load balanced pool by changing the HTTP port (Lets put  a no. like 9191 which is not used)
  3. We then check if there are any requests pending with the Livelink server we want to restart.
    So let check the thread status - http://IPAddress:port/cgi/livelink.exe?func=admin.threadstatus
    If there is something running, we wait till those processes are over and then proceed further
  4. Apply the patch or do the module upgrade that you want and restart the server.
  5. Now we put the Livelink server back into load balancer by changing the port back to original. (i.e. 80).
  6. Repeat the above for all servers.

Thursday, 22 March 2012

How do I create my own Agent in Livelink


Did you ever wonder who sends all those email notification when any action is performed in Livelink  about which you would like to get notified or do those workflow steps that no other users want to perform....Think Think...


The answer is simple.. 
There are some agent quietly running in background, some of which are responsible to send those notification emails or doing those workflow steps :)




Now, can we write our own Livelink Agent? - Yes, we can and it quite easy too..


And those easy steps are

  1. Orphan the node LLAgent:Agent node in your custom module
  2. Create a child node and give it a fancy name (say myFirstAgent)
  3. Give it a Id. Override the fAgentID (This id goes into your agentschedule table and should be a value above 9999)
  4. Enable it my setting fEnabled to true
  5. And put the code that you want to run in the Execute method.
  6. Do entry in AgentSchedule table with Enable set to true and other details. 
You also make a custom admin page to set the bitmask and enter the values in the agentschedule table. According to the bitmask the agent will run on a periodic basis.

For testing purpose, you can run the agent using a simple URL http://hostname/livelink/livelink.exe?func=agent.runagent&agent_list={'id1','id2'}

Just make sure that RunWithoutLogin is set to true in your ini file before trying the above URL.


Hope I made sense :)



Vote of thanks to Siva Thanneru, friend and ex-team mate who wrote the first agent for my project :)

Thursday, 1 March 2012

Replacement Tags are really useful when we are working Livelink Forms and Workflows. We can use replacement tag to display logged-in user information in a form or to get attribute and form values or use it for workflow related values like work id, workflow title, etc.

Lets start with the Form Replacement Tag :

I want to display information about the logged in user when I open my form. Lets see how we can achieve it.

An sample Form Template is shown below. I want the username and the email id to pre-populate when I open the form.


My first step is I export my template in HTML format using Export As HTML and edit the value attribute of my input tags (as shown in Fig 2). I can add this edited HTML as an HTML View to the template and create forms to store data in Livelink or initiate workflows.


When I open my form. My name and my email Id is pre-populated from the KUAF Table.



____________________________________________________________________________

Dynamic Replacement Tags : Let take the example and understand the tags. When I click Apply button for the form shown above I initiate a workflow with the name Workflow ID -<Username>_<Office Location>_<Initaition Date>

We can do this using very simple replacement tags as the Title in the General tab of Workflow Settings. I use the following tags to meet my requirements
  • <WorkID /> to show the unique ID associated to the workflow
  • <DataType_1_4_1_Username /> to get the name from the form
  • <DataType_1_4_1_Office Location /> to specify the Office Location specified by the user in the form.
  • <InitiatedDate /> to shows the date




Some ready to use, self-explanatory tags are 

  • <Initiator /> 
  • <InitiatedDate />
  • <WorkflowTitle />  
  • <ParentTitle />    
  • <SubInitiatedDate />   
  • <WorkID />    
  • <InitiatorMail />  

To use Form Attributes, we can use the the tag <DataType_1_4_FormId_AttrName />


To get the form Id, go the the Forms tab in workflow setting page and click on Edit. The URL in the address bar has the unique form id associated to a particular form eg: http://livelink/livelink/livelink.exe?func=formwfpaint.FormEdit&MapID=1234567&FormID=1&nextURL=...




To get workflow attribute is easy just use the tag <DataType_1_3_AttrName /> 


We can use these tags to define step names, to give instructions, or to/body field of a process step. 

An useful link from KC.


__________________________________________________________________________

If u have livelink XML Workflow Extension module installed then you get lot placeholder to do a lot of things. Few useful tags are [title] that returns the workflow title, [mapid] unique id for the workflow instance. The list of placeholder available with this module is quite long and exhaustive. 
Best place to get the placeholder is the Livelink Help section 'XML Workflow Extensions'

To get workflow attribute, we use a placeholder [attribute=<attribute>:<attribute field>]  and for form attribute a placeholder [form=<formname>:<set>:<attribute>]

Learning by example




We have a form template with attributes called username, email id, office location. We also have a Set added to the template which has three attributes called House No, Street Name and ZIP Code.



This form template is added to the workflow with the name Initiation Form.









An sample Email step body field may look like this