Powered by Zoomin Software. For more details please contactZoomin

Semaphore Publisher

Generic Command Execution

  • Last Updated: May 13, 2026
  • 2 minute read
    • Semaphore
    • Documentation

Note this functionality has been removed from Semaphore 5.8.2

If, as part of the publication process, you wish to run arbitrary external processes, it is possible to configure an output processor that will do this for you.

Any number of output processors can be defined, and they can be configured to run at any of three stages of the publish process

  • initCommands - Before the model is read - during the initialisation of the publisher.
  • beginCommands - After the model is read but before any other output processing is started.
  • commitCommands - After all other output processors have completed.

To configure an external command running as part of an output processor, include then edit the following in the output processor list within a configuration set:

Step 1: Add this bean as a sibling to the other beans in your publisher config file…i.e. Semaphore-Publisher.xml.

  <bean id="CommandProcessor" class="com.smartlogic.publisher.output.CommandExecuter" >
      <property name="initCommands" >
          <list>
              <bean class="com.smartlogic.publisher.output.RuntimeDefinition" >
                  <property name="command" value="C:\Applications\curl\bin\curl.exe -o C:\temp\bbc.txt http://www.bbc.com" />
              </bean>
          </list>
      </property>
      <property name="beginCommands" >
          <list>
              <bean class="com.smartlogic.publisher.output.RuntimeDefinition" >
                  <property name="command" value="C:\Applications\curl\bin\curl.exe -o C:\temp\bbc.txt http://www.bbc.com" />
              </bean>
          </list>
      </property>
      <property name="commitCommands" >
          <list>
              <bean class="com.smartlogic.publisher.output.RuntimeDefinition" >
                  <property name="command" value="C:\Applications\curl\bin\curl.exe -o C:\temp\bbc.txt http://www.bbc.com" />
              </bean>
          </list>
      </property>
  </bean>

Step 2: Reference the bean in your output processor:

  <bean id="myAllConcepts" parent="AllResources">
      <property name="outputProcessors">
          <list>
              <bean parent="SolrWriterTemplate" >
                  <property name="indexName" value="${model.name}" />
                  <!-- By default the maximum number of paths output will be 10
                  <property name="maxPathCount" value="1000" /> 
                  --> 
              </bean>
              <bean id="NamedEntityRules" parent="RulebaseWriterTemplate" >
                  <!-- Uncomment the line below if you want to generate the rulebases outside of the pak files -->
                  <!-- <property name="rulebaseOutputDirectory" value="config/${model.name}/rulebases"/> -->
                  <!-- Uncomment the line below if you want to write these rulebase files to separate directories dependent on rulebase class -->
                  <!-- <property name="useRulebaseClassDirectories" value="true" /> -->
                  <property name="templateFileName" value="ContextualCitation.kid" />
              </bean>
              <ref bean="rulebasePublisher" />
              <ref bean="CommandProcessor" />
          </list>
      </property>
  </bean>

The CommandExecuter has three key parameters, each being a list of RuntimeDefinitions. You may omit any of these parameters if you do not want processes run at particular stages of the publishing process.

There is an addtional parameter “majorSortOrder”: this determines the order in which the commit stages of the various output processors are run. By default, the external process runner will run after after all other output processors have committed; i.e. the pak files have been sent to CS and the new SES index is live. Setting this value to 45 will run the external processors before pak file publishing and SES index promotion, setting the value to 30 will run the external processor after pak file processing but before SES index promotion.

You can have as many RuntimeDefinitions in each of the three lists, each must have a “command” parameter. Optionally it can have any number of items in the arguments list.

TitleResults for “How to create a CRG?”Also Available inAlert