Hi all,
I have been trying to get workflow "Register a system workflow subscription" to work. Subscription seems to work fine, but i cannot come up with syntax for criteria part, could some of you share that information. What should be defined there if i would like to get trigger it at state:
phase: PRE
state: VMPSMasterWorkflow32.Requested
//M
Sure, no prob. Here is the scriptable code I am using to create the subscription criteria for machine type = VM, machine provisioning, and POST phase:
var provisioningCriteriaObj = {
"type" : "and",
"subClauses" : [ {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~machine~type"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "integer",
"value" : 0
}
}
}, {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~lifecycleState~state"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "string",
"value" : "VMPSMasterWorkflow32.MachineProvisioned"
}
}
}, {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~lifecycleState~phase"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "string",
"value" : "POST"
}
}
} ]
};
provisioningCriteria = JSON.stringify(provisioningCriteriaObj);
Does this help ?
Thanks harkamal but my idea is a bit different, i would like to do it via Orchestrator, not frontend.
Hi,
I answered this here: Question regarding vRA7 Register a System Workflow Subscription
Hopefully that helps.
Hi befreeman ,
Could you be so kind and publish what you have received from:
var criteria = vCACCAFEEBSHelper.getCriteriaFromWorkflowSubscription(workflowSubscription);
System.log(criteria);
because I am a bit suspicious of what i got from my query.
Sure, no prob. Here is the scriptable code I am using to create the subscription criteria for machine type = VM, machine provisioning, and POST phase:
var provisioningCriteriaObj = {
"type" : "and",
"subClauses" : [ {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~machine~type"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "integer",
"value" : 0
}
}
}, {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~lifecycleState~state"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "string",
"value" : "VMPSMasterWorkflow32.MachineProvisioned"
}
}
}, {
"type" : "expression",
"operator" : {
"type" : "equals"
},
"leftOperand" : {
"type" : "path",
"path" : "data~lifecycleState~phase"
},
"rightOperand" : {
"type" : "constant",
"value" : {
"type" : "string",
"value" : "POST"
}
}
} ]
};
provisioningCriteria = JSON.stringify(provisioningCriteriaObj);