How to check if the latest downloaded file is having the current time and date? - ipaf

How to check if the latest downloaded file is having the current time and date using Pace Automation Framework ?

Sample code :
Use a custom tag :
#Tag=getLastModifiedFile, Att1=path, Att2=keyName
getLastModifiedFile=com.tr.execution.activities.GetLastModifiedFile
<activities>
<activity id="ticket">
<getLastModifiedFile path="./sample_xml" keyName="file"></getLastModifiedFile>
<variable keyName="download_file" expression="var x ='${file}'.split('_'); x[5];" ></variable>
<variable keyName="date" expression="var x ='${download_file}'.split('T'); x[0];" ></variable>
<variable keyName="time" expression="var x ='${download_file}'.split('T'); x[1];" ></variable>
<variable keyName="input_date_time" value="${date}${time}" ></variable>
<date timezone="UTC" keyName="output_date_time" format="yyyyMMddhhmm"></date>
<validation valGroupIds="Check_Date"></validation>
</activity>
<valGroup groupId="Check_Date">
<validate variable="input_date_time" condition="equals" value="${output_date_time}" passMsg="PASSED" failMsg="FAILED" desc="VALIDATE TAG" expResult="VALIDATE the validation" >
</validate>
</valGroup>
</activities>

Related

VSCode Accessing Local Created Variable in Natvis [duplicate]

I am developing some debug visualizations for my custom classes in VSCode using Natvis.
Using CustomListItems with a simple example and I can't get it to work.
Basically, I think the following code should display 16 items all with value 1 but I get only the basic type of the class..
<Type Name="vq23_t">
<DisplayString>16 x q23 Array</DisplayString>
<Expand>
<CustomListItems>
<Size>16</Size>
<Variable Name="ind" InitialValue="0" />
<Loop Condition="ind < 16">
<Item Name="{ind}"> 1 </Item>
<exec> ++ind </exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
What I get:
pout: 16 x q23 Array
>[Raw View]: 0x56594b40 <xin>
Spent a lot of time trying various things out so I reduced the problem to this basic level and can't get it to work.
As described on MSDN you can activate logging for debugging natvis.
The solution for your case is to change the order of Size and Variable and to change exec to Exec.
<Type Name="vq23_t">
<DisplayString>16 x q23 Array</DisplayString>
<Expand>
<CustomListItems>
<Variable Name="ind" InitialValue="0" />
<Size>16</Size>
<Loop Condition="ind < 16">
<Item Name="{ind}"> 1 </Item>
<Exec> ++ind </Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>

xsd:assert (complicated character verification)

Is there a way to verify that the template contains only those characters that are passed to #param ?
I considered options with xpath functions(fn:) but have not found a suitable option.
this is 2 valid xml for example:
<rule type="myRule" template="A-B-CB">
<attribute param="B"/>
<attribute param="A"/>
<attribute param="C"/>
</rule>
<rule type="myRule" template="A(C)-B">
<attribute param="C"/>
<attribute param="A"/>
<attribute param="B"/>
</rule>
and 2 not valid xml:
<rule type="myRule" template="AB-CD">
<attribute param="A"/>
<attribute param="B"/>
<attribute param="C"/>
</rule>
<rule type="myRule" template="AC">
<attribute param="A"/>
<attribute param="B"/>
<attribute param="C"/>
</rule>
perhaps there are ideas how to implement it using schematrone or otherwise?
So the set of letters in #template must be exactly the same as the set of letters in ./attribute/#param?
That is to say, distinct-values(string-to-codepoints(replace(#template, '\P{L}', ''))) must be the same set as distinct-values(attribute/#param/string-to-codepoints()).
So how do you assert that two sequences contain the same values, under permutation?
In XPath 3.1, deep-equal(sort($X), sort($Y))
In XPath 2.0, I can't think of anything better than
empty($X[not(.=$Y)]) and empty($Y[not(.=$X)])
I'll leave you to put this all together.

Using XPath to select events that do not match other criteria in Windows event logs

I am trying to develop a Xpath 1.0 compatible filter abiding by the limitations as noted in the answer to Using XPath starts-with or contains functions to search Windows event logs that will match events with event id of 4771 as long as they do not have a certain computer name. Here is sample xml for a 4771 event I do not want to match/display in event viewer.
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-Security-Auditing" Guid="{94849225-5448-4994-A5BA-1E3B0928C30D}" />
<EventID>4771</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>14339</Task>
<Opcode>0</Opcode>
<Keywords>0x8010000000000000</Keywords>
<TimeCreated SystemTime="2017-03-22T20:13:28.105262600Z" />
<EventRecordID>4368371459</EventRecordID>
<Correlation />
<Execution ProcessID="564" ThreadID="1340" />
<Channel>Security</Channel>
<Computer>sample.computer.net</Computer>
<Security />
</System>
<EventData>
<Data Name="TargetUserName">abc$</Data>
<Data Name="TargetSid">S-1-5-21-376469911-3458163162-136990061-477177</Data>
<Data Name="ServiceName">krbtgt/computer.net</Data>
<Data Name="TicketOptions">0x40810010</Data>
<Data Name="Status">0x18</Data>
<Data Name="PreAuthType">2</Data>
<Data Name="IpAddress">::ffff:10.0.0.1</Data>
<Data Name="IpPort">56815</Data>
<Data Name="CertIssuerName" />
<Data Name="CertSerialNumber" />
<Data Name="CertThumbprint" />
</EventData>
</Event>
And here is the unsuccessful filter I have tried. The event is displayed so it is not being properly filtered out, i.e. the targetusername exclusion is not being handled properly.
<QueryList>
<Query Id="0" Path="ForwardedEvents">
<Select Path="ForwardedEvents">*[System[(EventID=4771)]] and *[EventData[Data[#Name='TargetUserName'] and (Data!='abc$')]]</Select>
</Query>
</QueryList>
It appears the (Data!='abc$') portion is being applied to all the Data elements and as long as there is one Data element that does not match the specified value the entire event matches. The intent is that if there is a combination of Data element with a TargetUserName attribute and the value of that element is abc$ then the entire event should not match.
you've correctly understood
*[EventData[Data[#Name='TargetUserName'] and (Data!='abc$')]]
as matching any data element that isn't 'abc$'. What you want is to only consider TargetUserName elements.
*[EventData[Data[#Name='TargetUserName']!='abc$']]
In normal XPath 1.0 environment we can do what you described this way :
*[System/EventID=4771 and EventData/Data[#Name='TargetUserName' and .!='abc$']]
Apparently Windows Event Log's XPath doesn't support any of the following, which left us in a dead-end : ., self::, text(), node(). The closest we can get using XPath might be by assuming that 'TargetUserName', if exists in a given EventData, always appear as the first Data child so we can do as follows :
*[System/EventID=4771 and EventData[Data[1]/#Name='TargetUserName' and Data[1]!='abc$']]

Connect internal numbers on freeswitch

I would like to connect two internal numbers with one, I mean if I call 499 then two phones should ring for example 123, 127.
My .xml files in directory/default looks like this:
<include>
<user id="127" mailbox="127">
<params>
<param name="password" value="xxxx"/>
<param name="vm-password" value="127"/>
</params>
<variables>
<variable name="toll_allow" value="domestic,international,local"/>
<variable name="accountcode" value="127"/>
<variable name="user_context" value="default"/>
<variable name="effective_caller_id_name" value="Extension 127"/>
<variable name="effective_caller_id_number" value="127"/>
<variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
<variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
<variable name="callgroup" value="techsupport"/>
</variables>
similar for 123 and 499 numbers.
How can I change it to make two phones rings(123,127) when someone calls 499?
in your dialplan you should call the bridge application like this.
<extension name="Local_Extension">
<condition field="destination_number" expression="^(1001)$">
<action application="bridge" data="sofia/internal/1001%${server-domain-name},sofia/internal/1002%${server-domain-name},sofia/internal/1003%${server domain-name}"/>
</condition>
</extension>
So if you call to 1001 then it will ring to 1001,1002,1003

Is there a bug in the Advanced Find in MS CRM 2015 online, when in recursive queries? Example: Find Account Branches that belong to Account Branches

No matter what I have tried, I was unsuccessful in getting the Advanced Find feature of MS CRM 2015 online to show me Active Accounts that are of type Branch that have as their parent have an Account type again of Branch.
I have checked and re-checked the data but perhaps there is something wrong with my query in the Advanced Find feature.
Or there is a bug to it.
I have run this query in SQL as well, we have a BigData db that holds our CRM data and there it reveals the correct results (of course).
Here is my query so that you can see:
--BRANCH OF A BRANCH
select [dbo].[fn_getDescFromCRMguid](a.[Parentaccountid]) as [ParentAccountName],
--[fn_getDescFromCRMguid] udf is just a look-up for descriptions and names
( select left(a3.[etf_accountlevel],6)
from [Stg_CRMAccount] a3
where a3.[accountid] = left(a.[parentaccountid],36)
) as [ParentAccountLevel],
[dbo].[fn_getDescFromCRMguid](isnull(a.[owninguser], a.[owningteam])) as [OwningEntity],
a.*
from [Stg_CRMAccount] a
where a.[statuscode] = 'Active::1'
and a.[etf_accountlevel] like 'Branch%'
and a.[Parentaccountid] is not null
and exists (
select 0
from [Stg_CRMAccount] a2
where a2.[statuscode] = 'Active::1'
and a2.[etf_accountlevel] like 'Branch%'
and left(a.[Parentaccountid],36) = a2.[accountid]
)
order by a.[Parentaccountid],
a.[name],
a.[address1_city];
I am also attaching the screenshot of my Advanced Find query and please feel free to comment or let me know of any useful thoughts.
I hope some person has any idea about this because to me it is puzzling.
I have navigated into the resulting Accounts from this and then into their parent Account and it was not a Branch.
Despite the clear (at least to me) specification of the Where clause under the use of the related Entity - Account, using the relation Parent Account.
The plot thickens even more, if you remove the Account Type = Branch for the related Entity and say change the Status = Active to Inactive then it will very correctly find and show only those Branches where their Parent is Inactive.
That leads me to suspect some kind of a recursive error with the query builder they are using.
It finds Account Type = Branch twice and erroneously does not differentiate between the first occurrence which is for the outer selection and the second occurrence which would be for the nested (in the Where clause) selection.
But all that is mere speculation.
I don't really know why it can't handle it.
It begs the question in what other scenarios it can mess up recursive query builds.
Your thoughts?
and here is my fetch XML from the Advanced Find query
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="account">
<attribute name="etf_rating" />
<attribute name="parentaccountid" />
<attribute name="etf_lastcontact" />
<attribute name="etf_city" />
<attribute name="address1_line1" />
<attribute name="etf_accountlevel" />
<attribute name="name" />
<attribute name="ownerid" />
<attribute name="etf_segment" />
<attribute name="accountid" />
<order attribute="name" descending="false" />
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="etf_accountlevel" operator="eq" value="964850002" />
</filter>
<link-entity name="account" from="parentaccountid" to="accountid" alias="ag">
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="etf_accountlevel" operator="eq" value="964850002" />
</filter>
</link-entity>
</entity>
</fetch>

Resources