71 | | Outros parâmetros disponíveis para o {{createChildInstance}} podem ser vistos na [htdocs:wf/api/index.html Documentação do código fonte do Workflow, gerada com phpDocumentor] |
| 71 | == Parâmetros Adicionais na Assinatura do método createChildInstance == |
| 72 | |
| 73 | Nos exemplos anteriores foram feitas chamadas ao método usando o único parâmetro obrigatório que é o nome da atividade tipo Start a ser usada para criar a instância. Mas é possível passar outros parâmetros, conforme está descrito nos comentários phpdoc do método: |
| 74 | |
| 75 | {{{ |
| 76 | int createChildInstance (string $activityName, [mixed $properties = false], [mixed $user = '*'], [bool $parentLock = true]) |
| 77 | |
| 78 | * string $activityName: The name of the activity of the new instance |
| 79 | * mixed $properties: Determines the new instance properties. |
| 80 | If "true" the properties of the current instance will be inherited by the new instance. |
| 81 | If "false" no properties will be set. |
| 82 | If an "array" (format: property_name => property_value) every property defined in that array will be available to the new instance. |
| 83 | False by default |
| 84 | * mixed $user: The ID of the user who will own the new instance or '*' (i.e., everyone). '*' by default |
| 85 | * bool $parentLock: Flag that determines if the parent instance MUST wait for it's children completion before it's own completion ("true") or not ("false"). "true" by default. |
| 86 | |
| 87 | }}} |
| 88 | |
| 89 | Caso a instância filha seja criada a partir de uma instância válida, ficará registrado um relacionamento entre elas que pode ser recuperado através da classe wf_instance, com o método getChildren. |
| 90 | |
| 91 | Por outro lado, caso não exista uma instância válida, como no caso do createChildInstance ser invocado em uma atividade standalone, o relacionamento não será criado e a nova instância será independente. |