/lib/sdk-1.5.5/services/swf.class.php

https://bitbucket.org/ardydedase/web-build-optimizer · PHP · 1344 lines · 220 code · 89 blank · 1035 comment · 33 complexity · eaa3eaf6095814648ab62c7196ebe0e4 MD5 · raw file

Large files are truncated click here to view the full file

  1. <?php
  2. /*
  3. * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. /**
  17. * The Amazon Simple Workflow Service API Reference is intended for programmers who need detailed
  18. * information about the Amazon SWF actions and data types.
  19. *
  20. * For an broader overview of the Amazon SWF programming model, please go to the <a href=
  21. * "http://docs.amazonwebservices.com/amazonswf/latest/developerguide/">Amazon SWF Developer
  22. * Guide</a>.
  23. *
  24. * This section provides an overview of Amazon SWF actions.
  25. *
  26. * <strong>Action Categories</strong>
  27. *
  28. * The Amazon SWF actions can be grouped into the following major categories.
  29. *
  30. * <ul>
  31. * <li>Actions related to Activities</li>
  32. * <li>Actions related to Deciders</li>
  33. * <li>Actions related to Workflow Executions</li>
  34. * <li>Actions related to Administration</li>
  35. * <li>Actions related to Visibility</li>
  36. * </ul>
  37. *
  38. * <strong>Actions related to Activities</strong>
  39. *
  40. * The following are actions that are performed by activity workers:
  41. *
  42. * <ul>
  43. * <li><a href="API_PollForActivityTask.html" title=
  44. * "PollForActivityTask">PollForActivityTask</a></li>
  45. * <li><a href="API_RespondActivityTaskCompleted.html" title=
  46. * "RespondActivityTaskCompleted">RespondActivityTaskCompleted</a></li>
  47. * <li><a href="API_RespondActivityTaskFailed.html" title=
  48. * "RespondActivityTaskFailed">RespondActivityTaskFailed</a></li>
  49. * <li><a href="API_RespondActivityTaskCanceled.html" title=
  50. * "RespondActivityTaskCanceled">RespondActivityTaskCanceled</a></li>
  51. * <li><a href="API_RecordActivityTaskHeartbeat.html" title=
  52. * "RecordActivityTaskHeartbeat">RecordActivityTaskHeartbeat</a></li>
  53. * </ul>
  54. *
  55. * Activity workers use the <a href="API_PollForActivityTask.html" title=
  56. * "PollForActivityTask">PollForActivityTask</a> to get new activity tasks. After a worker
  57. * receives an activity task from Amazon SWF, it performs the task and responds using <a href=
  58. * "API_RespondActivityTaskCompleted.html" title=
  59. * "RespondActivityTaskCompleted">RespondActivityTaskCompleted</a> if successful or <a href=
  60. * "API_RespondActivityTaskFailed.html" title=
  61. * "RespondActivityTaskFailed">RespondActivityTaskFailed</a> if unsuccessful.
  62. *
  63. * <strong>Actions related to Deciders</strong>
  64. *
  65. * The following are actions that are performed by deciders:
  66. *
  67. * <ul>
  68. * <li><a href="API_PollForDecisionTask.html" title=
  69. * "PollForDecisionTask">PollForDecisionTask</a></li>
  70. * <li><a href="API_RespondDecisionTaskCompleted.html" title=
  71. * "RespondDecisionTaskCompleted">RespondDecisionTaskCompleted</a></li>
  72. * </ul>
  73. *
  74. * Deciders use <a href="API_PollForDecisionTask.html" title=
  75. * "PollForDecisionTask">PollForDecisionTask</a> to get decision tasks. After a decider receives a
  76. * decision task from Amazon SWF, it examines its workflow execution history and decides what to
  77. * do next. It calls <a href="API_RespondDecisionTaskCompleted.html" title=
  78. * "RespondDecisionTaskCompleted">RespondDecisionTaskCompleted</a> to complete the decision task
  79. * and provide zero or more next decisions.
  80. *
  81. * <strong>Actions related to Workflow Executions</strong>
  82. *
  83. * The following actions operate on a workflow execution:
  84. *
  85. * <ul>
  86. * <li><a href="API_RequestCancelWorkflowExecution.html" title=
  87. * "RequestCancelWorkflowExecution">RequestCancelWorkflowExecution</a></li>
  88. * <li><a href="API_StartWorkflowExecution.html" title=
  89. * "StartWorkflowExecution">StartWorkflowExecution</a></li>
  90. * <li><a href="API_SignalWorkflowExecution.html" title=
  91. * "SignalWorkflowExecution">SignalWorkflowExecution</a></li>
  92. * <li><a href="API_TerminateWorkflowExecution.html" title=
  93. * "TerminateWorkflowExecution">TerminateWorkflowExecution</a></li>
  94. * </ul>
  95. *
  96. * <strong>Actions related to Administration</strong>
  97. *
  98. * Although you can perform administrative tasks from the Amazon SWF console, you can use the
  99. * actions in this section to automate functions or build your own administrative tools.
  100. *
  101. * <strong>Activity Management</strong>
  102. *
  103. * <ul>
  104. * <li><a href="API_RegisterActivityType.html" title=
  105. * "RegisterActivityType">RegisterActivityType</a></li>
  106. * <li><a href="API_DeprecateActivityType.html" title=
  107. * "DeprecateActivityType">DeprecateActivityType</a></li>
  108. * </ul>
  109. *
  110. * <strong>Workflow Management</strong>
  111. *
  112. * <ul>
  113. * <li><a href="API_RegisterWorkflowType.html" title=
  114. * "RegisterWorkflowType">RegisterWorkflowType</a></li>
  115. * <li><a href="API_DeprecateWorkflowType.html" title=
  116. * "DeprecateWorkflowType">DeprecateWorkflowType</a></li>
  117. * </ul>
  118. *
  119. * <strong>Domain Management</strong>
  120. *
  121. * <ul>
  122. * <li><a href="API_RegisterDomain.html" title="RegisterDomain">RegisterDomain</a></li>
  123. * <li><a href="API_DeprecateDomain.html" title="DeprecateDomain">DeprecateDomain</a></li>
  124. * </ul>
  125. *
  126. * <strong>Workflow Execution Management</strong>
  127. *
  128. * <ul>
  129. * <li><a href="API_RequestCancelWorkflowExecution.html" title=
  130. * "RequestCancelWorkflowExecution">RequestCancelWorkflowExecution</a></li>
  131. * <li><a href="API_TerminateWorkflowExecution.html" title=
  132. * "TerminateWorkflowExecution">TerminateWorkflowExecution</a></li>
  133. * </ul>
  134. *
  135. * <strong>Visibility Actions</strong>
  136. *
  137. * Although you can perform visibility actions from the Amazon SWF console, you can use the
  138. * actions in this section to build your own console or administrative tools.
  139. *
  140. * <strong>Activity Visibility</strong>
  141. *
  142. * <ul>
  143. * <li><a href="API_ListActivityTypes.html" title="ListActivities">ListActivityTypes</a></li>
  144. * <li><a href="API_DescribeActivityType.html" title=
  145. * "DescribeActivityType">DescribeActivity</a></li>
  146. * </ul>
  147. *
  148. * <strong>Workflow Visibility</strong>
  149. *
  150. * <ul>
  151. * <li><a href="API_ListWorkflowTypes.html" title="ListWorkflowTypes">ListWorkflowTypes</a></li>
  152. * <li><a href="API_DescribeWorkflowType.html" title=
  153. * "DescribeWorkflowType">DescribeWorkflowType</a></li>
  154. * </ul>
  155. *
  156. * <strong>Workflow Execution Visibility</strong>
  157. *
  158. * <ul>
  159. * <li><a href="API_DescribeWorkflowExecution.html" title=
  160. * "DescribeWorkflowExecution">DescribeWorkflowExecution</a></li>
  161. * <li><a href="API_ListOpenWorkflowExecutions.html" title=
  162. * "ListOpenWorkflowExecutions">ListOpenWorkflowExecutions</a></li>
  163. * <li><a href="API_ListClosedWorkflowExecutions.html" title=
  164. * "ListClosedWorkflowExecutions">ListClosedWorkflowExecutions</a></li>
  165. * <li><a href="API_CountOpenWorkflowExecutions.html" title=
  166. * "CountOpenWorkflowExecutions">CountOpenWorkflowExecutions</a></li>
  167. * <li><a href="API_CountClosedWorkflowExecutions.html" title=
  168. * "CountClosedWorkflowExecutions">CountClosedWorkflowExecutions</a></li>
  169. * <li><a href="API_GetWorkflowExecutionHistory.html" title=
  170. * "GetWorkflowExecutionHistory">GetWorkflowExecutionHistory</a></li>
  171. * </ul>
  172. *
  173. * <strong>Domain Visibility</strong>
  174. *
  175. * <ul>
  176. * <li><a href="API_ListDomains.html" title="ListDomains">ListDomains</a></li>
  177. * <li><a href="API_DescribeDomain.html" title="DescribeDomain">DescribeDomain</a></li>
  178. * </ul>
  179. *
  180. * <strong>Task List Visibility</strong>
  181. *
  182. * <ul>
  183. * <li><a href="API_CountPendingActivityTasks.html" title=
  184. * "CountPendingActivityTasks">CountPendingActivityTasks</a></li>
  185. * <li><a href="API_CountPendingDecisionTasks.html" title=
  186. * "CountPendingDecisionTasks">CountPendingDecisionTasks</a></li>
  187. * </ul>
  188. *
  189. * @version 2012.05.01
  190. * @license See the included NOTICE.md file for complete information.
  191. * @copyright See the included NOTICE.md file for complete information.
  192. * @link http://aws.amazon.com/simpleworkflow/ Amazon Simple Workflow
  193. * @link http://aws.amazon.com/simpleworkflow/documentation/ Amazon Simple Workflow documentation
  194. */
  195. class AmazonSWF extends CFRuntime
  196. {
  197. /*%******************************************************************************************%*/
  198. // CLASS CONSTANTS
  199. /**
  200. * Specify the queue URL for the United States East (Northern Virginia) Region.
  201. */
  202. const REGION_US_E1 = 'swf.us-east-1.amazonaws.com';
  203. /**
  204. * Specify the queue URL for the United States East (Northern Virginia) Region.
  205. */
  206. const REGION_VIRGINIA = self::REGION_US_E1;
  207. /**
  208. * Default service endpoint.
  209. */
  210. const DEFAULT_URL = self::REGION_US_E1;
  211. /*%******************************************************************************************%*/
  212. // STATUS CONSTANTS
  213. /**
  214. * Status: Registered
  215. */
  216. const STATUS_REGISTERED = 'REGISTERED';
  217. /**
  218. * Status: Deprecated
  219. */
  220. const STATUS_DEPRECATED = 'DEPRECATED';
  221. /*%******************************************************************************************%*/
  222. // POLICY CONSTANTS
  223. /**
  224. * Policy: Terminate
  225. */
  226. const POLICY_TERMINATE = 'TERMINATE';
  227. /**
  228. * Policy: Request Cancel
  229. */
  230. const POLICY_REQUEST_CANCEL = 'REQUEST_CANCEL';
  231. /**
  232. * Policy: Abandon
  233. */
  234. const POLICY_ABANDON = 'ABANDON';
  235. /*%******************************************************************************************%*/
  236. // CONSTRUCTOR
  237. /**
  238. * Constructs a new instance of <AmazonSWF>.
  239. *
  240. * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  241. * <li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  242. * <li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  243. * <li><code>default_cache_config</code> - <code>string</code> - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the <set_cache_config()> method. Valid values are: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  244. * <li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  245. * <li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  246. * <li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  247. * @return void
  248. */
  249. public function __construct(array $options = array())
  250. {
  251. $this->api_version = '2012-01-25';
  252. $this->hostname = self::DEFAULT_URL;
  253. $this->auth_class = 'AuthV3JSON';
  254. $this->operation_prefix = "x-amz-target:SimpleWorkflowService.";
  255. return parent::__construct($options);
  256. }
  257. /*%******************************************************************************************%*/
  258. // SETTERS
  259. /**
  260. * This allows you to explicitly sets the region for the service to use.
  261. *
  262. * @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>.
  263. * @return $this A reference to the current instance.
  264. */
  265. public function set_region($region)
  266. {
  267. // @codeCoverageIgnoreStart
  268. $this->set_hostname($region);
  269. return $this;
  270. // @codeCoverageIgnoreEnd
  271. }
  272. /*%******************************************************************************************%*/
  273. // SERVICE METHODS
  274. /**
  275. * Returns the number of closed workflow executions within the given domain that meet the
  276. * specified filtering criteria.
  277. *
  278. * <p class="note">
  279. * This operation is eventually consistent. The results are best effort and may not exactly
  280. * reflect recent updates and changes.
  281. * </p>
  282. *
  283. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  284. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow executions to count.</li>
  285. * <li><code>startTimeFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that meet the start time criteria of the filter are counted. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  286. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  287. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  288. * </ul></li>
  289. * <li><code>closeTimeFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that meet the close time criteria of the filter are counted. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  290. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  291. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  292. * </ul></li>
  293. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the <code>WorkflowId</code> in the filter are counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  294. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  295. * </ul></li>
  296. * <li><code>typeFilter</code> - <code>array</code> - Optional - If specified, indicates the type of the workflow executions to be counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  297. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  298. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  299. * </ul></li>
  300. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have a tag that matches the filter are counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  301. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  302. * </ul></li>
  303. * <li><code>closeStatusFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that match this close status are counted. This filter has an affect only if <code>executionStatus</code> is specified as <code>CLOSED</code>. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  304. * <li><code>status</code> - <code>string</code> - Required - The close status that must match the close status of an execution for it to meet the criteria of this filter. This field is required. [Allowed values: <code>COMPLETED</code>, <code>FAILED</code>, <code>CANCELED</code>, <code>TERMINATED</code>, <code>CONTINUED_AS_NEW</code>, <code>TIMED_OUT</code>]</li>
  305. * </ul></li>
  306. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  307. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  308. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  309. */
  310. public function count_closed_workflow_executions($opt = null)
  311. {
  312. if (!$opt) $opt = array();
  313. $opt = json_encode($opt);
  314. return $this->authenticate('CountClosedWorkflowExecutions', $opt);
  315. }
  316. /**
  317. * Returns the number of open workflow executions within the given domain that meet the specified
  318. * filtering criteria.
  319. *
  320. * <p class="note">
  321. * This operation is eventually consistent. The results are best effort and may not exactly
  322. * reflect recent updates and changes.
  323. * </p>
  324. *
  325. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  326. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow executions to count.</li>
  327. * <li><code>startTimeFilter</code> - <code>array</code> - Required - Specifies the start time criteria that workflow executions must meet in order to be counted. <ul>
  328. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  329. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  330. * </ul></li>
  331. * <li><code>typeFilter</code> - <code>array</code> - Optional - Specifies the type of the workflow executions to be counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  332. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  333. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  334. * </ul></li>
  335. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have a tag that matches the filter are counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  336. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  337. * </ul></li>
  338. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the <code>WorkflowId</code> in the filter are counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  339. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  340. * </ul></li>
  341. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  342. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  343. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  344. */
  345. public function count_open_workflow_executions($opt = null)
  346. {
  347. if (!$opt) $opt = array();
  348. $opt = json_encode($opt);
  349. return $this->authenticate('CountOpenWorkflowExecutions', $opt);
  350. }
  351. /**
  352. * Returns the estimated number of activity tasks in the specified task list. The count returned
  353. * is an approximation and is not guaranteed to be exact. If you specify a task list that no
  354. * activity task was ever scheduled in then 0 will be returned.
  355. *
  356. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  357. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the task list.</li>
  358. * <li><code>taskList</code> - <code>array</code> - Required - The name of the task list. <ul>
  359. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  360. * </ul></li>
  361. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  362. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  363. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  364. */
  365. public function count_pending_activity_tasks($opt = null)
  366. {
  367. if (!$opt) $opt = array();
  368. $opt = json_encode($opt);
  369. return $this->authenticate('CountPendingActivityTasks', $opt);
  370. }
  371. /**
  372. * Returns the estimated number of decision tasks in the specified task list. The count returned
  373. * is an approximation and is not guaranteed to be exact. If you specify a task list that no
  374. * decision task was ever scheduled in then 0 will be returned.
  375. *
  376. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  377. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the task list.</li>
  378. * <li><code>taskList</code> - <code>array</code> - Required - The name of the task list. <ul>
  379. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  380. * </ul></li>
  381. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  382. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  383. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  384. */
  385. public function count_pending_decision_tasks($opt = null)
  386. {
  387. if (!$opt) $opt = array();
  388. $opt = json_encode($opt);
  389. return $this->authenticate('CountPendingDecisionTasks', $opt);
  390. }
  391. /**
  392. * Deprecates the specified <em>activity type</em>. After an activity type has been deprecated,
  393. * you cannot create new tasks of that activity type. Tasks of this type that were scheduled
  394. * before the type was deprecated will continue to run.
  395. *
  396. * <p class="note">
  397. * This operation is eventually consistent. The results are best effort and may not exactly
  398. * reflect recent updates and changes.
  399. * </p>
  400. *
  401. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  402. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity type is registered.</li>
  403. * <li><code>activityType</code> - <code>array</code> - Required - The activity type to deprecate. <ul>
  404. * <li><code>name</code> - <code>string</code> - Required - The name of this activity. <p class="note">The combination of activity type name and version must be unique within a domain.</p></li>
  405. * <li><code>version</code> - <code>string</code> - Required - The version of this activity. <p class="note">The combination of activity type name and version must be unique with in a domain.</p></li>
  406. * </ul></li>
  407. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  408. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  409. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  410. */
  411. public function deprecate_activity_type($opt = null)
  412. {
  413. if (!$opt) $opt = array();
  414. $opt = json_encode($opt);
  415. return $this->authenticate('DeprecateActivityType', $opt);
  416. }
  417. /**
  418. * Deprecates the specified domain. After a domain has been deprecated it cannot be used to create
  419. * new workflow executions or register new types. However, you can still use visibility actions on
  420. * this domain. Deprecating a domain also deprecates all activity and workflow types registered in
  421. * the domain. Executions that were started before the domain was deprecated will continue to run.
  422. *
  423. * <p class="note">
  424. * This operation is eventually consistent. The results are best effort and may not exactly
  425. * reflect recent updates and changes.
  426. * </p>
  427. *
  428. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  429. * <li><code>name</code> - <code>string</code> - Required - The name of the domain to deprecate.</li>
  430. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  431. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  432. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  433. */
  434. public function deprecate_domain($opt = null)
  435. {
  436. if (!$opt) $opt = array();
  437. $opt = json_encode($opt);
  438. return $this->authenticate('DeprecateDomain', $opt);
  439. }
  440. /**
  441. * Deprecates the specified <em>workflow type</em>. After a workflow type has been deprecated, you
  442. * cannot create new executions of that type. Executions that were started before the type was
  443. * deprecated will continue to run. A deprecated workflow type may still be used when calling
  444. * visibility actions.
  445. *
  446. * <p class="note">
  447. * This operation is eventually consistent. The results are best effort and may not exactly
  448. * reflect recent updates and changes.
  449. * </p>
  450. *
  451. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  452. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the workflow type is registered.</li>
  453. * <li><code>workflowType</code> - <code>array</code> - Required - The workflow type to deprecate. <ul>
  454. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  455. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  456. * </ul></li>
  457. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  458. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  459. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  460. */
  461. public function deprecate_workflow_type($opt = null)
  462. {
  463. if (!$opt) $opt = array();
  464. $opt = json_encode($opt);
  465. return $this->authenticate('DeprecateWorkflowType', $opt);
  466. }
  467. /**
  468. * Returns information about the specified activity type. This includes configuration settings
  469. * provided at registration time as well as other general information about the type.
  470. *
  471. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  472. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity type is registered.</li>
  473. * <li><code>activityType</code> - <code>array</code> - Required - The activity type to describe. <ul>
  474. * <li><code>name</code> - <code>string</code> - Required - The name of this activity. <p class="note">The combination of activity type name and version must be unique within a domain.</p></li>
  475. * <li><code>version</code> - <code>string</code> - Required - The version of this activity. <p class="note">The combination of activity type name and version must be unique with in a domain.</p></li>
  476. * </ul></li>
  477. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  478. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  479. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  480. */
  481. public function describe_activity_type($opt = null)
  482. {
  483. if (!$opt) $opt = array();
  484. $opt = json_encode($opt);
  485. return $this->authenticate('DescribeActivityType', $opt);
  486. }
  487. /**
  488. * Returns information about the specified domain including description and status.
  489. *
  490. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  491. * <li><code>name</code> - <code>string</code> - Required - The name of the domain to describe.</li>
  492. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  493. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  494. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  495. */
  496. public function describe_domain($opt = null)
  497. {
  498. if (!$opt) $opt = array();
  499. $opt = json_encode($opt);
  500. return $this->authenticate('DescribeDomain', $opt);
  501. }
  502. /**
  503. * Returns information about the specified workflow execution including its type and some
  504. * statistics.
  505. *
  506. * <p class="note">
  507. * This operation is eventually consistent. The results are best effort and may not exactly
  508. * reflect recent updates and changes.
  509. * </p>
  510. *
  511. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  512. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution.</li>
  513. * <li><code>execution</code> - <code>array</code> - Required - The workflow execution to describe. <ul>
  514. * <li><code>workflowId</code> - <code>string</code> - Required - The user defined identifier associated with the workflow execution.</li>
  515. * <li><code>runId</code> - <code>string</code> - Required - A system generated unique identifier for the workflow execution.</li>
  516. * </ul></li>
  517. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  518. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  519. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  520. */
  521. public function describe_workflow_execution($opt = null)
  522. {
  523. if (!$opt) $opt = array();
  524. $opt = json_encode($opt);
  525. return $this->authenticate('DescribeWorkflowExecution', $opt);
  526. }
  527. /**
  528. * Returns information about the specified <em>workflow type</em>. This includes configuration
  529. * settings specified when the type was registered and other information such as creation date,
  530. * current status, etc.
  531. *
  532. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  533. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which this workflow type is registered.</li>
  534. * <li><code>workflowType</code> - <code>array</code> - Required - The workflow type to describe. <ul>
  535. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  536. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  537. * </ul></li>
  538. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  539. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  540. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  541. */
  542. public function describe_workflow_type($opt = null)
  543. {
  544. if (!$opt) $opt = array();
  545. $opt = json_encode($opt);
  546. return $this->authenticate('DescribeWorkflowType', $opt);
  547. }
  548. /**
  549. * Returns the history of the specified workflow execution. The results may be split into multiple
  550. * pages. To retrieve subsequent pages, make the call again using the <code>nextPageToken</code>
  551. * returned by the initial call.
  552. *
  553. * <p class="note">
  554. * This operation is eventually consistent. The results are best effort and may not exactly
  555. * reflect recent updates and changes.
  556. * </p>
  557. *
  558. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  559. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution.</li>
  560. * <li><code>execution</code> - <code>array</code> - Required - Specifies the workflow execution for which to return the history. <ul>
  561. * <li><code>workflowId</code> - <code>string</code> - Required - The user defined identifier associated with the workflow execution.</li>
  562. * <li><code>runId</code> - <code>string</code> - Required - A system generated unique identifier for the workflow execution.</li>
  563. * </ul></li>
  564. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If a <code>NextPageToken</code> is returned, the result has more than one pages. To get the next page, repeat the call and specify the nextPageToken with all other arguments unchanged.</li>
  565. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - Specifies the maximum number of history events returned in one page. The next page in the result is identified by the <code>NextPageToken</code> returned. By default 100 history events are returned in a page but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size larger than 100.</li>
  566. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimeStamp</code> of the events.</li>
  567. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  568. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  569. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  570. */
  571. public function get_workflow_execution_history($opt = null)
  572. {
  573. if (!$opt) $opt = array();
  574. $opt = json_encode($opt);
  575. return $this->authenticate('GetWorkflowExecutionHistory', $opt);
  576. }
  577. /**
  578. * Returns information about all activities registered in the specified domain that match the
  579. * specified name and registration status. The result includes information like creation date,
  580. * current status of the activity, etc. The results may be split into multiple pages. To retrieve
  581. * subsequent pages, make the call again using the <code>nextPageToken</code> returned by the
  582. * initial call.
  583. *
  584. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  585. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity types have been registered.</li>
  586. * <li><code>name</code> - <code>string</code> - Optional - If specified, only lists the activity types that have this name.</li>
  587. * <li><code>registrationStatus</code> - <code>string</code> - Required - Specifies the registration status of the activity types to list. [Allowed values: <code>REGISTERED</code>, <code>DEPRECATED</code>]</li>
  588. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextResultToken</code> was returned, the results have more than one page. To get the next page of results, repeat the call with the <code>nextPageToken</code> and keep all other arguments unchanged.</li>
  589. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  590. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the <code>name</code> of the activity types.</li>
  591. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  592. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  593. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  594. */
  595. public function list_activity_types($opt = null)
  596. {
  597. if (!$opt) $opt = array();
  598. $opt = json_encode($opt);
  599. return $this->authenticate('ListActivityTypes', $opt);
  600. }
  601. /**
  602. * Returns a list of closed workflow executions in the specified domain that meet the filtering
  603. * criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the
  604. * call again using the nextPageToken returned by the initial call.
  605. *
  606. * <p class="note">
  607. * This operation is eventually consistent. The results are best effort and may not exactly
  608. * reflect recent updates and changes.
  609. * </p>
  610. *
  611. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  612. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the workflow executions to list.</li>
  613. * <li><code>startTimeFilter</code> - <code>array</code> - Optional - If specified, the workflow executions are included in the returned results based on whether their start times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their start times. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  614. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  615. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  616. * </ul></li>
  617. * <li><code>closeTimeFilter</code> - <code>array</code> - Optional - If specified, the workflow executions are included in the returned results based on whether their close times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their close times. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  618. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  619. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  620. * </ul></li>
  621. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the workflow id specified in the filter are returned. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  622. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  623. * </ul></li>
  624. * <li><code>closeStatusFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that match this <em>close status</em> are listed. For example, if TERMINATED is specified, then only TERMINATED workflow executions are listed. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  625. * <li><code>status</code> - <code>string</code> - Required - The close status that must match the close status of an execution for it to meet the criteria of this filter. This field is required. [Allowed values: <code>COMPLETED</code>, <code>FAILED</code>, <code>CANCELED</code>, <code>TERMINATED</code>, <code>CONTINUED_AS_NEW</code>, <code>TIMED_OUT</code>]</li>
  626. * </ul></li>
  627. * <li><code>typeFilter</code> - <code>array</code> - Optional - If specified, only executions of the type specified in the filter are returned. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  628. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  629. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  630. * </ul></li>
  631. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have the matching tag are listed. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  632. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  633. * </ul></li>
  634. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the results are being paginated. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  635. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  636. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in descending order of the start or the close time of the executions.</li>
  637. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  638. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  639. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  640. */
  641. public function list_closed_workflow_executions($opt = null)
  642. {
  643. if (!$opt) $opt = array();
  644. $opt = json_encode($opt);
  645. return $this->authenticate('ListClosedWorkflowExecutions', $opt);
  646. }
  647. /**
  648. * Returns the list of domains registered in the account. The results may be split into multiple
  649. * pages. To retrieve subsequent pages, make the call again using the nextPageToken returned by
  650. * the initial call.
  651. *
  652. * <p class="note">
  653. * This operation is eventually consistent. The results are best effort and may not exactly
  654. * reflect recent updates and changes.
  655. * </p>
  656. *
  657. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  658. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the result has more than one page. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  659. * <li><code>registrationStatus</code> - <code>string</code> - Required - Specifies the registration status of the domains to list. [Allowed values: <code>REGISTERED</code>, <code>DEPRECATED</code>]</li>
  660. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  661. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the <code>name</code> of the domains.</li>
  662. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  663. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  664. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  665. */
  666. public function list_domains($opt = null)
  667. {
  668. if (!$opt) $opt = array();
  669. $opt = json_encode($opt);
  670. return $this->authenticate('ListDomains', $opt);
  671. }
  672. /**
  673. * Returns a list of open workflow executions in the specified domain that meet the filtering
  674. * criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the
  675. * call again using the nextPageToken returned by the initial call.
  676. *
  677. * <p class="note">…