Highlighted
Enthusiast
Enthusiast

Criteria for workflow subscription via vRealize orchestrator

Jump to solution

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

 

   payload>lifecycleState> phase : PRE
   payload>lifecycleState> state : VMPSMasterWorkflow32.Requested

//M

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Enthusiast
Enthusiast

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);

View solution in original post

0 Kudos
6 Replies
Highlighted
Expert
Expert

Does this help ?

1.png

0 Kudos
Highlighted
Enthusiast
Enthusiast

Thanks harkamal  but  my idea is a bit different, i would like to do it via Orchestrator, not frontend.

2016-04-13 16-04-19_VMware vRealize Orchestrator.png

0 Kudos
Highlighted
Enthusiast
Enthusiast

Hi,

I answered this here: Question regarding vRA7 Register a System Workflow Subscription

Hopefully that helps.

0 Kudos
Highlighted
Enthusiast
Enthusiast

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.

0 Kudos
Highlighted
Enthusiast
Enthusiast

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);

View solution in original post

0 Kudos
Highlighted
Enthusiast
Enthusiast
Thx, it is what I need!:)
0 Kudos