PartConfiguration

Document Actions
last edited 3 years ago by amehrabyan

Part Confuguration contains:

  • Part description
  • Terminals (Pins)

Part description

Part description contains name of the part, reference to the implematations code (classname), sourcename (the name of the current file), and type

 <!ELEMENT part (terminals)>
 <!ATTLIST part
    name CDATA #IMPLIED                 - display name of part
    classname CDATA #IMPLIED            - class name that 'atomic' part points 
    sourcename CDATA #IMPLIED           - not used reserved for future use
 >

Example:

 <part  name="HelloWorld"  classname="org.vcb.parts.sample.HelloWorld">

Pins

Part configuration contains inpin, outpins and inoutpin desciption

 <!ELEMENT terminals (outpin|inpin|inoutpin)*>

Inpins contains pin description and parameters:

 <!ELEMENT inpin (parameter)*>
 <!ATTLIST inpin
    id CDATA #REQUIRED                  - unique id in the scope of part (range from 1 - 50)
    name CDATA #IMPLIED                 - display name of pin
    method-name CDATA #REQUIRED         - refer to Java method
    run-as-default CDATA #IMPLIED       - if set 'true' then pin will be fired at part start up (instantiation time) with declared values
  >

Example:

 <inpin id="1" name="hello" method-name="sayHello" >
     <parameter type="java.lang.String" name="name" default-value="Buildap" />
 </inpin>

Similarly outpins:

 <!ELEMENT outpin (parameter)*>
 <!ATTLIST outpin
    name CDATA #REQUIRED                - display name of pin
    id CDATA #REQUIRED                  - unique id in the scope of part (range from 51 - 99)
 >

Example:

 <outpin id="51" name="GREETING" >
      <parameter type="java.lang.String" name="message" />
 </outpin>

When the same method is used both of inpin and outpin (via return) then inoutpins are used. Inout pins have two ids - one for inpin and one for outpin, and also contain the return type and outpin name. Graphically inout tag will be shown as two separate in and out pins.

 <!ELEMENT inoutpin (parameter|result)*>
 <!ATTLIST inoutpin
    name CDATA #IMPLIED                 - display name for inpin
    method-name CDATA #IMPLIED          - points to Java method
    id CDATA #REQUIRED                  - unique id in the scope of part (range from 1 - 50) serve as inpin id
    out-id CDATA #REQUIRED              - unique id in the scope of part (range from 51 - 99) serve as outpin id
    out-name CDATA #IMPLIED             - display name for outpin
  >

 <!ELEMENT result EMPTY>
 <!ATTLIST result
    type CDATA #REQUIRED                - fully qualified Java type
    name CDATA #IMPLIED                 - display name for result as parameter is provided
    array CDATA #IMPLIED                - if set 'true' type will be processed as array
  >

Example:

 <inoutpin id="2" name="hello2" method-name="sayHello2" out-id="51" out-name="GREETING" >
      <parameter type="java.lang.String" name="name" />

      <result type="java.lang.String" />
 </inoutpin>

Parameters:

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT parameter EMPTY>
 <!ATTLIST parameter
    type CDATA #REQUIRED
    name CDATA #IMPLIED
    array CDATA #IMPLIED
    default-value CDATA #IMPLIED    default value will be used if no other provided 
  >

Example:

 <parameter type="int" name="pogos" array="false" default-value="1000"  />

Array type can be used in parameters for pins - in configuration files

 <parameter type="String" name="param0" array="true" />

In test files arrays can be build for testing

 <parameter type="String" array="true" >
        <parameter type="String" >OpenAction</parameter>
        <parameter type="String" > OpenLocationAction </parameter>
 </parameter>

 <parameter type="String" array="true" >
        <parameter type="String" array="true" >
                <parameter type="String">       OpenAction      </parameter>
                <parameter type="String">   OpenLocationAction  </parameter>
        </parameter>
        <parameter type="String" array="true" >
                <parameter type="String">       OpenAction      </parameter>
                <parameter type="String">   OpenLocationAction  </parameter>
        </parameter>
 </parameter>

Empty tag denotes empty value for example

 <parameter type="java.lang.String" ></parameter>

Mean empty string. In case if null paramter is needed then spesial tag should be used

 <parameter type="java.lang.String" ><null/></parameter>

Default values usage. In case if parameters provided partially then (if present) default values are used. If inpin declaration has run-as-default="true" then defalut value will be fired at start up time also.

 <inpin id="1" name="hello" method-name="sayHello" run-as-default="true" >
     <parameter type="java.lang.String" name="name" default-value="Buildap" />
 </inpin>

PartConfigurationExample

PartImplementationExample (Java code)

Part DTD

Part configuration has the following dtd

 <?xml version='1.0' encoding='UTF-8'?>

 <!--
    Typical usage:

    <?xml version="1.0"?>

    <!DOCTYPE part SYSTEM "part.dtd">

    <part>
    ...
    </part>
 -->

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT part (terminals)>
 <!ATTLIST part
    name CDATA #IMPLIED
    classname CDATA #REQUIRED
    sourcename CDATA #IMPLIED
 >

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT terminals (outpin|inpin|inoutpin)*>

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT inpin (parameter)*>
 <!ATTLIST inpin
    id CDATA #REQUIRED
    name CDATA #IMPLIED
    method-name CDATA #REQUIRED
    run-as-default CDATA #IMPLIED
  >

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT outpin (parameter)*>
 <!ATTLIST outpin
    name CDATA #REQUIRED
    id CDATA #REQUIRED
 >

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT inoutpin (result, (parameter)*)>
 <!ATTLIST inoutpin
    name CDATA #IMPLIED
    method-name CDATA #IMPLIED
    id CDATA #REQUIRED
    out-id CDATA #REQUIRED
    out-name CDATA #IMPLIED
  >

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT result (parameter)*>
 <!ATTLIST result
    type CDATA #REQUIRED
    name CDATA #IMPLIED
    array CDATA #IMPLIED
  >

 <!--- Put your DTDDoc comment here. -->
 <!ELEMENT parameter (parameter)*>
 <!ATTLIST parameter
    type CDATA #REQUIRED
    name CDATA #IMPLIED
    array CDATA #IMPLIED
  >