Private Function returnHostJob(ByVal e As String) As Stringqui me renvoie bien la donnée.
If Not IsNothing(e) Then
Dim myLinkJob = From items In MyDoc.Root.Elements("JobApplicationServers").Elements("JobApplicationServer") _
Where items.Attribute("name").Value = e _
Select items
Return myLinkJob.Elements("Properties").Elements("Property").Attributes("value")(2).Value & " (" & e & ")"
Exit Function
End If
Return e
End Function
</JobApplicationServer>
<JobApplicationServer name="PRD_M3" comment="Connexion M3 au serveur AS400 de Production" type="M3">
<Properties>
<Property key="VTM3_PASSWORD" value="Klj32+gG"/>
<Property key="VTM3_PORT" value="6800"/>
<Property key="VTM3_SERVER" value="AMO102P"/>
<Property key="VTM3_USER" value="SVC-ZZ-VT"/>
</Properties>
</JobApplicationServer>
<JobApplicationServer name="REC_M3" comment="Connexion M3 au serveur AS400 de Developpement" type="M3">
<Properties>
<Property ke
.Jobs = (
From j In a.Descendants("Job")
Select New JOB With {
.EnvironnementApplicationJob = d.@name & "_" & a.@name & "_" & j.@name,
.DDO = returnDDO(d.@name, a.@name, a.@comment), _
.Job = j.@name, _
.RessourcesJobs = (
From l In j.Descendants("ExpectedResource")
Select New RessourceJob With {
.Name = l.@resource,
.Type = l.@operator,
.Valeur = l.Element("Value").Value
}).ToList(),
.JobAppServeur = returnHostJob(If(j.Attributes("jobApplicationServer").Count() > 0,
j.@jobApplicationServer, Nothing)), _
.Serveur = returnHost(If(j.Attributes("host").Count() > 0,
j.@host, Nothing)), _
.TypeJob = returnTypeJob(If(j.Attributes("jobType").Count() > 0, j.@jobType, Nothing)), _
<Job name="TEST_CX_M3DEV" retained="0" family="TR2" ... queue="queue_vt2m3" jobType="M3" jobApplicationServer="DEV_M3" mepType="E">pour repérer si un job dépend d'un jobApplicationServer
</Icons>
<JobApplicationServers>
<JobApplicationServer name="SMTP_CLIENT" comment="" type="MAIL">
<Properties>
<Property key="VTMAIL_ENCRYPTION" value="none"/>
<Property key="VTMAIL_PASSWORD" value=""/>
<Property key="VTMAIL_PORT" value="25"/>
<Property key="VTMAIL_SERVER" value="172.22.1.50"/>
<Property key="VTMAIL_USE_AUTH" value="false"/>
</Properties>
</JobApplicationServer>
<JobApplicationServer name="PRD_M3" comment="Connexion M3 au serveur AS400 de Production" type="M3">
<Properties>
<Property key="VTM3_PASSWORD" value="Klj32+gG"/>
<Property key="VTM3_PORT" value="6800"/>
<Property key="VTM3_SERVER" value="AMO102P"/>
<Property key="VTM3_USER" value="SVC-ZZ-VT"/>
</Properties>
</JobApplicationServer>
<JobApplicationServer name="REC_M3" comment="Connexion M3 au serveur AS400 de Developpement" type="M3">
<Properties>
<Property key="VTM3_PASSWORD" value="Klj32+gG"/>
<Property key="VTM3_PORT" value="56800"/>
<Property key="VTM3_SERVER" value="AMO303R"/>
<Property key="VTM3_USER" value="SVC-ZZ-VT"/>
</Properties>
</JobApplicationServer>
<JobApplicationServer name="DEV_M3" comment="Connexion M3 au serveur AS400 de Developpement" type="M3">
<Properties>
<Property key="VTM3_PASSWORD" value="Klj32+gG"/>
<Property key="VTM3_PORT" value="36800"/>
<Property key="VTM3_SERVER" value="AMO303R"/>
<Property key="VTM3_USER" value="SVC-ZZ-VT"/>
</Properties>
</JobApplicationServer>
</JobApplicationServers>
</Domain>
<Job name="P0007J0109" retained="0" family="TR2" comment="BPW : Extraction des donnees PivotLink et envoi sur le FTP" frequency="D" onDemand="0" isAsked="0" cycleEnabled="0" cycle="00:00:00" mepType="E">Ici, c'est un job classique, sur la ligne "<Job name=", il n'y a pas de " type="M3" ". Le host du serveur est hérité de l'application.
<Script><![CDATA#c:\VTOM5\SCRIPTS\ROS_Start_Sqlagent_Job.bat]></Script>
<Parameters>
<Parameter><![CDATA[SMO-BI101P\BPW]]></Parameter>
<Parameter><![CDATA[BPW_Send_PivotLink]]></Parameter>
</Parameters>
<Node objectType="job" x="547" y="690"/>
</Job>
<Job name="P0113H0106" retained="0" family="TR6" comment="ARTICLE HEBDO - Available to Promise. Re-creat" frequency="D" cycleEnabled="0" cycle="00:00:00" queue="queue_vt2m3" jobType="M3" jobApplicationServer="PRD_M3" mepType="E">
Public Property JobAppServeur() As String
Private privateServeur As String
Public Property Serveur() As String
Get
' Si le champ est vide, on retourne celui de son parent
If String.IsNullOrWhiteSpace(privateServeur) Then
Return parent.Serveur
Else
Return privateServeur
End If
End Get
Set(ByVal value As String)
privateServeur = value & JobAppServeur
End Set
End Property
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate DicoServersM3 As New Dictionary(Of String, String)
Private Sub CreateDicoServersM3()
Dim myServersM3 = From items In MyDoc.Root.Elements("JobApplicationServers").Elements("JobApplicationServer") _
Where items.@type = "M3"
Select items
For Each xEle As XElement In myServersM3
DicoServersM3.Add(xEle.@name, xEle.Elements("Properties").Elements("Property").Attributes("value")(2).Value)
Next xEle
End Sub
Call CreateDicoServersM3()
For Each kvp As KeyValuePair(Of String, String) In DicoServersM3
TextBox2.Text = TextBox2.Text & kvp.Key & " (" & kvp.Value & ")" & Environment.NewLine
Next kvp
PRD_M3 (AMO102P)
REC_M3 (AMO303R)
DEV_M3 (AMO303R)
Private Sub CreateDicoServersM3()
Dim myServersM3 = From items In MyDoc.Root.Elements("JobApplicationServers").Elements("JobApplicationServer") _
Where items.@type = "M3"
Select items
For Each xEle As XElement In myServersM3
DicoServersM3.Add(xEle.@name, xEle.Elements("Properties").Elements("Property").Attributes("value")(2).Value)
Next xEle
End Sub
Private Sub CreateDicoJobsM3()
Dim myJobsM3 = From items In MyDoc.Descendants("Environment").Descendants("Application").Descendants("Job") _
Where items.@jobType = "M3"
Select items
For Each xEle As XElement In myJobsM3
If DicoServersM3.ContainsKey(xEle.@jobApplicationServer) Then
DicoJobsM3.Add(xEle.@name, DicoServersM3(xEle.@jobApplicationServer))
End If
Next xEle
End Sub
.Serveur = returnHost(If(j.Attributes("host").Count() > 0, j.@host, Nothing), j.@name), _pour la ListOf JOB
Private Function returnHost(ByVal e As String, ByVal name As String) As String
If DicoJobsM3.ContainsKey(name) Then
Return DicoJobsM3(name)
Else
Return e
End If
End Function