Advanced Artisan APC-Metadata.xml File

    This is an example of an advanced apc-metadata.xml file for use with Axeda Artisan that includes examples of how to create different data structures on the platform, including Expression Rules and System Timers.

     

    Step 1 - In the upload.xml make sure the artisan-installer is 1.2

        <dependencies>
            <dependency>
                <groupId>com.axeda.community</groupId>
                <artifactId>artisan-installer</artifactId>
                <version>1.2</version>
            </dependency>
        </dependencies>
    

     

    Step 2 -

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
            apc-metadata.xml
    -->
    <apcmetadata>
        <models>
            <model>
                <name>DemoModel</name>
                <!--standalone or gateway-->
                <type>gateway</type>
                <DataItems>
                    <DataItem>
                        <name>PendingMessage</name>
                        <!--string or digital or analog-->
                        <type>string</type>
                        <visible>false</visible>
                        <stored>true</stored>
                        <!--0 = no history,1 = Stored,2 = no storage,3 = on change-->
                        <storageOption>2</storageOption>
                        <readOnly>false</readOnly>
                    </DataItem>
                    <DataItem>
                        <name>ConsumableData</name>
                        <!--string or digital or analog-->
                        <type>string</type>
                        <visible>false</visible>
                        <stored>true</stored>
                        <!--0 = no history,1 = Stored,2 = no storage,3 = on change-->
                        <storageOption>2</storageOption>
                        <readOnly>false</readOnly>
                    </DataItem>
                </DataItems>
            </model>
        </models>
        <ruleTimers>
              <ruletimer>
                  <name>SFTP Retry</name>
                  <description></description>
                  <!--midnight gmt-->
                  <schedule>0 0 0 * * ?</schedule>
                  <rules>
                      <rule>SFTP Retry</rule>
                  </rules>
              </ruletimer>
        </ruleTimers>
        <expressionRules>
                    <rule>
                <name>SFTP Retry</name>
                <description></description>
                <enabled>true</enabled>
                <applyToAll>true</applyToAll>
                <type>SystemTimer</type>
                <ifExpression><![CDATA[true]]></ifExpression>
                <thenExpression>
                    <![CDATA[ExecuteCustomObject("SFTPRetry")]]></thenExpression>
                <elseExpression></elseExpression>
                <consecutive>true</consecutive>
                <models>
                    <model>DemoMOdel</model>
                </models>
            </rule>
        </expressionRules>
        <customobjects>
            <customobject>
                <name>GetChartData</name>
                <type>Action</type>
                <sourcefile>GetChartData.groovy</sourcefile>
                <params>
                    <param name="username" description="(REQUIRED) The name of the calling user"/>
                </params>
            </customobject>
            <customobject>
                <name>GetChartData_rss</name>
                <type>Action</type>
                <sourcefile>GetChartData_rss.groovy</sourcefile>
                <params>
                    <param name="username" description="(REQUIRED) The name of the calling user"/>
                </params>
            </customobject>
            <customobject>
                <name>GetAddress</name>
                <type>Action</type>
                <sourcefile>GetAddress.groovy</sourcefile>
                <params>
                    <!--<param name="username" description="(REQUIRED) The name of the calling user"/>-->
                </params>
            </customobject>
        </customobjects>
    
        <applications>
            <application>
                <description>Chart Example</description>
                <applicationId>chartexample</applicationId>
                <indexFile>index.html</indexFile>
                <!--<zipFile></zipFile>-->
                <sourcePath>artisan-starter-html/src/main/webapp</sourcePath>
            </application>
        </applications>
    
    </apcmetadata>